From a79fdd66d46ce642c8d28cfbac45bedefc5633b2 Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Sat, 22 Mar 2025 15:25:16 -0400 Subject: [PATCH] Let's try this instead #29 --- flows.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flows.json b/flows.json index c129b52..e5db9b0 100644 --- a/flows.json +++ b/flows.json @@ -26111,7 +26111,7 @@ "z": "5c4ac37140a54ac9", "g": "f4057835848d0904", "name": "Choose Floors", - "func": "const states = global.get('homeassistant.homeAssistant.states')\nconst schoolToday = states['input_boolean.kallen_school_today'].state\nconst kallen = states['person.kallen_stork'].state\n\nlet scripts = ['script.goodnight_in_basement','script.goodnight_on_second_floor']\n\nif ((schoolToday === 'on' && kallen != 'home') || schoolToday === 'off') {\n scripts.push('script.goodnight_on_first_floor')\n}\n\nlet sendScripts = {\n \"payload\": {\n \"action\": scripts\n }\n}\n\nnode.send(sendScripts)\nnode.status({fill:'green',shape:'dot',text:'Scripts Sent'})", + "func": "const states = global.get('homeassistant.homeAssistant.states')\nconst schoolToday = states['input_boolean.kallen_school_today'].state\nconst kallen = states['person.kallen_stork'].state\nconst morning = states['binary_sensor.morning'].state\n\nlet basement = {\n \"payload\": {\n \"action\": \"script.goodnight_in_basement\"\n }\n}\n\nlet firstFloor = {\n \"payload\": {\n \"action\": \"script.goodnight_on_first_floor\"\n }\n}\n\nlet secondFloor = {\n \"payload\": {\n \"action\": \"script.goodnight_on_second_floor\"\n }\n}\n\nif (schoolToday === 'on' && kallen === 'home' && morning === 'on') {\n node.send([basement,secondFloor])\n node.status({fill:'yellow',shape:'dot',text:'Kallen waiting for school bus'})\n} else {\n node.send([basement,firstFloor,secondFloor])\n node.status({fill:'green',shape:'dot',text:'All scripts sent'})\n}", "outputs": 1, "timeout": 0, "noerr": 0,