I’ve built on @espen og @Gjaevert 's work with motion flows in Thingsplex so the flow checks home/sleep mode, time of day, and then for an “override” (based on espen’s tobias sover switch). I’m going to put in a physical switch next time I get to Ikea and pick one up.
If the 3 lights I have are dimmed, then turning on the virtual switch in the apps makes the light go to 100% after the next motion, and they stay at 100% until I turn off the switch. After the lights turn off while in the 100% brightness mode, it resets the virtual switch after 60 minutes
I’ve used this same concept to create my own mode here, and in other flows where my daughter has her own mode for being home or not in order to control her Adax heater - home mode is nothing more than a global variable, and by creating a new variable that is also global, you can have an unlimited number of “modes.” I wouldn’t try to change the original 4 modes - it would cause you enormous headaches later for little benefit.
My light flow:
{
"Id": "SCNkolMiEWhvuAS",
"ClassId": "CviO8YbFXdlpcv1",
"Author": "espenh.no",
"Version": 0,
"CreatedAt": "2022-01-11T13:55:37.810533038+01:00",
"UpdatedAt": "2022-01-13T09:17:42.946347371+01:00",
"Name": "Trigger dressing room lights on presence",
"Group": "motion detection",
"Description": "Dressing room lights motion switch",
"Nodes": [
{
"Id": "4",
"Type": "wait",
"Label": "wait 5 min",
"SuccessTransition": "18",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "",
"Service": "",
"ServiceInterface": "",
"Config": 300000,
"Ui": {
"nodeType": "",
"x": 352,
"y": 1103
},
"TypeAlias": "Delay"
},
{
"Id": "6",
"Type": "if",
"Label": "if presence = true",
"SuccessTransition": "",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "",
"Service": "",
"ServiceInterface": "",
"Config": {
"Expression": [
{
"BooleanOperator": "",
"LeftVariableIsGlobal": false,
"LeftVariableName": "",
"Operand": "eq",
"RightVariable": {
"Value": true,
"ValueType": "bool"
}
}
],
"FalseTransition": "7",
"TrueTransition": "17"
},
"Ui": {
"nodeType": "",
"x": 59,
"y": 907
},
"TypeAlias": "If condition"
},
{
"Id": "7",
"Type": "if",
"Label": "if presence = false",
"SuccessTransition": "",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "",
"Service": "",
"ServiceInterface": "",
"Config": {
"Expression": [
{
"BooleanOperator": "",
"LeftVariableIsGlobal": false,
"LeftVariableName": "",
"Operand": "eq",
"RightVariable": {
"Value": false,
"ValueType": "bool"
}
}
],
"FalseTransition": "",
"TrueTransition": "4"
},
"Ui": {
"nodeType": "",
"x": 336,
"y": 913
},
"TypeAlias": "If condition"
},
{
"Id": "8",
"Type": "if",
"Label": "if home",
"SuccessTransition": "",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "",
"Service": "",
"ServiceInterface": "",
"Config": {
"Expression": [
{
"BooleanOperator": "",
"LeftVariableIsGlobal": true,
"LeftVariableName": "fh.home.mode",
"Operand": "eq",
"RightVariable": {
"Value": "home",
"ValueType": "string"
}
}
],
"FalseTransition": "9",
"TrueTransition": "16"
},
"Ui": {
"nodeType": "",
"x": 220,
"y": 316
},
"TypeAlias": "If condition"
},
{
"Id": "9",
"Type": "if",
"Label": "if sleep",
"SuccessTransition": "",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "",
"Service": "",
"ServiceInterface": "",
"Config": {
"Expression": [
{
"BooleanOperator": "",
"LeftVariableIsGlobal": true,
"LeftVariableName": "fh.home.mode",
"Operand": "eq",
"RightVariable": {
"Value": "sleep",
"ValueType": "string"
}
}
],
"FalseTransition": "",
"TrueTransition": "29"
},
"Ui": {
"nodeType": "",
"x": 732,
"y": 325
},
"TypeAlias": "If condition"
},
{
"Id": "10",
"Type": "if",
"Label": "if presence = true",
"SuccessTransition": "",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "",
"Service": "",
"ServiceInterface": "",
"Config": {
"Expression": [
{
"BooleanOperator": "",
"LeftVariableIsGlobal": false,
"LeftVariableName": "",
"Operand": "eq",
"RightVariable": {
"Value": true,
"ValueType": "bool"
}
}
],
"FalseTransition": "13",
"TrueTransition": "12"
},
"Ui": {
"nodeType": "",
"x": 770,
"y": 909
},
"TypeAlias": "If condition"
},
{
"Id": "12",
"Type": "action",
"Label": "plug on",
"SuccessTransition": "25",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "pt:j1/mt:cmd/rt:dev/rn:hue/ad:1/sv:out_lvl_switch/ad:l27_0",
"Service": "out_lvl_switch",
"ServiceInterface": "cmd.binary.set",
"Config": {
"DefaultValue": {
"Value": true,
"ValueType": "bool"
},
"IsVariableGlobal": false,
"Props": {},
"RegisterAsVirtualService": false,
"ResponseToTopic": "",
"VariableName": "",
"VirtualServiceGroup": "",
"VirtualServiceProps": {}
},
"Ui": {
"nodeType": "",
"x": 733,
"y": 1296
},
"TypeAlias": "Action",
"LastValue": false
},
{
"Id": "13",
"Type": "if",
"Label": "if presence = false",
"SuccessTransition": "",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "",
"Service": "",
"ServiceInterface": "",
"Config": {
"Expression": [
{
"BooleanOperator": "",
"LeftVariableIsGlobal": false,
"LeftVariableName": "",
"Operand": "eq",
"RightVariable": {
"Value": false,
"ValueType": "bool"
}
}
],
"FalseTransition": "",
"TrueTransition": "14"
},
"Ui": {
"nodeType": "",
"x": 1058,
"y": 908
},
"TypeAlias": "If condition"
},
{
"Id": "14",
"Type": "wait",
"Label": "wait 1 min",
"SuccessTransition": "26",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "",
"Service": "",
"ServiceInterface": "",
"Config": 60000,
"Ui": {
"nodeType": "",
"x": 1057,
"y": 1091
},
"TypeAlias": "Delay"
},
{
"Id": "16",
"Type": "iftime",
"Label": "Daytime",
"SuccessTransition": "6",
"TimeoutTransition": "",
"ErrorTransition": "10",
"Address": "",
"Service": "",
"ServiceInterface": "",
"Config": {
"Expression": [
{
"Action": "a",
"From": "07:00",
"To": "21:59",
"Weekday": "1"
},
{
"Action": "a",
"From": "07:00",
"To": "21:59",
"Weekday": "2"
},
{
"Action": "a",
"From": "07:00",
"To": "21:59",
"Weekday": "3"
},
{
"Action": "a",
"From": "07:00",
"To": "21:59",
"Weekday": "4"
},
{
"Action": "a",
"From": "07:00",
"To": "21:59",
"Weekday": "5"
},
{
"Action": "a",
"From": "07:00",
"To": "21:59",
"Weekday": "6"
},
{
"Action": "a",
"From": "07:00",
"To": "21:59",
"Weekday": "0"
}
]
},
"Ui": {
"nodeType": "",
"x": 223,
"y": 514
},
"TypeAlias": "Time filter"
},
{
"Id": "17",
"Type": "action",
"Label": "plug on",
"SuccessTransition": "20",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "pt:j1/mt:cmd/rt:dev/rn:hue/ad:1/sv:out_lvl_switch/ad:l27_0",
"Service": "out_lvl_switch",
"ServiceInterface": "cmd.binary.set",
"Config": {
"DefaultValue": {
"Value": true,
"ValueType": "bool"
},
"IsVariableGlobal": false,
"Props": {},
"RegisterAsVirtualService": false,
"ResponseToTopic": "",
"VariableName": "",
"VirtualServiceGroup": "",
"VirtualServiceProps": {}
},
"Ui": {
"nodeType": "",
"x": 40,
"y": 1299
},
"TypeAlias": "Action",
"LastValue": false
},
{
"Id": "18",
"Type": "action",
"Label": "plug off",
"SuccessTransition": "22",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "pt:j1/mt:cmd/rt:dev/rn:hue/ad:1/sv:out_lvl_switch/ad:l27_0",
"Service": "out_lvl_switch",
"ServiceInterface": "cmd.binary.set",
"Config": {
"DefaultValue": {
"Value": false,
"ValueType": "bool"
},
"IsVariableGlobal": false,
"Props": {},
"RegisterAsVirtualService": false,
"ResponseToTopic": "",
"VariableName": "",
"VirtualServiceGroup": "",
"VirtualServiceProps": {}
},
"Ui": {
"nodeType": "",
"x": 344,
"y": 1306
},
"TypeAlias": "Action",
"LastValue": false
},
{
"Id": "19",
"Type": "trigger",
"Label": "walkin sensor presence",
"SuccessTransition": "8",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "pt:j1/mt:evt/rt:dev/rn:hue/ad:1/sv:sensor_presence/ad:s36_0",
"Service": "sensor_presence",
"ServiceInterface": "evt.presence.report",
"Config": {
"IsValueFilterEnabled": false,
"LookupServiceNameAndLocation": false,
"RegisterAsVirtualService": false,
"Timeout": 0,
"ValueFilter": {
"Value": true,
"ValueType": "bool"
},
"VirtualServiceGroup": "ch_0",
"VirtualServiceProps": {}
},
"Ui": {
"nodeType": "",
"x": 566,
"y": 120
},
"TypeAlias": "Trigger"
},
{
"Id": "20",
"Type": "action",
"Label": "light 2 100%",
"SuccessTransition": "21",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "pt:j1/mt:cmd/rt:dev/rn:zigbee/ad:1/sv:out_lvl_switch/ad:7_1",
"Service": "out_lvl_switch",
"ServiceInterface": "cmd.lvl.set",
"Config": {
"DefaultValue": {
"Value": 254,
"ValueType": "int"
},
"IsVariableGlobal": false,
"Props": {},
"RegisterAsVirtualService": false,
"ResponseToTopic": "",
"VariableName": "",
"VirtualServiceGroup": "",
"VirtualServiceProps": {}
},
"Ui": {
"nodeType": "",
"x": 45,
"y": 1474
},
"TypeAlias": "Action"
},
{
"Id": "21",
"Type": "action",
"Label": "Light 1 100%",
"SuccessTransition": "",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "pt:j1/mt:cmd/rt:dev/rn:zigbee/ad:1/sv:out_lvl_switch/ad:6_1",
"Service": "out_lvl_switch",
"ServiceInterface": "cmd.lvl.set",
"Config": {
"DefaultValue": {
"Value": 254,
"ValueType": "int"
},
"IsVariableGlobal": false,
"Props": {},
"RegisterAsVirtualService": false,
"ResponseToTopic": "",
"VariableName": "",
"VirtualServiceGroup": "",
"VirtualServiceProps": {}
},
"Ui": {
"nodeType": "",
"x": 36,
"y": 1665
},
"TypeAlias": "Action"
},
{
"Id": "22",
"Type": "action",
"Label": "light1 off",
"SuccessTransition": "23",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "pt:j1/mt:cmd/rt:dev/rn:zigbee/ad:1/sv:out_bin_switch/ad:6_1",
"Service": "out_bin_switch",
"ServiceInterface": "cmd.binary.set",
"Config": {
"DefaultValue": {
"Value": false,
"ValueType": "bool"
},
"IsVariableGlobal": false,
"Props": {},
"RegisterAsVirtualService": false,
"ResponseToTopic": "",
"VariableName": "",
"VirtualServiceGroup": "",
"VirtualServiceProps": {}
},
"Ui": {
"nodeType": "",
"x": 341,
"y": 1471
},
"TypeAlias": "Action",
"LastValue": false
},
{
"Id": "23",
"Type": "action",
"Label": "light 2 off",
"SuccessTransition": "31",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "pt:j1/mt:cmd/rt:dev/rn:zigbee/ad:1/sv:out_bin_switch/ad:7_1",
"Service": "out_bin_switch",
"ServiceInterface": "cmd.binary.set",
"Config": {
"DefaultValue": {
"Value": false,
"ValueType": "bool"
},
"IsVariableGlobal": false,
"Props": {},
"RegisterAsVirtualService": false,
"ResponseToTopic": "",
"VariableName": "",
"VirtualServiceGroup": "",
"VirtualServiceProps": {}
},
"Ui": {
"nodeType": "",
"x": 346,
"y": 1664
},
"TypeAlias": "Action",
"LastValue": false
},
{
"Id": "24",
"Type": "action",
"Label": "light 2 10%",
"SuccessTransition": "",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "pt:j1/mt:cmd/rt:dev/rn:zigbee/ad:1/sv:out_lvl_switch/ad:7_1",
"Service": "out_lvl_switch",
"ServiceInterface": "cmd.lvl.set",
"Config": {
"DefaultValue": {
"Value": 25,
"ValueType": "int"
},
"IsVariableGlobal": false,
"Props": {},
"RegisterAsVirtualService": false,
"ResponseToTopic": "",
"VariableName": "",
"VirtualServiceGroup": "",
"VirtualServiceProps": {}
},
"Ui": {
"nodeType": "",
"x": 714,
"y": 1660
},
"TypeAlias": "Action"
},
{
"Id": "25",
"Type": "action",
"Label": "light 1 10%",
"SuccessTransition": "24",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "pt:j1/mt:cmd/rt:dev/rn:zigbee/ad:1/sv:out_lvl_switch/ad:6_1",
"Service": "out_lvl_switch",
"ServiceInterface": "cmd.lvl.set",
"Config": {
"DefaultValue": {
"Value": 25,
"ValueType": "int"
},
"IsVariableGlobal": false,
"Props": {},
"RegisterAsVirtualService": false,
"ResponseToTopic": "",
"VariableName": "",
"VirtualServiceGroup": "",
"VirtualServiceProps": {}
},
"Ui": {
"nodeType": "",
"x": 723,
"y": 1469
},
"TypeAlias": "Action"
},
{
"Id": "26",
"Type": "action",
"Label": "plug off",
"SuccessTransition": "27",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "pt:j1/mt:cmd/rt:dev/rn:hue/ad:1/sv:out_lvl_switch/ad:l27_0",
"Service": "out_lvl_switch",
"ServiceInterface": "cmd.binary.set",
"Config": {
"DefaultValue": {
"Value": false,
"ValueType": "bool"
},
"IsVariableGlobal": false,
"Props": {},
"RegisterAsVirtualService": false,
"ResponseToTopic": "",
"VariableName": "",
"VirtualServiceGroup": "",
"VirtualServiceProps": {}
},
"Ui": {
"nodeType": "",
"x": 1047,
"y": 1290
},
"TypeAlias": "Action",
"LastValue": false
},
{
"Id": "27",
"Type": "action",
"Label": "light 1 off",
"SuccessTransition": "28",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "pt:j1/mt:cmd/rt:dev/rn:zigbee/ad:1/sv:out_bin_switch/ad:6_1",
"Service": "out_bin_switch",
"ServiceInterface": "cmd.binary.set",
"Config": {
"DefaultValue": {
"Value": false,
"ValueType": "bool"
},
"IsVariableGlobal": false,
"Props": {},
"RegisterAsVirtualService": false,
"ResponseToTopic": "",
"VariableName": "",
"VirtualServiceGroup": "",
"VirtualServiceProps": {}
},
"Ui": {
"nodeType": "",
"x": 1036,
"y": 1465
},
"TypeAlias": "Action",
"LastValue": false
},
{
"Id": "28",
"Type": "action",
"Label": "light 2 off",
"SuccessTransition": "",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "pt:j1/mt:cmd/rt:dev/rn:zigbee/ad:1/sv:out_bin_switch/ad:7_1",
"Service": "out_bin_switch",
"ServiceInterface": "cmd.binary.set",
"Config": {
"DefaultValue": {
"Value": false,
"ValueType": "bool"
},
"IsVariableGlobal": false,
"Props": {},
"RegisterAsVirtualService": false,
"ResponseToTopic": "",
"VariableName": "",
"VirtualServiceGroup": "",
"VirtualServiceProps": {}
},
"Ui": {
"nodeType": "",
"x": 1037,
"y": 1668
},
"TypeAlias": "Action",
"LastValue": false
},
{
"Id": "29",
"Type": "if",
"Label": "brightness override",
"SuccessTransition": "",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "",
"Service": "",
"ServiceInterface": "",
"Config": {
"Expression": [
{
"BooleanOperator": "",
"LeftVariableIsGlobal": true,
"LeftVariableName": "dr lights brightness ",
"Operand": "eq",
"RightVariable": {
"Value": true,
"ValueType": "bool"
}
}
],
"FalseTransition": "10",
"TrueTransition": "6"
},
"Ui": {
"nodeType": "",
"x": 730,
"y": 504
},
"TypeAlias": "If condition"
},
{
"Id": "30",
"Type": "action",
"Label": "set bright mode to off",
"Address": "pt:j1/mt:cmd/rt:dev/rn:flow/ad:1/sv:out_bin_switch/ad:hghuvzIj5l8ZHt2_0",
"Service": "out_bin_switch",
"ServiceInterface": "cmd.binary.set",
"SuccessTransition": "",
"ErrorTransition": "",
"Config": {
"VariableName": "",
"IsVariableGlobal": false,
"Props": {},
"RegisterAsVirtualService": false,
"VirtualServiceGroup": "",
"VirtualServiceProps": {},
"ResponseToTopic": "",
"DefaultValue": {
"Value": false,
"ValueType": "bool"
}
},
"Ui": {
"x": 1418,
"y": 984,
"nodeType": ""
},
"TypeAlias": "Action"
},
{
"Id": "31",
"Type": "wait",
"Label": "wait 60 min",
"Address": "",
"Service": "",
"ServiceInterface": "",
"SuccessTransition": "30",
"ErrorTransition": "",
"Config": 3600000,
"Ui": {
"x": 1416,
"y": 774,
"nodeType": ""
},
"TypeAlias": "Delay"
}
],
"Settings": null,
"IsDisabled": false,
"IsDefault": false,
"ParallelExecution": "keep_last"
}