diff --git a/flows.json b/flows.json index db218a9..1bf4550 100644 --- a/flows.json +++ b/flows.json @@ -47,6 +47,14 @@ "info": "", "env": [] }, + { + "id": "b5717a86ce55bc29", + "type": "tab", + "label": "Outdoor Lighting", + "disabled": false, + "info": "", + "env": [] + }, { "id": "b0286fae9f2ce547", "type": "tab", @@ -1029,47 +1037,6 @@ "w": 1112, "h": 382 }, - { - "id": "eeafd13be593ae69", - "type": "group", - "z": "eff21041cc941fef", - "name": "Front Porch Light Timer", - "style": { - "label": true - }, - "nodes": [ - "091390f43bfeddf5", - "7a7229eb69c9b1a3", - "edef3ad58f6e9bbd", - "780ad4c1a1d5204b", - "51237623ed73ba98", - "f34816b23181f21e", - "aaac8068997af1a5", - "de4f1b15ce906809", - "bd75b077a1c76fce", - "dda150ba32752234", - "b69eeb738bbd4bdb", - "cfdcc7c9c168dc17", - "8f3c66f06ed3f7b2", - "16029ccf061bdd10", - "d2751bc2cfc5af8f", - "435280acadb9f364", - "ec5937bc60874009", - "defcae57f9916394", - "dfa6bff034d7d522", - "94faa23771cc9cd6", - "4f330c52abf707de", - "459433738b64d14d", - "cfd6c59d35ffa1dc", - "a2ec35a79d79bf2f", - "9a8c39dc1a0c20e6", - "528d5448879fd3db" - ], - "x": 54, - "y": 599, - "w": 2092, - "h": 282 - }, { "id": "753e14252442d87d", "type": "group", @@ -1207,6 +1174,47 @@ "w": 1552, "h": 422 }, + { + "id": "eeafd13be593ae69", + "type": "group", + "z": "b5717a86ce55bc29", + "name": "Front Porch Light Timer", + "style": { + "label": true + }, + "nodes": [ + "091390f43bfeddf5", + "7a7229eb69c9b1a3", + "edef3ad58f6e9bbd", + "780ad4c1a1d5204b", + "51237623ed73ba98", + "f34816b23181f21e", + "aaac8068997af1a5", + "de4f1b15ce906809", + "bd75b077a1c76fce", + "dda150ba32752234", + "b69eeb738bbd4bdb", + "cfdcc7c9c168dc17", + "8f3c66f06ed3f7b2", + "16029ccf061bdd10", + "d2751bc2cfc5af8f", + "435280acadb9f364", + "ec5937bc60874009", + "defcae57f9916394", + "dfa6bff034d7d522", + "94faa23771cc9cd6", + "4f330c52abf707de", + "459433738b64d14d", + "cfd6c59d35ffa1dc", + "a2ec35a79d79bf2f", + "9a8c39dc1a0c20e6", + "528d5448879fd3db" + ], + "x": 54, + "y": 19, + "w": 2092, + "h": 282 + }, { "id": "19b0e082db0643ac", "type": "junction", @@ -10145,710 +10153,6 @@ ] ] }, - { - "id": "091390f43bfeddf5", - "type": "api-call-service", - "z": "eff21041cc941fef", - "g": "eeafd13be593ae69", - "name": "Turn on light", - "server": "9e87348d.9c1c48", - "version": 5, - "debugenabled": false, - "domain": "light", - "service": "turn_on", - "areaId": [], - "deviceId": [], - "entityId": [ - "light.front_porch_light" - ], - "data": "", - "dataType": "json", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "none", - "output_location": "", - "output_location_type": "none", - "x": 1270, - "y": 700, - "wires": [ - [ - "dda150ba32752234" - ] - ] - }, - { - "id": "7a7229eb69c9b1a3", - "type": "api-call-service", - "z": "eff21041cc941fef", - "g": "eeafd13be593ae69", - "name": "Turn off light", - "server": "9e87348d.9c1c48", - "version": 5, - "debugenabled": false, - "domain": "light", - "service": "turn_off", - "areaId": [], - "deviceId": [], - "entityId": [ - "light.front_porch_light" - ], - "data": "", - "dataType": "json", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "none", - "output_location": "", - "output_location_type": "none", - "x": 1710, - "y": 840, - "wires": [ - [] - ] - }, - { - "id": "edef3ad58f6e9bbd", - "type": "api-current-state", - "z": "eff21041cc941fef", - "g": "eeafd13be593ae69", - "name": "Early Night Mode", - "server": "9e87348d.9c1c48", - "version": 3, - "outputs": 2, - "halt_if": "on", - "halt_if_type": "str", - "halt_if_compare": "is", - "entity_id": "input_boolean.early_night_mode", - "state_type": "str", - "blockInputOverrides": false, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "", - "valueType": "entityState" - } - ], - "for": "0", - "forType": "num", - "forUnits": "minutes", - "override_topic": false, - "state_location": "payload", - "override_payload": "msg", - "entity_location": "data", - "override_data": "msg", - "x": 650, - "y": 700, - "wires": [ - [ - "780ad4c1a1d5204b" - ], - [] - ] - }, - { - "id": "780ad4c1a1d5204b", - "type": "api-current-state", - "z": "eff21041cc941fef", - "g": "eeafd13be593ae69", - "name": "Front Porch Toggle", - "server": "9e87348d.9c1c48", - "version": 3, - "outputs": 2, - "halt_if": "on", - "halt_if_type": "str", - "halt_if_compare": "is", - "entity_id": "input_boolean.front_porch_light_on", - "state_type": "str", - "blockInputOverrides": false, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "", - "valueType": "entityState" - } - ], - "for": "0", - "forType": "num", - "forUnits": "minutes", - "override_topic": false, - "state_location": "payload", - "override_payload": "msg", - "entity_location": "data", - "override_data": "msg", - "x": 870, - "y": 700, - "wires": [ - [ - "94faa23771cc9cd6" - ], - [] - ] - }, - { - "id": "51237623ed73ba98", - "type": "api-current-state", - "z": "eff21041cc941fef", - "g": "eeafd13be593ae69", - "name": "Front Porch Toggle", - "server": "9e87348d.9c1c48", - "version": 3, - "outputs": 2, - "halt_if": "on", - "halt_if_type": "str", - "halt_if_compare": "is", - "entity_id": "input_boolean.front_porch_light_on", - "state_type": "str", - "blockInputOverrides": false, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "", - "valueType": "entityState" - } - ], - "for": "0", - "forType": "num", - "forUnits": "minutes", - "override_topic": false, - "state_location": "payload", - "override_payload": "msg", - "entity_location": "data", - "override_data": "msg", - "x": 1070, - "y": 840, - "wires": [ - [ - "4f330c52abf707de" - ], - [] - ] - }, - { - "id": "f34816b23181f21e", - "type": "link in", - "z": "eff21041cc941fef", - "g": "eeafd13be593ae69", - "name": "Porch Light Input", - "links": [ - "26f15fc8d75a4020" - ], - "x": 105, - "y": 700, - "wires": [ - [ - "cfdcc7c9c168dc17" - ] - ] - }, - { - "id": "aaac8068997af1a5", - "type": "api-current-state", - "z": "eff21041cc941fef", - "g": "eeafd13be593ae69", - "name": "Delivery Mode", - "server": "9e87348d.9c1c48", - "version": 3, - "outputs": 2, - "halt_if": "on", - "halt_if_type": "str", - "halt_if_compare": "is", - "entity_id": "input_boolean.delivery_mode", - "state_type": "str", - "blockInputOverrides": false, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "", - "valueType": "entityState" - }, - { - "property": "data", - "propertyType": "msg", - "value": "", - "valueType": "entity" - } - ], - "for": "0", - "forType": "num", - "forUnits": "minutes", - "override_topic": false, - "state_location": "payload", - "override_payload": "msg", - "entity_location": "data", - "override_data": "msg", - "x": 1620, - "y": 640, - "wires": [ - [ - "de4f1b15ce906809" - ], - [] - ] - }, - { - "id": "de4f1b15ce906809", - "type": "api-call-service", - "z": "eff21041cc941fef", - "g": "eeafd13be593ae69", - "name": "Set Adaptive", - "server": "9e87348d.9c1c48", - "version": 5, - "debugenabled": false, - "domain": "input_select", - "service": "select_option", - "areaId": [], - "deviceId": [], - "entityId": [ - "input_select.front_porch_scenes" - ], - "data": "{\t \"option\":\"Adaptive\"\t}", - "dataType": "jsonata", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "none", - "x": 1810, - "y": 640, - "wires": [ - [ - "bd75b077a1c76fce" - ] - ] - }, - { - "id": "bd75b077a1c76fce", - "type": "api-call-service", - "z": "eff21041cc941fef", - "g": "eeafd13be593ae69", - "name": "Turn off Delivery Mode", - "server": "9e87348d.9c1c48", - "version": 5, - "debugenabled": false, - "domain": "input_boolean", - "service": "turn_off", - "areaId": [], - "deviceId": [], - "entityId": [ - "input_boolean.delivery_mode" - ], - "data": "", - "dataType": "jsonata", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "none", - "x": 2020, - "y": 640, - "wires": [ - [] - ] - }, - { - "id": "dda150ba32752234", - "type": "switch", - "z": "eff21041cc941fef", - "g": "eeafd13be593ae69", - "name": "If Motion", - "property": "detect", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "motion", - "vt": "str" - }, - { - "t": "else" - } - ], - "checkall": "true", - "repair": false, - "outputs": 2, - "x": 1440, - "y": 700, - "wires": [ - [ - "aaac8068997af1a5" - ], - [ - "d2751bc2cfc5af8f" - ] - ] - }, - { - "id": "b69eeb738bbd4bdb", - "type": "server-state-changed", - "z": "eff21041cc941fef", - "g": "eeafd13be593ae69", - "name": "Porch Automation Stop", - "server": "9e87348d.9c1c48", - "version": 4, - "exposeToHomeAssistant": false, - "haConfig": [ - { - "property": "name", - "value": "" - }, - { - "property": "icon", - "value": "" - } - ], - "entityidfilter": "input_boolean.front_porch_light_on", - "entityidfiltertype": "exact", - "outputinitially": false, - "state_type": "str", - "haltifstate": "off", - "halt_if_type": "str", - "halt_if_compare": "is", - "outputs": 2, - "output_only_on_state_change": true, - "for": "0", - "forType": "num", - "forUnits": "minutes", - "ignorePrevStateNull": false, - "ignorePrevStateUnknown": true, - "ignorePrevStateUnavailable": true, - "ignoreCurrentStateUnknown": true, - "ignoreCurrentStateUnavailable": true, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "", - "valueType": "date" - } - ], - "x": 180, - "y": 640, - "wires": [ - [ - "459433738b64d14d" - ], - [] - ] - }, - { - "id": "cfdcc7c9c168dc17", - "type": "switch", - "z": "eff21041cc941fef", - "g": "eeafd13be593ae69", - "name": "On/Off", - "property": "payload", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "on", - "vt": "str" - }, - { - "t": "eq", - "v": "off", - "vt": "str" - } - ], - "checkall": "true", - "repair": false, - "outputs": 2, - "x": 230, - "y": 700, - "wires": [ - [ - "16029ccf061bdd10", - "459433738b64d14d" - ], - [ - "8f3c66f06ed3f7b2" - ] - ] - }, - { - "id": "8f3c66f06ed3f7b2", - "type": "api-current-state", - "z": "eff21041cc941fef", - "g": "eeafd13be593ae69", - "name": "Delay", - "server": "9e87348d.9c1c48", - "version": 3, - "outputs": 1, - "halt_if": "", - "halt_if_type": "str", - "halt_if_compare": "is", - "entity_id": "input_number.front_porch_motion_off_delay", - "state_type": "num", - "blockInputOverrides": false, - "outputProperties": [ - { - "property": "duration", - "propertyType": "msg", - "value": "", - "valueType": "entityState" - } - ], - "for": "0", - "forType": "num", - "forUnits": "minutes", - "override_topic": false, - "state_location": "payload", - "override_payload": "msg", - "entity_location": "data", - "override_data": "msg", - "x": 350, - "y": 840, - "wires": [ - [ - "cfd6c59d35ffa1dc" - ] - ] - }, - { - "id": "16029ccf061bdd10", - "type": "switch", - "z": "eff21041cc941fef", - "g": "eeafd13be593ae69", - "name": "Method", - "property": "detect", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "presence", - "vt": "str" - }, - { - "t": "else" - } - ], - "checkall": "true", - "repair": false, - "outputs": 2, - "x": 380, - "y": 700, - "wires": [ - [ - "edef3ad58f6e9bbd", - "8f3c66f06ed3f7b2" - ], - [ - "edef3ad58f6e9bbd" - ] - ] - }, - { - "id": "d2751bc2cfc5af8f", - "type": "api-call-service", - "z": "eff21041cc941fef", - "g": "eeafd13be593ae69", - "name": "Set Adaptive", - "server": "9e87348d.9c1c48", - "version": 5, - "debugenabled": false, - "domain": "input_select", - "service": "select_option", - "areaId": [], - "deviceId": [], - "entityId": [ - "input_select.front_porch_scenes" - ], - "data": "{\t \"option\":\"Adaptive\"\t}", - "dataType": "jsonata", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "none", - "x": 1610, - "y": 700, - "wires": [ - [] - ] - }, - { - "id": "435280acadb9f364", - "type": "api-call-service", - "z": "eff21041cc941fef", - "g": "eeafd13be593ae69", - "name": "Holiday Scene", - "server": "9e87348d.9c1c48", - "version": 5, - "debugenabled": false, - "domain": "switch", - "service": "turn_on", - "areaId": [], - "deviceId": [], - "entityId": [ - "switch.animated_scene_{{holiday}}" - ], - "data": "", - "dataType": "jsonata", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "none", - "x": 1900, - "y": 780, - "wires": [ - [] - ] - }, - { - "id": "ec5937bc60874009", - "type": "api-call-service", - "z": "eff21041cc941fef", - "g": "eeafd13be593ae69", - "name": "Animations Off", - "server": "9e87348d.9c1c48", - "version": 5, - "debugenabled": false, - "domain": "switch", - "service": "turn_off", - "areaId": [], - "deviceId": [], - "entityId": [ - "switch.animated_scene_{{holiday}}" - ], - "data": "", - "dataType": "jsonata", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "none", - "x": 1280, - "y": 640, - "wires": [ - [] - ] - }, - { - "id": "defcae57f9916394", - "type": "api-call-service", - "z": "eff21041cc941fef", - "g": "eeafd13be593ae69", - "name": "Adaptive Off", - "server": "9e87348d.9c1c48", - "version": 5, - "debugenabled": false, - "domain": "switch", - "service": "turn_off", - "areaId": [], - "deviceId": [], - "entityId": [ - "switch.adaptive_lighting_front_porch" - ], - "data": "", - "dataType": "jsonata", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "none", - "x": 1710, - "y": 780, - "wires": [ - [ - "435280acadb9f364" - ] - ] - }, - { - "id": "dfa6bff034d7d522", - "type": "function", - "z": "eff21041cc941fef", - "g": "eeafd13be593ae69", - "name": "Holiday Code", - "func": "var holidaymode = global.get('holidaymode')\nvar currentholiday = global.get('currentholiday')\nvar holiday = currentholiday.toLowerCase()\n\nif (holidaymode === 'on') {\n msg.holiday = holiday\n return [msg,null]\n} else {\n return [null,msg]\n}", - "outputs": 2, - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 1500, - "y": 840, - "wires": [ - [ - "defcae57f9916394" - ], - [ - "7a7229eb69c9b1a3" - ] - ], - "outputLabels": [ - "Holiday On", - "Holiday Off" - ] - }, - { - "id": "94faa23771cc9cd6", - "type": "function", - "z": "eff21041cc941fef", - "g": "eeafd13be593ae69", - "name": "Holiday Code", - "func": "var holidaymode = global.get('holidaymode')\nvar currentholiday = global.get('currentholiday')\nvar holiday = currentholiday.toLowerCase()\n\nif (holidaymode === 'on') {\n msg.holiday = holiday\n return [msg,null]\n} else {\n return [null,msg]\n}", - "outputs": 2, - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 1080, - "y": 700, - "wires": [ - [ - "091390f43bfeddf5", - "ec5937bc60874009" - ], - [ - "091390f43bfeddf5" - ] - ], - "outputLabels": [ - "Holiday On", - "Holiday Off" - ] - }, - { - "id": "4f330c52abf707de", - "type": "api-current-state", - "z": "eff21041cc941fef", - "g": "eeafd13be593ae69", - "name": "Early Night Mode", - "server": "9e87348d.9c1c48", - "version": 3, - "outputs": 2, - "halt_if": "on", - "halt_if_type": "str", - "halt_if_compare": "is", - "entity_id": "input_boolean.early_night_mode", - "state_type": "str", - "blockInputOverrides": false, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "", - "valueType": "entityState" - } - ], - "for": "0", - "forType": "num", - "forUnits": "minutes", - "override_topic": false, - "state_location": "payload", - "override_payload": "msg", - "entity_location": "data", - "override_data": "msg", - "x": 1290, - "y": 840, - "wires": [ - [ - "dfa6bff034d7d522" - ], - [] - ] - }, { "id": "74f9d2bf4a8c0b53", "type": "server-state-changed", @@ -10973,147 +10277,6 @@ [] ] }, - { - "id": "459433738b64d14d", - "type": "api-call-service", - "z": "eff21041cc941fef", - "g": "eeafd13be593ae69", - "name": "Cancel Timer", - "server": "9e87348d.9c1c48", - "version": 5, - "debugenabled": false, - "domain": "timer", - "service": "cancel", - "areaId": [], - "deviceId": [], - "entityId": [ - "timer.front_porch_motion_timer" - ], - "data": "", - "dataType": "jsonata", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "none", - "x": 390, - "y": 640, - "wires": [ - [] - ] - }, - { - "id": "cfd6c59d35ffa1dc", - "type": "function", - "z": "eff21041cc941fef", - "g": "eeafd13be593ae69", - "name": "Convert to seconds", - "func": "msg.duration = msg.duration * 60\nreturn msg;", - "outputs": 1, - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 455, - "y": 840, - "wires": [ - [ - "a2ec35a79d79bf2f" - ] - ], - "l": false - }, - { - "id": "a2ec35a79d79bf2f", - "type": "api-call-service", - "z": "eff21041cc941fef", - "g": "eeafd13be593ae69", - "name": "Start Timer", - "server": "9e87348d.9c1c48", - "version": 5, - "debugenabled": false, - "domain": "timer", - "service": "start", - "areaId": [], - "deviceId": [], - "entityId": [ - "timer.front_porch_motion_timer" - ], - "data": "{\t \"duration\": msg.duration\t}", - "dataType": "jsonata", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "none", - "x": 570, - "y": 840, - "wires": [ - [] - ] - }, - { - "id": "9a8c39dc1a0c20e6", - "type": "server-events", - "z": "eff21041cc941fef", - "g": "eeafd13be593ae69", - "name": "Timer Finished", - "server": "9e87348d.9c1c48", - "version": 2, - "eventType": "timer.finished", - "exposeToHomeAssistant": false, - "haConfig": [ - { - "property": "name", - "value": "" - }, - { - "property": "icon", - "value": "" - } - ], - "waitForRunning": true, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "$outputData(\"eventData\").entity_id", - "valueType": "jsonata" - } - ], - "x": 800, - "y": 840, - "wires": [ - [ - "528d5448879fd3db" - ] - ] - }, - { - "id": "528d5448879fd3db", - "type": "switch", - "z": "eff21041cc941fef", - "g": "eeafd13be593ae69", - "name": "", - "property": "payload", - "propertyType": "msg", - "rules": [ - { - "t": "cont", - "v": "timer.front_porch_motion_timer", - "vt": "str" - } - ], - "checkall": "true", - "repair": false, - "outputs": 1, - "x": 925, - "y": 840, - "wires": [ - [ - "51237623ed73ba98" - ] - ], - "l": false - }, { "id": "879ee8903841b8f0", "type": "server-state-changed", @@ -13625,6 +12788,851 @@ [] ] }, + { + "id": "091390f43bfeddf5", + "type": "api-call-service", + "z": "b5717a86ce55bc29", + "g": "eeafd13be593ae69", + "name": "Turn on light", + "server": "9e87348d.9c1c48", + "version": 5, + "debugenabled": false, + "domain": "light", + "service": "turn_on", + "areaId": [], + "deviceId": [], + "entityId": [ + "light.front_porch_light" + ], + "data": "", + "dataType": "json", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "output_location": "", + "output_location_type": "none", + "x": 1270, + "y": 120, + "wires": [ + [ + "dda150ba32752234" + ] + ] + }, + { + "id": "7a7229eb69c9b1a3", + "type": "api-call-service", + "z": "b5717a86ce55bc29", + "g": "eeafd13be593ae69", + "name": "Turn off light", + "server": "9e87348d.9c1c48", + "version": 5, + "debugenabled": false, + "domain": "light", + "service": "turn_off", + "areaId": [], + "deviceId": [], + "entityId": [ + "light.front_porch_light" + ], + "data": "", + "dataType": "json", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "output_location": "", + "output_location_type": "none", + "x": 1710, + "y": 260, + "wires": [ + [] + ] + }, + { + "id": "edef3ad58f6e9bbd", + "type": "api-current-state", + "z": "b5717a86ce55bc29", + "g": "eeafd13be593ae69", + "name": "Early Night Mode", + "server": "9e87348d.9c1c48", + "version": 3, + "outputs": 2, + "halt_if": "on", + "halt_if_type": "str", + "halt_if_compare": "is", + "entity_id": "input_boolean.early_night_mode", + "state_type": "str", + "blockInputOverrides": false, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "", + "valueType": "entityState" + } + ], + "for": "0", + "forType": "num", + "forUnits": "minutes", + "override_topic": false, + "state_location": "payload", + "override_payload": "msg", + "entity_location": "data", + "override_data": "msg", + "x": 650, + "y": 120, + "wires": [ + [ + "780ad4c1a1d5204b" + ], + [] + ] + }, + { + "id": "780ad4c1a1d5204b", + "type": "api-current-state", + "z": "b5717a86ce55bc29", + "g": "eeafd13be593ae69", + "name": "Front Porch Toggle", + "server": "9e87348d.9c1c48", + "version": 3, + "outputs": 2, + "halt_if": "on", + "halt_if_type": "str", + "halt_if_compare": "is", + "entity_id": "input_boolean.front_porch_light_on", + "state_type": "str", + "blockInputOverrides": false, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "", + "valueType": "entityState" + } + ], + "for": "0", + "forType": "num", + "forUnits": "minutes", + "override_topic": false, + "state_location": "payload", + "override_payload": "msg", + "entity_location": "data", + "override_data": "msg", + "x": 870, + "y": 120, + "wires": [ + [ + "94faa23771cc9cd6" + ], + [] + ] + }, + { + "id": "51237623ed73ba98", + "type": "api-current-state", + "z": "b5717a86ce55bc29", + "g": "eeafd13be593ae69", + "name": "Front Porch Toggle", + "server": "9e87348d.9c1c48", + "version": 3, + "outputs": 2, + "halt_if": "on", + "halt_if_type": "str", + "halt_if_compare": "is", + "entity_id": "input_boolean.front_porch_light_on", + "state_type": "str", + "blockInputOverrides": false, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "", + "valueType": "entityState" + } + ], + "for": "0", + "forType": "num", + "forUnits": "minutes", + "override_topic": false, + "state_location": "payload", + "override_payload": "msg", + "entity_location": "data", + "override_data": "msg", + "x": 1070, + "y": 260, + "wires": [ + [ + "4f330c52abf707de" + ], + [] + ] + }, + { + "id": "f34816b23181f21e", + "type": "link in", + "z": "b5717a86ce55bc29", + "g": "eeafd13be593ae69", + "name": "Porch Light Input", + "links": [ + "26f15fc8d75a4020" + ], + "x": 125, + "y": 120, + "wires": [ + [ + "cfdcc7c9c168dc17" + ] + ] + }, + { + "id": "aaac8068997af1a5", + "type": "api-current-state", + "z": "b5717a86ce55bc29", + "g": "eeafd13be593ae69", + "name": "Delivery Mode", + "server": "9e87348d.9c1c48", + "version": 3, + "outputs": 2, + "halt_if": "on", + "halt_if_type": "str", + "halt_if_compare": "is", + "entity_id": "input_boolean.delivery_mode", + "state_type": "str", + "blockInputOverrides": false, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "", + "valueType": "entityState" + }, + { + "property": "data", + "propertyType": "msg", + "value": "", + "valueType": "entity" + } + ], + "for": "0", + "forType": "num", + "forUnits": "minutes", + "override_topic": false, + "state_location": "payload", + "override_payload": "msg", + "entity_location": "data", + "override_data": "msg", + "x": 1620, + "y": 60, + "wires": [ + [ + "de4f1b15ce906809" + ], + [] + ] + }, + { + "id": "de4f1b15ce906809", + "type": "api-call-service", + "z": "b5717a86ce55bc29", + "g": "eeafd13be593ae69", + "name": "Set Adaptive", + "server": "9e87348d.9c1c48", + "version": 5, + "debugenabled": false, + "domain": "input_select", + "service": "select_option", + "areaId": [], + "deviceId": [], + "entityId": [ + "input_select.front_porch_scenes" + ], + "data": "{\t \"option\":\"Adaptive\"\t}", + "dataType": "jsonata", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "x": 1810, + "y": 60, + "wires": [ + [ + "bd75b077a1c76fce" + ] + ] + }, + { + "id": "bd75b077a1c76fce", + "type": "api-call-service", + "z": "b5717a86ce55bc29", + "g": "eeafd13be593ae69", + "name": "Turn off Delivery Mode", + "server": "9e87348d.9c1c48", + "version": 5, + "debugenabled": false, + "domain": "input_boolean", + "service": "turn_off", + "areaId": [], + "deviceId": [], + "entityId": [ + "input_boolean.delivery_mode" + ], + "data": "", + "dataType": "jsonata", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "x": 2020, + "y": 60, + "wires": [ + [] + ] + }, + { + "id": "dda150ba32752234", + "type": "switch", + "z": "b5717a86ce55bc29", + "g": "eeafd13be593ae69", + "name": "If Motion", + "property": "detect", + "propertyType": "msg", + "rules": [ + { + "t": "eq", + "v": "motion", + "vt": "str" + }, + { + "t": "else" + } + ], + "checkall": "true", + "repair": false, + "outputs": 2, + "x": 1440, + "y": 120, + "wires": [ + [ + "aaac8068997af1a5" + ], + [ + "d2751bc2cfc5af8f" + ] + ] + }, + { + "id": "b69eeb738bbd4bdb", + "type": "server-state-changed", + "z": "b5717a86ce55bc29", + "g": "eeafd13be593ae69", + "name": "Porch Automation Stop", + "server": "9e87348d.9c1c48", + "version": 4, + "exposeToHomeAssistant": false, + "haConfig": [ + { + "property": "name", + "value": "" + }, + { + "property": "icon", + "value": "" + } + ], + "entityidfilter": "input_boolean.front_porch_light_on", + "entityidfiltertype": "exact", + "outputinitially": false, + "state_type": "str", + "haltifstate": "off", + "halt_if_type": "str", + "halt_if_compare": "is", + "outputs": 2, + "output_only_on_state_change": true, + "for": "0", + "forType": "num", + "forUnits": "minutes", + "ignorePrevStateNull": false, + "ignorePrevStateUnknown": true, + "ignorePrevStateUnavailable": true, + "ignoreCurrentStateUnknown": true, + "ignoreCurrentStateUnavailable": true, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "", + "valueType": "date" + } + ], + "x": 180, + "y": 60, + "wires": [ + [ + "459433738b64d14d" + ], + [] + ] + }, + { + "id": "cfdcc7c9c168dc17", + "type": "switch", + "z": "b5717a86ce55bc29", + "g": "eeafd13be593ae69", + "name": "On/Off", + "property": "payload", + "propertyType": "msg", + "rules": [ + { + "t": "eq", + "v": "on", + "vt": "str" + }, + { + "t": "eq", + "v": "off", + "vt": "str" + } + ], + "checkall": "true", + "repair": false, + "outputs": 2, + "x": 230, + "y": 120, + "wires": [ + [ + "16029ccf061bdd10", + "459433738b64d14d" + ], + [ + "8f3c66f06ed3f7b2" + ] + ] + }, + { + "id": "8f3c66f06ed3f7b2", + "type": "api-current-state", + "z": "b5717a86ce55bc29", + "g": "eeafd13be593ae69", + "name": "Delay", + "server": "9e87348d.9c1c48", + "version": 3, + "outputs": 1, + "halt_if": "", + "halt_if_type": "str", + "halt_if_compare": "is", + "entity_id": "input_number.front_porch_motion_off_delay", + "state_type": "num", + "blockInputOverrides": false, + "outputProperties": [ + { + "property": "duration", + "propertyType": "msg", + "value": "", + "valueType": "entityState" + } + ], + "for": "0", + "forType": "num", + "forUnits": "minutes", + "override_topic": false, + "state_location": "payload", + "override_payload": "msg", + "entity_location": "data", + "override_data": "msg", + "x": 350, + "y": 260, + "wires": [ + [ + "cfd6c59d35ffa1dc" + ] + ] + }, + { + "id": "16029ccf061bdd10", + "type": "switch", + "z": "b5717a86ce55bc29", + "g": "eeafd13be593ae69", + "name": "Method", + "property": "detect", + "propertyType": "msg", + "rules": [ + { + "t": "eq", + "v": "presence", + "vt": "str" + }, + { + "t": "else" + } + ], + "checkall": "true", + "repair": false, + "outputs": 2, + "x": 380, + "y": 120, + "wires": [ + [ + "edef3ad58f6e9bbd", + "8f3c66f06ed3f7b2" + ], + [ + "edef3ad58f6e9bbd" + ] + ] + }, + { + "id": "d2751bc2cfc5af8f", + "type": "api-call-service", + "z": "b5717a86ce55bc29", + "g": "eeafd13be593ae69", + "name": "Set Adaptive", + "server": "9e87348d.9c1c48", + "version": 5, + "debugenabled": false, + "domain": "input_select", + "service": "select_option", + "areaId": [], + "deviceId": [], + "entityId": [ + "input_select.front_porch_scenes" + ], + "data": "{\t \"option\":\"Adaptive\"\t}", + "dataType": "jsonata", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "x": 1610, + "y": 120, + "wires": [ + [] + ] + }, + { + "id": "435280acadb9f364", + "type": "api-call-service", + "z": "b5717a86ce55bc29", + "g": "eeafd13be593ae69", + "name": "Holiday Scene", + "server": "9e87348d.9c1c48", + "version": 5, + "debugenabled": false, + "domain": "switch", + "service": "turn_on", + "areaId": [], + "deviceId": [], + "entityId": [ + "switch.animated_scene_{{holiday}}" + ], + "data": "", + "dataType": "jsonata", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "x": 1900, + "y": 200, + "wires": [ + [] + ] + }, + { + "id": "ec5937bc60874009", + "type": "api-call-service", + "z": "b5717a86ce55bc29", + "g": "eeafd13be593ae69", + "name": "Animations Off", + "server": "9e87348d.9c1c48", + "version": 5, + "debugenabled": false, + "domain": "switch", + "service": "turn_off", + "areaId": [], + "deviceId": [], + "entityId": [ + "switch.animated_scene_{{holiday}}" + ], + "data": "", + "dataType": "jsonata", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "x": 1280, + "y": 60, + "wires": [ + [] + ] + }, + { + "id": "defcae57f9916394", + "type": "api-call-service", + "z": "b5717a86ce55bc29", + "g": "eeafd13be593ae69", + "name": "Adaptive Off", + "server": "9e87348d.9c1c48", + "version": 5, + "debugenabled": false, + "domain": "switch", + "service": "turn_off", + "areaId": [], + "deviceId": [], + "entityId": [ + "switch.adaptive_lighting_front_porch" + ], + "data": "", + "dataType": "jsonata", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "x": 1710, + "y": 200, + "wires": [ + [ + "435280acadb9f364" + ] + ] + }, + { + "id": "dfa6bff034d7d522", + "type": "function", + "z": "b5717a86ce55bc29", + "g": "eeafd13be593ae69", + "name": "Holiday Code", + "func": "var holidaymode = global.get('holidaymode')\nvar currentholiday = global.get('currentholiday')\nvar holiday = currentholiday.toLowerCase()\n\nif (holidaymode === 'on') {\n msg.holiday = holiday\n return [msg,null]\n} else {\n return [null,msg]\n}", + "outputs": 2, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 1500, + "y": 260, + "wires": [ + [ + "defcae57f9916394" + ], + [ + "7a7229eb69c9b1a3" + ] + ], + "outputLabels": [ + "Holiday On", + "Holiday Off" + ] + }, + { + "id": "94faa23771cc9cd6", + "type": "function", + "z": "b5717a86ce55bc29", + "g": "eeafd13be593ae69", + "name": "Holiday Code", + "func": "var holidaymode = global.get('holidaymode')\nvar currentholiday = global.get('currentholiday')\nvar holiday = currentholiday.toLowerCase()\n\nif (holidaymode === 'on') {\n msg.holiday = holiday\n return [msg,null]\n} else {\n return [null,msg]\n}", + "outputs": 2, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 1080, + "y": 120, + "wires": [ + [ + "091390f43bfeddf5", + "ec5937bc60874009" + ], + [ + "091390f43bfeddf5" + ] + ], + "outputLabels": [ + "Holiday On", + "Holiday Off" + ] + }, + { + "id": "4f330c52abf707de", + "type": "api-current-state", + "z": "b5717a86ce55bc29", + "g": "eeafd13be593ae69", + "name": "Early Night Mode", + "server": "9e87348d.9c1c48", + "version": 3, + "outputs": 2, + "halt_if": "on", + "halt_if_type": "str", + "halt_if_compare": "is", + "entity_id": "input_boolean.early_night_mode", + "state_type": "str", + "blockInputOverrides": false, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "", + "valueType": "entityState" + } + ], + "for": "0", + "forType": "num", + "forUnits": "minutes", + "override_topic": false, + "state_location": "payload", + "override_payload": "msg", + "entity_location": "data", + "override_data": "msg", + "x": 1290, + "y": 260, + "wires": [ + [ + "dfa6bff034d7d522" + ], + [] + ] + }, + { + "id": "459433738b64d14d", + "type": "api-call-service", + "z": "b5717a86ce55bc29", + "g": "eeafd13be593ae69", + "name": "Cancel Timer", + "server": "9e87348d.9c1c48", + "version": 5, + "debugenabled": false, + "domain": "timer", + "service": "cancel", + "areaId": [], + "deviceId": [], + "entityId": [ + "timer.front_porch_motion_timer" + ], + "data": "", + "dataType": "jsonata", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "x": 390, + "y": 60, + "wires": [ + [] + ] + }, + { + "id": "cfd6c59d35ffa1dc", + "type": "function", + "z": "b5717a86ce55bc29", + "g": "eeafd13be593ae69", + "name": "Convert to seconds", + "func": "msg.duration = msg.duration * 60\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 455, + "y": 260, + "wires": [ + [ + "a2ec35a79d79bf2f" + ] + ], + "l": false + }, + { + "id": "a2ec35a79d79bf2f", + "type": "api-call-service", + "z": "b5717a86ce55bc29", + "g": "eeafd13be593ae69", + "name": "Start Timer", + "server": "9e87348d.9c1c48", + "version": 5, + "debugenabled": false, + "domain": "timer", + "service": "start", + "areaId": [], + "deviceId": [], + "entityId": [ + "timer.front_porch_motion_timer" + ], + "data": "{\t \"duration\": msg.duration\t}", + "dataType": "jsonata", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "x": 570, + "y": 260, + "wires": [ + [] + ] + }, + { + "id": "9a8c39dc1a0c20e6", + "type": "server-events", + "z": "b5717a86ce55bc29", + "g": "eeafd13be593ae69", + "name": "Timer Finished", + "server": "9e87348d.9c1c48", + "version": 2, + "eventType": "timer.finished", + "exposeToHomeAssistant": false, + "haConfig": [ + { + "property": "name", + "value": "" + }, + { + "property": "icon", + "value": "" + } + ], + "waitForRunning": true, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "$outputData(\"eventData\").entity_id", + "valueType": "jsonata" + } + ], + "x": 800, + "y": 260, + "wires": [ + [ + "528d5448879fd3db" + ] + ] + }, + { + "id": "528d5448879fd3db", + "type": "switch", + "z": "b5717a86ce55bc29", + "g": "eeafd13be593ae69", + "name": "", + "property": "payload", + "propertyType": "msg", + "rules": [ + { + "t": "cont", + "v": "timer.front_porch_motion_timer", + "vt": "str" + } + ], + "checkall": "true", + "repair": false, + "outputs": 1, + "x": 925, + "y": 260, + "wires": [ + [ + "51237623ed73ba98" + ] + ], + "l": false + }, { "id": "cd04bdb407311eb5", "type": "ha-button",