Goodnight should leave first floor alone if Kallen is waiting for school

#29
This commit is contained in:
2025-03-22 07:18:10 -04:00
parent fe2db828e3
commit dc5d96f19c

View File

@ -1961,7 +1961,8 @@
"9bd4665845af0545",
"20b3699a56b0e901",
"f3df71ec460b7609",
"775777f1c01e424c"
"775777f1c01e424c",
"334c28e08be1db12"
],
"x": 14,
"y": 239,
@ -25402,7 +25403,7 @@
"60ce44747cf3e507",
"50e351d1ee6108b3",
"f30486c8e11db0e4",
"9bd4665845af0545"
"334c28e08be1db12"
]
]
},
@ -25455,11 +25456,7 @@
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"script.goodnight_in_basement",
"script.goodnight_on_first_floor",
"script.goodnight_on_second_floor"
],
"entityId": [],
"labelId": [],
"data": "",
"dataType": "jsonata",
@ -25470,7 +25467,7 @@
"blockInputOverrides": false,
"domain": "script",
"service": "turn_on",
"x": 650,
"x": 850,
"y": 520,
"wires": [
[]
@ -26108,6 +26105,27 @@
],
"l": false
},
{
"id": "334c28e08be1db12",
"type": "function",
"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'})",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 640,
"y": 520,
"wires": [
[
"9bd4665845af0545"
]
]
},
{
"id": "6a37c598ccfec0c7",
"type": "google-home",