From a9dcc12c75c1493c577fd53f68c8a33e777ecf45 Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Fri, 15 Sep 2023 10:27:51 -0400 Subject: [PATCH] Fix #10 --- flows.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flows.json b/flows.json index ad24699..7239cdd 100644 --- a/flows.json +++ b/flows.json @@ -1804,7 +1804,6 @@ "acceptLanguage": "en-US", "onKeywordInLanguage": "on", "userAgent": "", - "useWsMqtt": "on", "autoInit": "on" }, { @@ -17991,8 +17990,9 @@ "z": "72f99805df043603", "g": "39a7ac02f2727f1d", "name": "Processing", - "func": "const states = global.get('homeassistant.homeAssistant.states')\nconst vacationMode = states['input_boolean.vacation_mode'].state\nconst overnight = states['input_boolean.kallen_overnight'].state\nconst kallenLoc = states['person.kallen_stork'].state\nconst nightVolume = states['input_number.kallen_bedroom_google_speaker_night_volume'].state\nconst brightness = states['switch.adaptive_lighting_kallen_bedroom'].attributes.brightness_pct\nconst fadeDay = states['input_number.wakeup_lights_fade_day'].state\nconst fadeNight = states['input_number.wakeup_lights_fade_night'].state\nconst hotDay = states['input_boolean.hot_day'].state\nconst heatWarning = states['binary_sensor.heat_warning'].state\nconst fanSeparate = states['binary_sensor.kallen_fan_separate_schedule'].state\nconst topic = msg.topic\nconst toggle = msg.toggle\n\nlet fan = []\n\nif (hotDay === 'on' || heatWarning === 'on') {\n fan = 'on'\n} else {\n fan = 'off'\n}\n\nif (vacationMode === 'off' && overnight === 'off' && kallenLoc === 'home') {\n if (topic === 'kallen-fan' && fanSeparate === 'on') {\n node.status({fill:\"green\",shape:\"dot\",text:\"Fan\"});\n return[null,null,null,msg]\n } else if (toggle === 'off') {\n msg.brightness = brightness\n msg.fade_day = fadeDay * 60\n msg.fade_night = fadeNight * 60\n node.status({fill:\"green\",shape:\"dot\",text:\"Wakeup\"});\n return[null,msg,null,null]\n } else if (toggle === 'on') {\n msg.volume = nightVolume\n node.status({fill:\"green\",shape:\"dot\",text:\"Sleep\"});\n return[null,null,msg,null]\n }\n} else {\n if (topic === 'boolean') {\n msg.toggle = 'off'\n node.status({fill:\"red\",shape:\"ring\",text:\"Blocked\"});\n return [msg,null,null,null]\n } else {\n node.status({fill:\"red\",shape:\"ring\",text:\"Blocked\"});\n return null\n }\n}", + "func": "const states = global.get('homeassistant.homeAssistant.states')\nconst vacationMode = states['input_boolean.vacation_mode'].state\nconst overnight = states['input_boolean.kallen_overnight'].state\nconst kallenLoc = states['person.kallen_stork'].state\nconst nightVolume = states['input_number.kallen_bedroom_google_speaker_night_volume'].state\nconst brightness = states['switch.adaptive_lighting_kallen_bedroom'].attributes.brightness_pct\nconst fadeDay = states['input_number.wakeup_lights_fade_day'].state\nconst fadeNight = states['input_number.wakeup_lights_fade_night'].state\nconst hotDay = states['input_boolean.hot_day'].state\nconst heatWarning = states['binary_sensor.heat_warning'].state\nconst fanSeparate = states['binary_sensor.kallen_fan_separate_schedule'].state\nconst topic = msg.topic\nconst toggle = msg.toggle\n\nlet fan = []\n\nif (hotDay === 'on' || heatWarning === 'on') {\n fan = 'on'\n} else {\n fan = 'off'\n}\n\nif (vacationMode === 'off' && overnight === 'off' && kallenLoc === 'home') {\n if (topic === 'kallen-fan' && fanSeparate === 'on') {\n node.status({fill:\"green\",shape:\"dot\",text:\"Fan\"});\n return[null,null,null,msg]\n } else if (toggle === 'off') {\n msg.brightness = brightness\n msg.fade_day = fadeDay * 60\n msg.fade_night = fadeNight * 60\n msg.fan = fan\n node.status({fill:\"green\",shape:\"dot\",text:\"Wakeup\"});\n return[null,msg,null,null]\n } else if (toggle === 'on') {\n msg.volume = nightVolume\n node.status({fill:\"green\",shape:\"dot\",text:\"Sleep\"});\n return[null,null,msg,null]\n }\n} else {\n if (topic === 'boolean') {\n msg.toggle = 'off'\n node.status({fill:\"red\",shape:\"ring\",text:\"Blocked\"});\n return [msg,null,null,null]\n } else {\n node.status({fill:\"red\",shape:\"ring\",text:\"Blocked\"});\n return null\n }\n}", "outputs": 4, + "timeout": "", "noerr": 0, "initialize": "", "finalize": "",