From bd32e7b8e92b28683b12651565c56782bcbb69d3 Mon Sep 17 00:00:00 2001 From: m038 Date: Sun, 24 May 2026 18:17:47 +0200 Subject: [PATCH] Update flow files --- flows.json | 1658 ++++++++++++++++++++++++++-------------------------- 1 file changed, 829 insertions(+), 829 deletions(-) diff --git a/flows.json b/flows.json index 72d0744..672e70b 100644 --- a/flows.json +++ b/flows.json @@ -28,11 +28,6 @@ "disabled": true, "info": "" }, - { - "id": "1f4d4622.7490ca", - "type": "tab", - "label": "Temperature & climate" - }, { "id": "a9edb9da.ccb6d", "type": "tab", @@ -7053,830 +7048,6 @@ [] ] }, - { - "id": "eb217ba8.833d48", - "type": "server-state-changed", - "z": "1f4d4622.7490ca", - "d": true, - "name": "Outside temperature", - "server": "657c7463.48e1e4", - "version": 6, - "outputs": 1, - "exposeAsEntityConfig": "", - "entities": { - "entity": [ - "sensor.openweathermap_temperature" - ], - "substring": [], - "regex": [] - }, - "outputInitially": true, - "stateType": "num", - "ifState": "", - "ifStateType": "str", - "ifStateOperator": "is", - "outputOnlyOnStateChange": true, - "for": "", - "forType": "num", - "forUnits": "minutes", - "ignorePrevStateNull": false, - "ignorePrevStateUnknown": false, - "ignorePrevStateUnavailable": false, - "ignoreCurrentStateUnknown": false, - "ignoreCurrentStateUnavailable": false, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "", - "valueType": "entityState" - }, - { - "property": "data", - "propertyType": "msg", - "value": "", - "valueType": "eventData" - }, - { - "property": "topic", - "propertyType": "msg", - "value": "", - "valueType": "triggerId" - } - ], - "x": 110, - "y": 120, - "wires": [ - [ - "c8bf7086.b32ab8", - "be230668.4e6718", - "1de4cd6b31838517" - ] - ] - }, - { - "id": "c8bf7086.b32ab8", - "type": "api-current-state", - "z": "1f4d4622.7490ca", - "name": "Inside temperature", - "server": "657c7463.48e1e4", - "version": 3, - "outputs": 1, - "halt_if": "", - "halt_if_type": "str", - "halt_if_compare": "is", - "entity_id": "sensor.livingroom_temperature_avg", - "state_type": "num", - "blockInputOverrides": false, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "string", - "valueType": "entityState" - }, - { - "property": "data", - "propertyType": "msg", - "value": "", - "valueType": "entity" - } - ], - "for": 0, - "forType": "num", - "forUnits": "minutes", - "x": 470, - "y": 120, - "wires": [ - [ - "13a9b38f.3ab9d4", - "1de4cd6b31838517" - ] - ] - }, - { - "id": "68aa8fe5.4cd4f", - "type": "function", - "z": "1f4d4622.7490ca", - "name": "Determine cooler or warmer", - "func": "var outsideTemp = parseFloat(msg.payload.outside);\nvar insideTemp = parseFloat(msg.payload.inside);\nvar notification = '';\n\nif (outsideTemp < insideTemp) {\n notification = 'Outside is cooler than inside';\n} else {\n notification = 'Outside is warmer than inside';\n}\n\nmsg.payload = notification;\n\nreturn msg;", - "outputs": 1, - "timeout": "", - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 880, - "y": 180, - "wires": [ - [ - "e27e4896.4eefa", - "1de4cd6b31838517" - ] - ] - }, - { - "id": "e27e4896.4eefa", - "type": "api-call-service", - "z": "1f4d4622.7490ca", - "name": "Notify via HA", - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": false, - "action": "notify.gotify_ha", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [], - "labelId": [], - "data": "{\"title\":\"Info\",\"message\":\"{{{payload}}}\"}", - "dataType": "json", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "none", - "blockInputOverrides": false, - "domain": "notify", - "service": "gotify_ha", - "output_location": "", - "output_location_type": "none", - "x": 1130, - "y": 180, - "wires": [ - [] - ] - }, - { - "id": "be230668.4e6718", - "type": "change", - "z": "1f4d4622.7490ca", - "name": "Clear data", - "rules": [ - { - "t": "delete", - "p": "data", - "pt": "msg" - }, - { - "t": "set", - "p": "topic", - "pt": "msg", - "to": "outside", - "tot": "str" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 470, - "y": 260, - "wires": [ - [ - "2119da07.2ad496" - ] - ] - }, - { - "id": "13a9b38f.3ab9d4", - "type": "change", - "z": "1f4d4622.7490ca", - "name": "Clear data", - "rules": [ - { - "t": "delete", - "p": "data", - "pt": "msg" - }, - { - "t": "set", - "p": "topic", - "pt": "msg", - "to": "inside", - "tot": "str" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 470, - "y": 200, - "wires": [ - [ - "2119da07.2ad496" - ] - ] - }, - { - "id": "2119da07.2ad496", - "type": "join", - "z": "1f4d4622.7490ca", - "name": "", - "mode": "custom", - "build": "object", - "property": "payload", - "propertyType": "msg", - "key": "topic", - "joiner": "\\n", - "joinerType": "str", - "accumulate": false, - "timeout": "", - "count": "2", - "reduceRight": false, - "reduceExp": "", - "reduceInit": "", - "reduceInitType": "", - "reduceFixup": "", - "x": 670, - "y": 180, - "wires": [ - [ - "68aa8fe5.4cd4f" - ] - ] - }, - { - "id": "1de4cd6b31838517", - "type": "debug", - "z": "1f4d4622.7490ca", - "name": "Temperature alert", - "active": false, - "tosidebar": true, - "console": false, - "tostatus": false, - "complete": "payload", - "targetType": "msg", - "statusVal": "", - "statusType": "auto", - "x": 830, - "y": 60, - "wires": [] - }, - { - "id": "9a99a3d8e416b026", - "type": "comment", - "z": "1f4d4622.7490ca", - "name": "Temperature alert", - "info": "", - "x": 100, - "y": 80, - "wires": [] - }, - { - "id": "a676209fc00d4d6c", - "type": "comment", - "z": "1f4d4622.7490ca", - "name": "Climate control", - "info": "", - "x": 100, - "y": 360, - "wires": [] - }, - { - "id": "6156c5585680e99e", - "type": "server-state-changed", - "z": "1f4d4622.7490ca", - "d": true, - "name": "Livingroom window open", - "server": "657c7463.48e1e4", - "version": 6, - "outputs": 2, - "exposeAsEntityConfig": "", - "entities": { - "entity": [ - "sensor.window_handle_bedroom_state" - ], - "substring": [], - "regex": [] - }, - "outputInitially": true, - "stateType": "str", - "ifState": "closed", - "ifStateType": "str", - "ifStateOperator": "is_not", - "outputOnlyOnStateChange": true, - "for": "0", - "forType": "num", - "forUnits": "minutes", - "ignorePrevStateNull": false, - "ignorePrevStateUnknown": false, - "ignorePrevStateUnavailable": false, - "ignoreCurrentStateUnknown": false, - "ignoreCurrentStateUnavailable": false, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "", - "valueType": "entityState" - }, - { - "property": "data", - "propertyType": "msg", - "value": "", - "valueType": "eventData" - }, - { - "property": "topic", - "propertyType": "msg", - "value": "", - "valueType": "triggerId" - } - ], - "x": 130, - "y": 420, - "wires": [ - [ - "ea05134bce8525ef" - ], - [ - "e2f354b6c7b22e8d" - ] - ] - }, - { - "id": "ea05134bce8525ef", - "type": "api-call-service", - "z": "1f4d4622.7490ca", - "d": true, - "name": "Activate window open mode", - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": false, - "action": "scene.turn_on", - "floorId": [], - "areaId": [ - "7047cdd7d50e49f980eba16f832acb57" - ], - "deviceId": [], - "entityId": [ - "scene.bedroom_climate_window_open" - ], - "labelId": [], - "data": "", - "dataType": "json", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "none", - "blockInputOverrides": false, - "domain": "scene", - "service": "turn_on", - "output_location": "", - "output_location_type": "none", - "x": 520, - "y": 420, - "wires": [ - [] - ] - }, - { - "id": "e2f354b6c7b22e8d", - "type": "api-call-service", - "z": "1f4d4622.7490ca", - "d": true, - "name": "Activate window open mode", - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": false, - "action": "scene.apply", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [], - "labelId": [], - "data": "", - "dataType": "json", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "none", - "blockInputOverrides": false, - "domain": "scene", - "service": "apply", - "output_location": "", - "output_location_type": "none", - "x": 520, - "y": 500, - "wires": [ - [] - ] - }, - { - "id": "ap_hdr_001", - "type": "comment", - "z": "1f4d4622.7490ca", - "name": "Air Purifier - Preset Mode Sync", - "info": "", - "x": 150, - "y": 580, - "wires": [] - }, - { - "id": "ap_cmt_a_001", - "type": "comment", - "z": "1f4d4622.7490ca", - "name": "Flow A: Dashboard → Fan", - "info": "", - "x": 130, - "y": 620, - "wires": [] - }, - { - "id": "ap_ssc_is_001", - "type": "server-state-changed", - "z": "1f4d4622.7490ca", - "name": "Air Purifier Mode (input_select)", - "server": "657c7463.48e1e4", - "version": 6, - "outputs": 1, - "exposeAsEntityConfig": "", - "entities": { - "entity": [ - "input_select.air_purifier_mode" - ], - "substring": [], - "regex": [] - }, - "outputInitially": false, - "stateType": "str", - "ifState": "", - "ifStateType": "str", - "ifStateOperator": "is", - "outputOnlyOnStateChange": true, - "for": "0", - "forType": "num", - "forUnits": "minutes", - "ignorePrevStateNull": false, - "ignorePrevStateUnknown": false, - "ignorePrevStateUnavailable": false, - "ignoreCurrentStateUnknown": true, - "ignoreCurrentStateUnavailable": true, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "", - "valueType": "entityState" - }, - { - "property": "data", - "propertyType": "msg", - "value": "", - "valueType": "eventData" - } - ], - "x": 150, - "y": 660, - "wires": [ - [ - "ap_func_a_001" - ] - ] - }, - { - "id": "ap_func_a_001", - "type": "function", - "z": "1f4d4622.7490ca", - "name": "Check/set flag", - "func": "if (flow.get('purifier_updating') === true) {\n return [null, null];\n}\nflow.set('purifier_updating', true);\nif (msg.payload === 'Off') {\n return [null, msg];\n}\nreturn [msg, null];", - "outputs": 2, - "timeout": 0, - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 390, - "y": 660, - "wires": [ - [ - "ap_slug_001" - ], - [ - "ap_acs_off_001" - ] - ] - }, - { - "id": "ap_slug_001", - "type": "string", - "z": "1f4d4622.7490ca", - "name": "Slugify to preset ID", - "methods": [ - { - "name": "slugify", - "params": [] - }, - { - "name": "replaceAll", - "params": [ - { - "type": "str", - "value": "-" - }, - { - "type": "str", - "value": "_" - } - ] - } - ], - "prop": "payload", - "propout": "payload", - "object": "msg", - "objectout": "msg", - "x": 610, - "y": 660, - "wires": [ - [ - "ap_acs_fan_001" - ] - ] - }, - { - "id": "ap_acs_fan_001", - "type": "api-call-service", - "z": "1f4d4622.7490ca", - "name": "Set fan preset mode", - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": false, - "action": "fan.set_preset_mode", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [ - "fan.bedroom" - ], - "labelId": [], - "data": "{\"preset_mode\": msg.payload}", - "dataType": "jsonata", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "all", - "blockInputOverrides": false, - "domain": "fan", - "service": "set_preset_mode", - "x": 850, - "y": 660, - "wires": [ - [ - "ap_dly_a_001" - ] - ] - }, - { - "id": "ap_dly_a_001", - "type": "delay", - "z": "1f4d4622.7490ca", - "name": "Wait 1s", - "pauseType": "delay", - "timeout": "1", - "timeoutUnits": "seconds", - "rate": "1", - "nbRateUnits": "1", - "rateUnits": "second", - "randomFirst": "1", - "randomLast": "5", - "randomUnits": "seconds", - "drop": false, - "allowrate": false, - "outputs": 1, - "x": 1070, - "y": 660, - "wires": [ - [ - "ap_rst_a_001" - ] - ] - }, - { - "id": "ap_rst_a_001", - "type": "change", - "z": "1f4d4622.7490ca", - "name": "Reset flag", - "rules": [ - { - "t": "set", - "p": "purifier_updating", - "pt": "flow", - "to": "false", - "tot": "bool" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 1220, - "y": 660, - "wires": [ - [] - ] - }, - { - "id": "ap_cmt_b_001", - "type": "comment", - "z": "1f4d4622.7490ca", - "name": "Flow B: Fan → Dashboard", - "info": "", - "x": 130, - "y": 780, - "wires": [] - }, - { - "id": "ap_ssc_fan_001", - "type": "server-state-changed", - "z": "1f4d4622.7490ca", - "name": "Air Purifier (fan)", - "server": "657c7463.48e1e4", - "version": 6, - "outputs": 1, - "exposeAsEntityConfig": "", - "entities": { - "entity": [ - "fan.bedroom" - ], - "substring": [], - "regex": [] - }, - "outputInitially": false, - "stateType": "str", - "ifState": "", - "ifStateType": "str", - "ifStateOperator": "is", - "outputOnlyOnStateChange": false, - "for": "0", - "forType": "num", - "forUnits": "minutes", - "ignorePrevStateNull": false, - "ignorePrevStateUnknown": false, - "ignorePrevStateUnavailable": false, - "ignoreCurrentStateUnknown": true, - "ignoreCurrentStateUnavailable": true, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "", - "valueType": "entityState" - }, - { - "property": "data", - "propertyType": "msg", - "value": "", - "valueType": "eventData" - } - ], - "x": 100, - "y": 820, - "wires": [ - [ - "ap_func_b_001" - ] - ] - }, - { - "id": "ap_func_b_001", - "type": "function", - "z": "1f4d4622.7490ca", - "name": "Check flag + transform", - "func": "const newState = msg.payload;\nconst newPreset = msg.data.new_state.attributes.preset_mode;\nconst oldPreset = msg.data.old_state ? msg.data.old_state.attributes.preset_mode : null;\nconst oldState = msg.data.old_state ? msg.data.old_state.state : null;\n\nif (flow.get('purifier_updating') === true) return null;\n\nif (newState === 'off') {\n if (oldState === 'off') return null;\n flow.set('purifier_updating', true);\n msg.payload = 'Off';\n return msg;\n}\n\nif (newPreset === oldPreset) return null;\nflow.set('purifier_updating', true);\nmsg.payload = newPreset.split('_').map(w => w.charAt(0).toUpperCase() + w.slice(1)).join(' ');\nreturn msg;", - "outputs": 1, - "timeout": 0, - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 390, - "y": 820, - "wires": [ - [ - "ap_acs_is_001" - ] - ] - }, - { - "id": "ap_acs_is_001", - "type": "api-call-service", - "z": "1f4d4622.7490ca", - "name": "Update input_select", - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": false, - "action": "input_select.select_option", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [ - "input_select.air_purifier_mode" - ], - "labelId": [], - "data": "{\"option\": msg.payload}", - "dataType": "jsonata", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "all", - "blockInputOverrides": false, - "domain": "input_select", - "service": "select_option", - "x": 630, - "y": 820, - "wires": [ - [ - "ap_dly_b_001" - ] - ] - }, - { - "id": "ap_dly_b_001", - "type": "delay", - "z": "1f4d4622.7490ca", - "name": "Wait 1s", - "pauseType": "delay", - "timeout": "1", - "timeoutUnits": "seconds", - "rate": "1", - "nbRateUnits": "1", - "rateUnits": "second", - "randomFirst": "1", - "randomLast": "5", - "randomUnits": "seconds", - "drop": false, - "allowrate": false, - "outputs": 1, - "x": 850, - "y": 820, - "wires": [ - [ - "ap_rst_b_001" - ] - ] - }, - { - "id": "ap_rst_b_001", - "type": "change", - "z": "1f4d4622.7490ca", - "name": "Reset flag", - "rules": [ - { - "t": "set", - "p": "purifier_updating", - "pt": "flow", - "to": "false", - "tot": "bool" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 1070, - "y": 820, - "wires": [ - [] - ] - }, - { - "id": "ap_acs_off_001", - "type": "api-call-service", - "z": "1f4d4622.7490ca", - "name": "Turn off purifier", - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": false, - "action": "fan.turn_off", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [ - "fan.bedroom" - ], - "labelId": [], - "data": "", - "dataType": "jsonata", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "all", - "blockInputOverrides": false, - "domain": "fan", - "service": "turn_off", - "x": 850, - "y": 720, - "wires": [ - [ - "ap_dly_a_001" - ] - ] - }, { "id": "f3a37054.39c5e", "type": "server-state-changed", @@ -22605,5 +21776,834 @@ "wires": [ [] ] + }, + { + "type": "tab", + "label": "Temperature & climate", + "id": "1f4d4622.7490ca" + }, + { + "id": "eb217ba8.833d48", + "type": "server-state-changed", + "z": "1f4d4622.7490ca", + "name": "Outside temperature", + "wires": [ + [ + "c8bf7086.b32ab8", + "be230668.4e6718", + "1de4cd6b31838517" + ] + ], + "d": true, + "server": "657c7463.48e1e4", + "version": 6, + "outputs": 1, + "exposeAsEntityConfig": "", + "entities": { + "entity": [ + "sensor.openweathermap_temperature" + ], + "substring": [], + "regex": [] + }, + "outputInitially": true, + "stateType": "num", + "ifState": "", + "ifStateType": "str", + "ifStateOperator": "is", + "outputOnlyOnStateChange": true, + "for": "", + "forType": "num", + "forUnits": "minutes", + "ignorePrevStateNull": false, + "ignorePrevStateUnknown": false, + "ignorePrevStateUnavailable": false, + "ignoreCurrentStateUnknown": false, + "ignoreCurrentStateUnavailable": false, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "", + "valueType": "entityState" + }, + { + "property": "data", + "propertyType": "msg", + "value": "", + "valueType": "eventData" + }, + { + "property": "topic", + "propertyType": "msg", + "value": "", + "valueType": "triggerId" + } + ], + "x": 110, + "y": 120 + }, + { + "id": "c8bf7086.b32ab8", + "type": "api-current-state", + "z": "1f4d4622.7490ca", + "name": "Inside temperature", + "wires": [ + [ + "13a9b38f.3ab9d4", + "1de4cd6b31838517" + ] + ], + "server": "657c7463.48e1e4", + "version": 3, + "outputs": 1, + "halt_if": "", + "halt_if_type": "str", + "halt_if_compare": "is", + "entity_id": "sensor.livingroom_temperature_avg", + "state_type": "num", + "blockInputOverrides": false, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "string", + "valueType": "entityState" + }, + { + "property": "data", + "propertyType": "msg", + "value": "", + "valueType": "entity" + } + ], + "for": 0, + "forType": "num", + "forUnits": "minutes", + "x": 470, + "y": 120 + }, + { + "id": "68aa8fe5.4cd4f", + "type": "function", + "z": "1f4d4622.7490ca", + "name": "Determine cooler or warmer", + "wires": [ + [ + "e27e4896.4eefa", + "1de4cd6b31838517" + ] + ], + "func": "var outsideTemp = parseFloat(msg.payload.outside);\nvar insideTemp = parseFloat(msg.payload.inside);\nvar notification = '';\n\nif (outsideTemp < insideTemp) {\n notification = 'Outside is cooler than inside';\n} else {\n notification = 'Outside is warmer than inside';\n}\n\nmsg.payload = notification;\n\nreturn msg;", + "outputs": 1, + "timeout": "", + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 880, + "y": 180 + }, + { + "id": "e27e4896.4eefa", + "type": "api-call-service", + "z": "1f4d4622.7490ca", + "name": "Notify via HA", + "wires": [ + [] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": false, + "action": "notify.gotify_ha", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [], + "labelId": [], + "data": "{\"title\":\"Info\",\"message\":\"{{{payload}}}\"}", + "dataType": "json", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "blockInputOverrides": false, + "domain": "notify", + "service": "gotify_ha", + "output_location": "", + "output_location_type": "none", + "x": 1130, + "y": 180 + }, + { + "id": "be230668.4e6718", + "type": "change", + "z": "1f4d4622.7490ca", + "name": "Clear data", + "wires": [ + [ + "2119da07.2ad496" + ] + ], + "rules": [ + { + "t": "delete", + "p": "data", + "pt": "msg" + }, + { + "t": "set", + "p": "topic", + "pt": "msg", + "to": "outside", + "tot": "str" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 470, + "y": 260 + }, + { + "id": "13a9b38f.3ab9d4", + "type": "change", + "z": "1f4d4622.7490ca", + "name": "Clear data", + "wires": [ + [ + "2119da07.2ad496" + ] + ], + "rules": [ + { + "t": "delete", + "p": "data", + "pt": "msg" + }, + { + "t": "set", + "p": "topic", + "pt": "msg", + "to": "inside", + "tot": "str" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 470, + "y": 200 + }, + { + "id": "2119da07.2ad496", + "type": "join", + "z": "1f4d4622.7490ca", + "name": "", + "wires": [ + [ + "68aa8fe5.4cd4f" + ] + ], + "mode": "custom", + "build": "object", + "property": "payload", + "propertyType": "msg", + "key": "topic", + "joiner": "\\n", + "joinerType": "str", + "accumulate": false, + "timeout": "", + "count": "2", + "reduceRight": false, + "reduceExp": "", + "reduceInit": "", + "reduceInitType": "", + "reduceFixup": "", + "x": 670, + "y": 180 + }, + { + "id": "1de4cd6b31838517", + "type": "debug", + "z": "1f4d4622.7490ca", + "name": "Temperature alert", + "wires": [], + "active": false, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "payload", + "targetType": "msg", + "statusVal": "", + "statusType": "auto", + "x": 830, + "y": 60 + }, + { + "id": "9a99a3d8e416b026", + "type": "comment", + "z": "1f4d4622.7490ca", + "name": "Temperature alert", + "wires": [], + "info": "", + "x": 100, + "y": 80 + }, + { + "id": "a676209fc00d4d6c", + "type": "comment", + "z": "1f4d4622.7490ca", + "name": "Climate control", + "wires": [], + "info": "", + "x": 100, + "y": 360 + }, + { + "id": "6156c5585680e99e", + "type": "server-state-changed", + "z": "1f4d4622.7490ca", + "name": "Livingroom window open", + "wires": [ + [ + "ea05134bce8525ef" + ], + [ + "e2f354b6c7b22e8d" + ] + ], + "d": true, + "server": "657c7463.48e1e4", + "version": 6, + "outputs": 2, + "exposeAsEntityConfig": "", + "entities": { + "entity": [ + "sensor.window_handle_bedroom_state" + ], + "substring": [], + "regex": [] + }, + "outputInitially": true, + "stateType": "str", + "ifState": "closed", + "ifStateType": "str", + "ifStateOperator": "is_not", + "outputOnlyOnStateChange": true, + "for": "0", + "forType": "num", + "forUnits": "minutes", + "ignorePrevStateNull": false, + "ignorePrevStateUnknown": false, + "ignorePrevStateUnavailable": false, + "ignoreCurrentStateUnknown": false, + "ignoreCurrentStateUnavailable": false, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "", + "valueType": "entityState" + }, + { + "property": "data", + "propertyType": "msg", + "value": "", + "valueType": "eventData" + }, + { + "property": "topic", + "propertyType": "msg", + "value": "", + "valueType": "triggerId" + } + ], + "x": 130, + "y": 420 + }, + { + "id": "ea05134bce8525ef", + "type": "api-call-service", + "z": "1f4d4622.7490ca", + "name": "Activate window open mode", + "wires": [ + [] + ], + "d": true, + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": false, + "action": "scene.turn_on", + "floorId": [], + "areaId": [ + "7047cdd7d50e49f980eba16f832acb57" + ], + "deviceId": [], + "entityId": [ + "scene.bedroom_climate_window_open" + ], + "labelId": [], + "data": "", + "dataType": "json", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "blockInputOverrides": false, + "domain": "scene", + "service": "turn_on", + "output_location": "", + "output_location_type": "none", + "x": 520, + "y": 420 + }, + { + "id": "e2f354b6c7b22e8d", + "type": "api-call-service", + "z": "1f4d4622.7490ca", + "name": "Activate window open mode", + "wires": [ + [] + ], + "d": true, + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": false, + "action": "scene.apply", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [], + "labelId": [], + "data": "", + "dataType": "json", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "blockInputOverrides": false, + "domain": "scene", + "service": "apply", + "output_location": "", + "output_location_type": "none", + "x": 520, + "y": 500 + }, + { + "id": "ap_hdr_001", + "type": "comment", + "z": "1f4d4622.7490ca", + "name": "Air Purifier - Preset Mode Sync", + "wires": [], + "info": "", + "x": 150, + "y": 580 + }, + { + "id": "ap_cmt_a_001", + "type": "comment", + "z": "1f4d4622.7490ca", + "name": "Flow A: Dashboard → Fan", + "wires": [], + "info": "", + "x": 130, + "y": 620 + }, + { + "id": "ap_ssc_is_001", + "type": "server-state-changed", + "z": "1f4d4622.7490ca", + "name": "Air Purifier Mode (input_select)", + "wires": [ + [ + "ap_func_a_001" + ] + ], + "server": "657c7463.48e1e4", + "version": 6, + "outputs": 1, + "exposeAsEntityConfig": "", + "entities": { + "entity": [ + "input_select.air_purifier_mode" + ], + "substring": [], + "regex": [] + }, + "outputInitially": false, + "stateType": "str", + "ifState": "", + "ifStateType": "str", + "ifStateOperator": "is", + "outputOnlyOnStateChange": true, + "for": "0", + "forType": "num", + "forUnits": "minutes", + "ignorePrevStateNull": false, + "ignorePrevStateUnknown": false, + "ignorePrevStateUnavailable": false, + "ignoreCurrentStateUnknown": true, + "ignoreCurrentStateUnavailable": true, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "", + "valueType": "entityState" + }, + { + "property": "data", + "propertyType": "msg", + "value": "", + "valueType": "eventData" + } + ], + "x": 150, + "y": 660 + }, + { + "id": "ap_func_a_001", + "type": "function", + "z": "1f4d4622.7490ca", + "name": "Check/set flag", + "wires": [ + [ + "ap_slug_001" + ], + [ + "ap_acs_off_001" + ] + ], + "func": "if (flow.get('purifier_updating') === true) {\n return [null, null];\n}\nflow.set('purifier_updating', true);\nif (msg.payload === 'Off') {\n return [null, msg];\n}\nreturn [msg, null];", + "outputs": 2, + "timeout": 0, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 390, + "y": 660 + }, + { + "id": "ap_slug_001", + "type": "string", + "z": "1f4d4622.7490ca", + "name": "Slugify to preset ID", + "wires": [ + [ + "ap_acs_fan_001" + ] + ], + "methods": [ + { + "name": "slugify", + "params": [] + }, + { + "name": "replaceAll", + "params": [ + { + "type": "str", + "value": "-" + }, + { + "type": "str", + "value": "_" + } + ] + } + ], + "prop": "payload", + "propout": "payload", + "object": "msg", + "objectout": "msg", + "x": 610, + "y": 660 + }, + { + "id": "ap_acs_fan_001", + "type": "api-call-service", + "z": "1f4d4622.7490ca", + "name": "Set fan preset mode", + "wires": [ + [ + "ap_dly_a_001" + ] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": false, + "action": "fan.set_preset_mode", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [ + "fan.philips_ac2729_10" + ], + "labelId": [], + "data": "{\"preset_mode\": msg.payload}", + "dataType": "jsonata", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "all", + "blockInputOverrides": false, + "domain": "fan", + "service": "set_preset_mode", + "x": 850, + "y": 660 + }, + { + "id": "ap_dly_a_001", + "type": "delay", + "z": "1f4d4622.7490ca", + "name": "Wait 1s", + "wires": [ + [ + "ap_rst_a_001" + ] + ], + "pauseType": "delay", + "timeout": "1", + "timeoutUnits": "seconds", + "rate": "1", + "nbRateUnits": "1", + "rateUnits": "second", + "randomFirst": "1", + "randomLast": "5", + "randomUnits": "seconds", + "drop": false, + "allowrate": false, + "outputs": 1, + "x": 1070, + "y": 660 + }, + { + "id": "ap_rst_a_001", + "type": "change", + "z": "1f4d4622.7490ca", + "name": "Reset flag", + "wires": [ + [] + ], + "rules": [ + { + "t": "set", + "p": "purifier_updating", + "pt": "flow", + "to": "false", + "tot": "bool" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 1220, + "y": 660 + }, + { + "id": "ap_cmt_b_001", + "type": "comment", + "z": "1f4d4622.7490ca", + "name": "Flow B: Fan → Dashboard", + "wires": [], + "info": "", + "x": 130, + "y": 780 + }, + { + "id": "ap_ssc_fan_001", + "type": "server-state-changed", + "z": "1f4d4622.7490ca", + "name": "Air Purifier (fan)", + "wires": [ + [ + "ap_func_b_001" + ] + ], + "server": "657c7463.48e1e4", + "version": 6, + "outputs": 1, + "exposeAsEntityConfig": "", + "entities": { + "entity": [ + "fan.philips_ac2729_10" + ], + "substring": [], + "regex": [] + }, + "outputInitially": false, + "stateType": "str", + "ifState": "", + "ifStateType": "str", + "ifStateOperator": "is", + "outputOnlyOnStateChange": false, + "for": "0", + "forType": "num", + "forUnits": "minutes", + "ignorePrevStateNull": false, + "ignorePrevStateUnknown": false, + "ignorePrevStateUnavailable": false, + "ignoreCurrentStateUnknown": true, + "ignoreCurrentStateUnavailable": true, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "", + "valueType": "entityState" + }, + { + "property": "data", + "propertyType": "msg", + "value": "", + "valueType": "eventData" + } + ], + "x": 100, + "y": 820 + }, + { + "id": "ap_func_b_001", + "type": "function", + "z": "1f4d4622.7490ca", + "name": "Check flag + transform", + "wires": [ + [ + "ap_acs_is_001" + ] + ], + "func": "const newState = msg.payload;\nconst newPreset = msg.data.new_state.attributes.preset_mode;\nconst oldPreset = msg.data.old_state ? msg.data.old_state.attributes.preset_mode : null;\nconst oldState = msg.data.old_state ? msg.data.old_state.state : null;\n\nif (flow.get('purifier_updating') === true) return null;\n\nif (newState === 'off') {\n if (oldState === 'off') return null;\n flow.set('purifier_updating', true);\n msg.payload = 'Off';\n return msg;\n}\n\nif (newPreset === oldPreset) return null;\nflow.set('purifier_updating', true);\nmsg.payload = newPreset.split('_').map(w => w.charAt(0).toUpperCase() + w.slice(1)).join(' ');\nreturn msg;", + "outputs": 1, + "timeout": 0, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 390, + "y": 820 + }, + { + "id": "ap_acs_is_001", + "type": "api-call-service", + "z": "1f4d4622.7490ca", + "name": "Update input_select", + "wires": [ + [ + "ap_dly_b_001" + ] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": false, + "action": "input_select.select_option", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [ + "input_select.air_purifier_mode" + ], + "labelId": [], + "data": "{\"option\": msg.payload}", + "dataType": "jsonata", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "all", + "blockInputOverrides": false, + "domain": "input_select", + "service": "select_option", + "x": 630, + "y": 820 + }, + { + "id": "ap_dly_b_001", + "type": "delay", + "z": "1f4d4622.7490ca", + "name": "Wait 1s", + "wires": [ + [ + "ap_rst_b_001" + ] + ], + "pauseType": "delay", + "timeout": "1", + "timeoutUnits": "seconds", + "rate": "1", + "nbRateUnits": "1", + "rateUnits": "second", + "randomFirst": "1", + "randomLast": "5", + "randomUnits": "seconds", + "drop": false, + "allowrate": false, + "outputs": 1, + "x": 850, + "y": 820 + }, + { + "id": "ap_rst_b_001", + "type": "change", + "z": "1f4d4622.7490ca", + "name": "Reset flag", + "wires": [ + [] + ], + "rules": [ + { + "t": "set", + "p": "purifier_updating", + "pt": "flow", + "to": "false", + "tot": "bool" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 1070, + "y": 820 + }, + { + "id": "ap_acs_off_001", + "type": "api-call-service", + "z": "1f4d4622.7490ca", + "name": "Turn off purifier", + "wires": [ + [ + "ap_dly_a_001" + ] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": false, + "action": "fan.turn_off", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [ + "fan.philips_ac2729_10" + ], + "labelId": [], + "data": "", + "dataType": "jsonata", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "all", + "blockInputOverrides": false, + "domain": "fan", + "service": "turn_off", + "x": 850, + "y": 720 } ] \ No newline at end of file