How to use a number helper as a timer in node-red

hi everyone,

i am pretty new to the smart home world (1 week) and i am trying to have a motion sensor controlling my bathroom lights (ceiling light + spot light+ fan). but i want to be able to change the timer to shut it of using a number_helper/input_number (so i can make it easier to change from a lovelace card).

this is my flow. the upper part is the motion sensor triggered.

the lower part is when someone opens the light manually using the switch itself.

awaiting your great ideas.

How adjustable do you need the varied input? Will it be many values or a choice like 5 / 30min. Also is everything independent or do you want this to work as a group? I don’t see the on for the fan and is that to be extended as well?

Export your code and post it, it makes it easier for people to respond. Check the stickied threads if you dont know how to format code for a forum post. You can use scrubber if you want to remove any personal data from the nodes.

https://zachowj.github.io/node-red-contrib-home-assistant-websocket/scrubber/

thanks for responding! really appreciated.

[{"id":"8867ba14.da8188","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"58018aba.e94794","type":"server-state-changed","z":"8867ba14.da8188","name":"motion sensor 2","server":"","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.0x158d0006d40c37_motion","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":false,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"}],"x":100,"y":200,"wires":[["4df18634.b51178"],["d954728f.cb832","e71ff9b6.6f88f8"]]},{"id":"ff1a6f3.950869","type":"api-call-service","z":"8867ba14.da8188","name":"turn on lights","server":"","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.bathroom_1_ceiling_light, switch.bathroom_1_fan, switch.master_bathroom_ceiling_light","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"on","valueType":"str"}],"queue":"none","x":430,"y":100,"wires":[[]]},{"id":"4df18634.b51178","type":"switch","z":"8867ba14.da8188","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":270,"y":120,"wires":[["ff1a6f3.950869"],[]]},{"id":"9bb444c9.c321a8","type":"api-call-service","z":"8867ba14.da8188","name":"","server":"","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.bathroom_1_ceiling_light, switch.bathroom_1_spot_light","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1410,"y":80,"wires":[[]]},{"id":"598cbc12.e566e4","type":"api-call-service","z":"8867ba14.da8188","name":"","server":"","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.bathroom_1_fan","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1410,"y":200,"wires":[[]]},{"id":"8261b775.6bacc8","type":"function","z":"8867ba14.da8188","name":"","func":"msg.payload = Number(msg.payload);\n\nmsg.payload = 60000*msg.payload;\n\nmsg.payload=msg.delay\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":780,"y":40,"wires":[["d954728f.cb832"]]},{"id":"ee5aac86.3c069","type":"server-state-changed","z":"8867ba14.da8188","name":"","server":"","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.bathroom_1_lights_timer","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"num","halt_if_compare":"is","outputs":1,"output_only_on_state_change":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":300,"y":40,"wires":[["8261b775.6bacc8"]]},{"id":"1fb31ab8.d7fca5","type":"server-state-changed","z":"8867ba14.da8188","name":"","server":"","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.bathroom_1_fan_timer","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"num","halt_if_compare":"is","outputs":1,"output_only_on_state_change":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":310,"y":280,"wires":[["2d9fbb05.c1da64"]]},{"id":"2d9fbb05.c1da64","type":"function","z":"8867ba14.da8188","name":"","func":"msg.payload = Number(msg.payload);\n\nmsg.payload = 60000*msg.payload;\n\nmsg.delay = msg.payload\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":780,"y":280,"wires":[["e71ff9b6.6f88f8"]]},{"id":"d954728f.cb832","type":"trigger","z":"8867ba14.da8188","name":"","op1":"on","op2":"on","op1type":"str","op2type":"str","duration":"250","extend":false,"overrideDelay":true,"units":"min","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":1060,"y":80,"wires":[["9bb444c9.c321a8"]]},{"id":"e71ff9b6.6f88f8","type":"trigger","z":"8867ba14.da8188","name":"","op1":"on","op2":"on","op1type":"str","op2type":"str","duration":"250","extend":false,"overrideDelay":true,"units":"min","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":1060,"y":240,"wires":[["598cbc12.e566e4"]]}]

this my flow.

what i want is: when the motion detects motion the lights will be turned on (2 lights + a fan). then when there is no motion for a certain period of time, it will take a number helper (2-60 minutes slider) from home assistant UI and delay the turn off (turn off for 2 lights, then the fan has it’s own slider) by that number of minutes.

i hope it is explained well now, if not let me know.

We need to separate the light and fan. The timer is started on the onset of motion. It will not extend with further motion events while the light/fan is on. The final call service node resets the input number.

[{"id":"8867ba14.da8188","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"58018aba.e94794","type":"server-state-changed","z":"8867ba14.da8188","name":"motion sensor 2","server":"","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.0x158d0006d40c37_motion","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":false,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"}],"x":340,"y":80,"wires":[["ddf8ba43.630c","98568f3a.e77718"],[]]},{"id":"ff1a6f3.950869","type":"api-call-service","z":"8867ba14.da8188","name":"turn on lights","server":"","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.bathroom_1_ceiling_light, switch.master_bathroom_ceiling_light","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"on","valueType":"str"}],"queue":"none","x":1250,"y":60,"wires":[[]]},{"id":"9bb444c9.c321a8","type":"api-call-service","z":"8867ba14.da8188","name":"","server":"","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.bathroom_1_ceiling_light, switch.bathroom_1_spot_light","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1390,"y":180,"wires":[["35cd1767.d65a98"]]},{"id":"598cbc12.e566e4","type":"api-call-service","z":"8867ba14.da8188","name":"","server":"","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.bathroom_1_fan","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1390,"y":260,"wires":[["47e50172.cd9d4"]]},{"id":"ee5aac86.3c069","type":"server-state-changed","z":"8867ba14.da8188","name":"","server":"","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.number","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"num","halt_if_compare":"is","outputs":1,"output_only_on_state_change":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":410,"y":180,"wires":[["fd175c02.8c8e28"]]},{"id":"1fb31ab8.d7fca5","type":"server-state-changed","z":"8867ba14.da8188","name":"","server":"","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.bathroom_1_fan_timer","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"num","halt_if_compare":"is","outputs":1,"output_only_on_state_change":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":450,"y":260,"wires":[["6fb38b31.75c004"]]},{"id":"ccb5201f.6f8a88","type":"trigger","z":"8867ba14.da8188","name":"","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"2","extend":false,"overrideDelay":true,"units":"min","reset":"","bytopic":"all","topic":"topic","outputs":2,"x":1110,"y":180,"wires":[[],["9bb444c9.c321a8"]]},{"id":"fd175c02.8c8e28","type":"change","z":"8867ba14.da8188","name":"","rules":[{"t":"move","p":"payload","pt":"msg","to":"delay","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":770,"y":180,"wires":[["ccb5201f.6f8a88"]]},{"id":"e7d151fc.8ac1","type":"trigger","z":"8867ba14.da8188","name":"","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"2","extend":false,"overrideDelay":true,"units":"min","reset":"","bytopic":"all","topic":"topic","outputs":2,"x":1110,"y":260,"wires":[[],["598cbc12.e566e4"]]},{"id":"6fb38b31.75c004","type":"change","z":"8867ba14.da8188","name":"","rules":[{"t":"move","p":"payload","pt":"msg","to":"delay","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":830,"y":260,"wires":[["e7d151fc.8ac1"]]},{"id":"ddf8ba43.630c","type":"api-current-state","z":"8867ba14.da8188","name":"light state","server":"","version":2,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.bathroom_1_ceiling_light","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":780,"y":60,"wires":[[],["ff1a6f3.950869","ccb5201f.6f8a88"]]},{"id":"98568f3a.e77718","type":"api-current-state","z":"8867ba14.da8188","name":"fan state","server":"","version":2,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.bathroom_1_fan","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":780,"y":100,"wires":[[],["5c0a75db.4fdd94","e7d151fc.8ac1"]]},{"id":"5c0a75db.4fdd94","type":"api-call-service","z":"8867ba14.da8188","name":"turn on fan","server":"","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.bathroom_1_fan","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"on","valueType":"str"}],"queue":"none","x":1250,"y":100,"wires":[[]]},{"id":"35cd1767.d65a98","type":"api-call-service","z":"8867ba14.da8188","name":"reset input number","server":"","version":3,"debugenabled":false,"service_domain":"input_number","service":"reload","entityId":"","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1650,"y":180,"wires":[[]]},{"id":"47e50172.cd9d4","type":"api-call-service","z":"8867ba14.da8188","name":"reset input number","server":"","version":3,"debugenabled":false,"service_domain":"input_number","service":"reload","entityId":"","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1650,"y":260,"wires":[[]]}]

that is interesting.

now, if i want the timer to reset with motion detected?

thanks again

also, the point of the slider is that you can change the delay time. i checked the flow you gave me. i think the node red delay is measured in milliseconds rather than minutes (my slider is in minutes). should i add a function node?

Sorry about that, it can go right in the change node. We don’t need a function node for simple multiplication.

You could pull a line from the top unused position of the state check to the trigger nodes, then set them to extend on new message.

Though like this, if the timer were set to an hour. It will reset and wait 60 minutes after the last motion event ie when you walk out of the door.

[{"id":"435606ea.60f4b8","type":"change","z":"d6a46901.ebee1","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload*60000","tot":"jsonata"},{"t":"move","p":"payload","pt":"msg","to":"delay","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1440,"y":240,"wires":[["53fa5d22.24b10c"]]}]
[{"id":"8867ba14.da8188","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"18895f4d.6a69e1","type":"server-state-changed","z":"8867ba14.da8188","name":"motion sensor","server":"5126b1.93fdd95","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.0x158d0006d40c37_motion","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":false,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"}],"x":70,"y":100,"wires":[["621f0360.40b2ec","f8c94e2.c0584b"],[]]},{"id":"621f0360.40b2ec","type":"api-current-state","z":"8867ba14.da8188","name":"light state","server":"5126b1.93fdd95","version":2,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.bathroom_1_ceiling_light","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":220,"y":40,"wires":[[],["ff29e368.eb8b9","9c336743.c1eb78"]]},{"id":"f8c94e2.c0584b","type":"api-current-state","z":"8867ba14.da8188","name":"fan state","server":"5126b1.93fdd95","version":2,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.bathroom_1_fan","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":220,"y":140,"wires":[[],["47575427.a2da5c","169baf0d.5d90c1"]]},{"id":"ff29e368.eb8b9","type":"api-call-service","z":"8867ba14.da8188","name":"turn on lights","server":"5126b1.93fdd95","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.bathroom_1_ceiling_light, switch.bathroom_1_spot_light","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"on","valueType":"str"}],"queue":"none","x":550,"y":40,"wires":[[]]},{"id":"47575427.a2da5c","type":"api-call-service","z":"8867ba14.da8188","name":"turn on lights","server":"5126b1.93fdd95","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.bathroom_1_fan","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"on","valueType":"str"}],"queue":"none","x":550,"y":120,"wires":[[]]},{"id":"e8f71a54.8258d8","type":"server-state-changed","z":"8867ba14.da8188","name":"light slider","server":"5126b1.93fdd95","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.bathroom_1_lights_timer","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":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":60,"y":240,"wires":[["dd389f7f.8cafc"]]},{"id":"9d396d72.43f37","type":"server-state-changed","z":"8867ba14.da8188","name":"fan slider","server":"5126b1.93fdd95","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.bathroom_1_fan_timer","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":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":60,"y":300,"wires":[["6aca2c01.7817f4"]]},{"id":"dd389f7f.8cafc","type":"change","z":"8867ba14.da8188","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload*60000","tot":"jsonata"},{"t":"move","p":"payload","pt":"msg","to":"delay","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":280,"y":240,"wires":[["9c336743.c1eb78"]]},{"id":"9c336743.c1eb78","type":"trigger","z":"8867ba14.da8188","name":"","op1":"1","op2":"1","op1type":"str","op2type":"str","duration":"2","extend":true,"overrideDelay":true,"units":"min","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":650,"y":240,"wires":[["67241ce4.ac98a4"]]},{"id":"169baf0d.5d90c1","type":"trigger","z":"8867ba14.da8188","name":"","op1":"1","op2":"1","op1type":"str","op2type":"str","duration":"2","extend":true,"overrideDelay":true,"units":"min","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":650,"y":300,"wires":[["4d1e7dc3.222bd4"]]},{"id":"67241ce4.ac98a4","type":"api-call-service","z":"8867ba14.da8188","name":"turn off lights","server":"5126b1.93fdd95","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.bathroom_1_ceiling_light, switch.bathroom_1_spot_light","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":870,"y":240,"wires":[[]]},{"id":"4d1e7dc3.222bd4","type":"api-call-service","z":"8867ba14.da8188","name":"turn off fan","server":"5126b1.93fdd95","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.bathroom_1_fan","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":890,"y":300,"wires":[[]]},{"id":"347f3760.c9e5d8","type":"api-current-state","z":"8867ba14.da8188","name":"light state","server":"5126b1.93fdd95","version":2,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.bathroom_1_spot_light","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":220,"y":100,"wires":[[],["326c04e3.92139c","9c336743.c1eb78"]]},{"id":"326c04e3.92139c","type":"api-call-service","z":"8867ba14.da8188","name":"turn on lights","server":"5126b1.93fdd95","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.bathroom_1_spot_light","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"on","valueType":"str"}],"queue":"none","x":550,"y":80,"wires":[[]]},{"id":"6aca2c01.7817f4","type":"change","z":"8867ba14.da8188","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload*60000","tot":"jsonata"},{"t":"move","p":"payload","pt":"msg","to":"delay","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":280,"y":300,"wires":[["169baf0d.5d90c1"]]},{"id":"5126b1.93fdd95","type":"server","name":"Home Assistant","version":1,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

so i added the change you mentioned. now what is happening is that when the motion is detecting any motion, the light switch is turning on then immidiatly off. which means it is not detecting the delay msg

In the event nodes, the last line in the screen shot, change state type from string to number.

did that and still the light turns on and off immidiatly.

i will change the trigget to send nothing at the beginning then wait for 2 minuts then send 1.

[{"id":"8867ba14.da8188","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"18895f4d.6a69e1","type":"server-state-changed","z":"8867ba14.da8188","name":"motion sensor","server":"5126b1.93fdd95","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.0x158d0006d40c37_motion","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":false,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"}],"x":70,"y":100,"wires":[["621f0360.40b2ec","f8c94e2.c0584b","347f3760.c9e5d8"],[]]},{"id":"621f0360.40b2ec","type":"api-current-state","z":"8867ba14.da8188","name":"light state","server":"5126b1.93fdd95","version":2,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.bathroom_1_ceiling_light","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":220,"y":40,"wires":[[],["ff29e368.eb8b9","9c336743.c1eb78"]]},{"id":"f8c94e2.c0584b","type":"api-current-state","z":"8867ba14.da8188","name":"fan state","server":"5126b1.93fdd95","version":2,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.bathroom_1_fan","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":220,"y":140,"wires":[[],["47575427.a2da5c","169baf0d.5d90c1"]]},{"id":"ff29e368.eb8b9","type":"api-call-service","z":"8867ba14.da8188","name":"turn on lights","server":"5126b1.93fdd95","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.bathroom_1_ceiling_light, switch.bathroom_1_spot_light","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"on","valueType":"str"}],"queue":"none","x":550,"y":40,"wires":[[]]},{"id":"47575427.a2da5c","type":"api-call-service","z":"8867ba14.da8188","name":"turn on lights","server":"5126b1.93fdd95","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.bathroom_1_fan","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"on","valueType":"str"}],"queue":"none","x":550,"y":120,"wires":[[]]},{"id":"e8f71a54.8258d8","type":"server-state-changed","z":"8867ba14.da8188","name":"light slider","server":"5126b1.93fdd95","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.bathroom_1_lights_timer","entityidfiltertype":"exact","outputinitially":false,"state_type":"num","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":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":60,"y":240,"wires":[["dd389f7f.8cafc"]]},{"id":"9d396d72.43f37","type":"server-state-changed","z":"8867ba14.da8188","name":"fan slider","server":"5126b1.93fdd95","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.bathroom_1_fan_timer","entityidfiltertype":"exact","outputinitially":false,"state_type":"num","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":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":60,"y":300,"wires":[["6aca2c01.7817f4"]]},{"id":"dd389f7f.8cafc","type":"change","z":"8867ba14.da8188","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload*60000","tot":"jsonata"},{"t":"set","p":"payload","pt":"msg","to":"delay","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":280,"y":240,"wires":[["9c336743.c1eb78"]]},{"id":"9c336743.c1eb78","type":"trigger","z":"8867ba14.da8188","name":"","op1":"","op2":"1","op1type":"nul","op2type":"str","duration":"2","extend":true,"overrideDelay":true,"units":"min","reset":"","bytopic":"all","topic":"payload","outputs":1,"x":650,"y":240,"wires":[["67241ce4.ac98a4"]]},{"id":"169baf0d.5d90c1","type":"trigger","z":"8867ba14.da8188","name":"","op1":"","op2":"1","op1type":"nul","op2type":"str","duration":"2","extend":true,"overrideDelay":true,"units":"min","reset":"","bytopic":"all","topic":"payload","outputs":1,"x":650,"y":300,"wires":[["4d1e7dc3.222bd4"]]},{"id":"67241ce4.ac98a4","type":"api-call-service","z":"8867ba14.da8188","name":"turn off lights","server":"5126b1.93fdd95","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.bathroom_1_ceiling_light, switch.bathroom_1_spot_light","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":870,"y":240,"wires":[[]]},{"id":"4d1e7dc3.222bd4","type":"api-call-service","z":"8867ba14.da8188","name":"turn off fan","server":"5126b1.93fdd95","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.bathroom_1_fan","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":890,"y":300,"wires":[[]]},{"id":"347f3760.c9e5d8","type":"api-current-state","z":"8867ba14.da8188","name":"light state","server":"5126b1.93fdd95","version":2,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.bathroom_1_spot_light","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":220,"y":100,"wires":[[],["326c04e3.92139c","9c336743.c1eb78"]]},{"id":"326c04e3.92139c","type":"api-call-service","z":"8867ba14.da8188","name":"turn on lights","server":"5126b1.93fdd95","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.bathroom_1_spot_light","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"on","valueType":"str"}],"queue":"none","x":550,"y":80,"wires":[[]]},{"id":"6aca2c01.7817f4","type":"change","z":"8867ba14.da8188","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload*60000","tot":"jsonata"},{"t":"set","p":"payload","pt":"msg","to":"msg.delay","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":280,"y":300,"wires":[["169baf0d.5d90c1"]]},{"id":"5126b1.93fdd95","type":"server","name":"Home Assistant","version":1,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

edit: did not work

I see you changed the trigger nodes. Please recheck the second output and make the connections to the second output. See this post how the trigger nodes are connected

This:

[{"id":"94265dbf.4383","type":"server-state-changed","z":"8867ba14.da8188","name":"Motion sensor with variable off time for lights","server":"9405c3fe.d0a6c","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.0x158d0006d40c37_motion","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":"$round($number($globalContext(\"homeassistant.homeAssistant.states['input_number.bathroom_1_lights_timer'].state\")))","forType":"jsonata","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"x":270,"y":740,"wires":[["ee569f3c.1bce2"],["54a6eb45.0403f4"]]},{"id":"54a6eb45.0403f4","type":"api-call-service","z":"8867ba14.da8188","name":"turn on lights","server":"9405c3fe.d0a6c","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.bathroom_1_ceiling_light, switch.bathroom_1_fan, switch.master_bathroom_ceiling_light","data":"","dataType":"jsonata","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":570,"y":780,"wires":[[]]},{"id":"ee569f3c.1bce2","type":"api-call-service","z":"8867ba14.da8188","name":"Lights off","server":"9405c3fe.d0a6c","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.bathroom_1_ceiling_light, switch.bathroom_1_spot_light","data":"","dataType":"jsonata","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":560,"y":720,"wires":[[]]},{"id":"8b2b4cfa.995ed","type":"server-state-changed","z":"8867ba14.da8188","name":"Motion sensor with variable off time for fan","server":"9405c3fe.d0a6c","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.0x158d0006d40c37_motion","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":"$round($number($globalContext(\"homeassistant.homeAssistant.states['input_number.bathroom_1_fan_timer'].state\")))","forType":"jsonata","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"x":260,"y":840,"wires":[["89394770.4ccc68"],[]]},{"id":"89394770.4ccc68","type":"api-call-service","z":"8867ba14.da8188","name":"Fan off","server":"9405c3fe.d0a6c","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.bathroom_1_fan","data":"","dataType":"jsonata","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":540,"y":840,"wires":[[]]},{"id":"9405c3fe.d0a6c","type":"server","name":"Home Assistant","addon":true}]

If you want to add more than one motion sensors whithin the same Event state node, do the following. Note the entity id field and the substring

This one should work too I believe :crossed_fingers:, I like this one better, more elegant at least.

[{"id":"40d443a1.aeda5c","type":"change","z":"6cd0b2f8.4bb6fc","name":"Lights","rules":[{"t":"set","p":"entities","pt":"msg","to":"switch.bathroom_1_ceiling_light, switch.bathroom_1_spot_light","tot":"str"},{"t":"set","p":"delay","pt":"msg","to":"$round($number($globalContext(\"homeassistant.homeAssistant.states['input_number.bathroom_1_lights_timer'].state\")))*60000","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":1260,"wires":[["17044b07.de0965"]]},{"id":"d4aac474.afd248","type":"change","z":"6cd0b2f8.4bb6fc","name":"Fan","rules":[{"t":"set","p":"entities","pt":"msg","to":"switch.bathroom_1_fan","tot":"str"},{"t":"set","p":"delay","pt":"msg","to":"$round($number($globalContext(\"homeassistant.homeAssistant.states['input_number.bathroom_1_fan_timer'].state\")))*60000","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":1300,"wires":[["17044b07.de0965"]]},{"id":"17044b07.de0965","type":"trigger","z":"6cd0b2f8.4bb6fc","name":"","op1":"","op2":"","op1type":"nul","op2type":"pay","duration":"250","extend":false,"overrideDelay":true,"units":"ms","reset":"on","bytopic":"topic","topic":"entities","outputs":1,"x":515,"y":1280,"wires":[["e91b2751.addc48"]],"l":false},{"id":"e91b2751.addc48","type":"api-call-service","z":"6cd0b2f8.4bb6fc","name":"ON / OFF","server":"9405c3fe.d0a6c","version":1,"debugenabled":false,"service_domain":"homeassistant","service":"turn_{{payload}}","entityId":"{{entities}}","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":660,"y":1220,"wires":[[]]},{"id":"e5c0cd89.2bb4a","type":"server-state-changed","z":"6cd0b2f8.4bb6fc","name":"PIR","server":"9405c3fe.d0a6c","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.0x158d0006d40c37_motion","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"x":130,"y":1220,"wires":[["d4aac474.afd248","40d443a1.aeda5c","94c3d97a.d03b58"]]},{"id":"94c3d97a.d03b58","type":"switch","z":"6cd0b2f8.4bb6fc","name":"on?","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":295,"y":1220,"wires":[["a0c50fd4.d4ebe"]],"l":false},{"id":"a0c50fd4.d4ebe","type":"change","z":"6cd0b2f8.4bb6fc","name":"Both","rules":[{"t":"set","p":"entities","pt":"msg","to":"switch.bathroom_1_ceiling_light, switch.bathroom_1_spot_light, switch.bathroom_1_fan","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":1220,"wires":[["e91b2751.addc48"]]},{"id":"9405c3fe.d0a6c","type":"server","name":"Home Assistant","addon":true}]

If you need the inputs to be triggers as well, then just do this:

[{"id":"165b0a6c.0d39e6","type":"change","z":"6cd0b2f8.4bb6fc","name":"Lights","rules":[{"t":"set","p":"entities","pt":"msg","to":"switch.bathroom_1_ceiling_light, switch.bathroom_1_spot_light","tot":"str"},{"t":"set","p":"delay","pt":"msg","to":"$round($number($globalContext(\"homeassistant.homeAssistant.states['input_number.bathroom_1_lights_timer'].state\")))*60000","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":1480,"wires":[["4fab51fa.567f8"]]},{"id":"a523176b.258e98","type":"change","z":"6cd0b2f8.4bb6fc","name":"Fan","rules":[{"t":"set","p":"entities","pt":"msg","to":"switch.bathroom_1_fan","tot":"str"},{"t":"set","p":"delay","pt":"msg","to":"$round($number($globalContext(\"homeassistant.homeAssistant.states['input_number.bathroom_1_fan_timer'].state\")))*60000","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":1520,"wires":[["4fab51fa.567f8"]]},{"id":"4fab51fa.567f8","type":"trigger","z":"6cd0b2f8.4bb6fc","name":"","op1":"","op2":"","op1type":"nul","op2type":"pay","duration":"250","extend":true,"overrideDelay":true,"units":"ms","reset":"on","bytopic":"topic","topic":"entities","outputs":1,"x":535,"y":1500,"wires":[["5c07a56d.c325ac"]],"l":false},{"id":"5c07a56d.c325ac","type":"api-call-service","z":"6cd0b2f8.4bb6fc","name":"ON / OFF","server":"9405c3fe.d0a6c","version":1,"debugenabled":false,"service_domain":"homeassistant","service":"turn_{{payload}}","entityId":"{{entities}}","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":680,"y":1440,"wires":[[]]},{"id":"b5041f4d.9cc01","type":"server-state-changed","z":"6cd0b2f8.4bb6fc","name":"PIR & inputs","server":"9405c3fe.d0a6c","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.0x158d0006d40c37_motion, input_number.bathroom_1_lights_timer, input_number.bathroom_1_fan_timer","entityidfiltertype":"substring","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"x":170,"y":1440,"wires":[["9e3c1aee.e16ca8","ec50aac2.15bc08"]]},{"id":"9e3c1aee.e16ca8","type":"switch","z":"6cd0b2f8.4bb6fc","name":"on?","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":315,"y":1440,"wires":[["a1a7e315.9e3e3"]],"l":false},{"id":"a1a7e315.9e3e3","type":"change","z":"6cd0b2f8.4bb6fc","name":"Both","rules":[{"t":"set","p":"entities","pt":"msg","to":"switch.bathroom_1_ceiling_light, switch.bathroom_1_spot_light, switch.bathroom_1_fan","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":1440,"wires":[["5c07a56d.c325ac"]]},{"id":"ec50aac2.15bc08","type":"switch","z":"6cd0b2f8.4bb6fc","name":"","property":"topic","propertyType":"msg","rules":[{"t":"neq","v":"input_number.bathroom_1_fan_timer","vt":"str"},{"t":"neq","v":"input_number.bathroom_1_lights_timer","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":315,"y":1500,"wires":[["165b0a6c.0d39e6"],["a523176b.258e98"]],"l":false},{"id":"9405c3fe.d0a6c","type":"server","name":"Home Assistant","addon":true}]
1 Like

i got mine working on the following flow:

[{"id":"67df4e7c.1f7bd","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"b04eb42c.078578","type":"server-state-changed","z":"67df4e7c.1f7bd","name":"motion sensor 2","server":"","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.0x158d0006bea890_motion","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":false,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"}],"x":200,"y":220,"wires":[["84c119aa.1f91f8","b101be11.fa82c","3f29546c.35f7fc","281b8eda.3cebe2","4632fbf7.29db64"],[]]},{"id":"13cecb48.f417e5","type":"api-call-service","z":"67df4e7c.1f7bd","name":"turn on lights","server":"","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.master_bathroom_ceiling_light, switch.master_bathroom_spot_light","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"on","valueType":"str"}],"queue":"none","x":950,"y":160,"wires":[[]]},{"id":"b8dbc7d.8e74538","type":"api-call-service","z":"67df4e7c.1f7bd","name":"turn on fan","server":"","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.master_bathroom_fan","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"on","valueType":"str"}],"queue":"none","x":950,"y":220,"wires":[[]]},{"id":"9c0c45db.797418","type":"server-state-changed","z":"67df4e7c.1f7bd","name":"motion sensor 2","server":"","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.0x158d0006d485b2_motion","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":false,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"}],"x":200,"y":160,"wires":[["84c119aa.1f91f8","b101be11.fa82c","3f29546c.35f7fc","281b8eda.3cebe2","4632fbf7.29db64"],[]]},{"id":"37f782e1.2f580e","type":"comment","z":"67df4e7c.1f7bd","name":"Bathroom 1","info":"","x":190,"y":100,"wires":[]},{"id":"b101be11.fa82c","type":"api-current-state","z":"67df4e7c.1f7bd","name":"fan state","server":"","version":2,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.master_bathroom_fan","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":620,"y":220,"wires":[[],["b8dbc7d.8e74538"]]},{"id":"84c119aa.1f91f8","type":"api-current-state","z":"67df4e7c.1f7bd","name":"light state","server":"","version":2,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.master_bathroom_ceiling_light","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":620,"y":160,"wires":[[],["13cecb48.f417e5"]]},{"id":"3f29546c.35f7fc","type":"api-current-state","z":"67df4e7c.1f7bd","name":"","server":"","version":2,"outputs":1,"halt_if":"","halt_if_type":"num","halt_if_compare":"is","entity_id":"input_number.bathroom_timer","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":330,"y":300,"wires":[["bec18f62.870e5"]]},{"id":"4632fbf7.29db64","type":"api-current-state","z":"67df4e7c.1f7bd","name":"","server":"","version":2,"outputs":1,"halt_if":"","halt_if_type":"num","halt_if_compare":"is","entity_id":"input_number.master_bathroom_fan_timer","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":370,"y":420,"wires":[["9df4986e.6423f8"]]},{"id":"281b8eda.3cebe2","type":"api-current-state","z":"67df4e7c.1f7bd","name":"","server":"","version":2,"outputs":1,"halt_if":"","halt_if_type":"num","halt_if_compare":"is","entity_id":"input_number.bathroom_timer","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":330,"y":360,"wires":[["3869e153.16ae4e"]]},{"id":"bec18f62.870e5","type":"function","z":"67df4e7c.1f7bd","name":"","func":"msg.payload = 60000*msg.payload\nmsg.delay = msg.payload\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":660,"y":300,"wires":[["a0fa5af9.a50578"]]},{"id":"3869e153.16ae4e","type":"function","z":"67df4e7c.1f7bd","name":"","func":"msg.payload = msg.payload*60000\nmsg.delay = msg.payload\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":660,"y":360,"wires":[["68d1da7b.7659e4"]]},{"id":"9df4986e.6423f8","type":"function","z":"67df4e7c.1f7bd","name":"","func":"msg.payload = msg.payload*60000\nmsg.delay = msg.payload\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":660,"y":420,"wires":[["c4125b6a.de3d08"]]},{"id":"f8aa549f.306dc8","type":"trigger","z":"67df4e7c.1f7bd","name":"","op1":"","op2":"true","op1type":"nul","op2type":"str","duration":"2","extend":true,"overrideDelay":true,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":1080,"y":300,"wires":[["31417275.2d950e"]]},{"id":"9e5c6b17.5b4938","type":"trigger","z":"67df4e7c.1f7bd","name":"","op1":"","op2":"true","op1type":"nul","op2type":"str","duration":"2","extend":true,"overrideDelay":true,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":1080,"y":360,"wires":[["31417275.2d950e"]]},{"id":"953277b8.0044d8","type":"trigger","z":"67df4e7c.1f7bd","name":"","op1":"","op2":"true","op1type":"nul","op2type":"str","duration":"2","extend":true,"overrideDelay":true,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":1080,"y":420,"wires":[["cbca54df.a63bf8"]]},{"id":"31417275.2d950e","type":"api-call-service","z":"67df4e7c.1f7bd","name":"turn off lights","server":"","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.master_bathroom_ceiling_light, switch.master_bathroom_spot_light","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"off","valueType":"str"}],"queue":"none","x":1350,"y":320,"wires":[[]]},{"id":"cbca54df.a63bf8","type":"api-call-service","z":"67df4e7c.1f7bd","name":"turn off fan","server":"","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.master_bathroom_fan","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"off","valueType":"str"}],"queue":"none","x":1350,"y":420,"wires":[[]]},{"id":"a0fa5af9.a50578","type":"change","z":"67df4e7c.1f7bd","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"delay","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":860,"y":300,"wires":[["f8aa549f.306dc8"]]},{"id":"68d1da7b.7659e4","type":"change","z":"67df4e7c.1f7bd","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"delay","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":860,"y":360,"wires":[["9e5c6b17.5b4938"]]},{"id":"c4125b6a.de3d08","type":"change","z":"67df4e7c.1f7bd","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"delay","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":860,"y":420,"wires":[["953277b8.0044d8"]]},{"id":"d2c4ae61.901e7","type":"api-call-service","z":"67df4e7c.1f7bd","name":"turn on lights","server":"","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.bathroom_1_ceiling_light, switch.bathroom_1_spot_light","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"on","valueType":"str"}],"queue":"none","x":950,"y":620,"wires":[[]]},{"id":"fe89f301.57708","type":"api-call-service","z":"67df4e7c.1f7bd","name":"turn on fan","server":"","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.bathroom_1_fan","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"on","valueType":"str"}],"queue":"none","x":950,"y":680,"wires":[[]]},{"id":"d3d3e7ff.698518","type":"server-state-changed","z":"67df4e7c.1f7bd","name":"motion sensor 2","server":"","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.0x158d0006d40c37_motion","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":false,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"}],"x":200,"y":620,"wires":[["60d53844.7e2938","cbcd126.c6e16f","1a4e5aed.34bce5","d403a264.f9b57","fc2b570d.63e678"],[]]},{"id":"4d86b6c2.6be288","type":"comment","z":"67df4e7c.1f7bd","name":"Bathroom 2","info":"","x":190,"y":560,"wires":[]},{"id":"cbcd126.c6e16f","type":"api-current-state","z":"67df4e7c.1f7bd","name":"fan state","server":"","version":2,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.bathroom_1_fan","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":620,"y":680,"wires":[[],["fe89f301.57708"]]},{"id":"60d53844.7e2938","type":"api-current-state","z":"67df4e7c.1f7bd","name":"light state","server":"","version":2,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.bathroom_1_ceiling_light","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":620,"y":620,"wires":[[],["d2c4ae61.901e7"]]},{"id":"1a4e5aed.34bce5","type":"api-current-state","z":"67df4e7c.1f7bd","name":"","server":"","version":2,"outputs":1,"halt_if":"","halt_if_type":"num","halt_if_compare":"is","entity_id":"input_number.bathroom_1_lights_timer","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":360,"y":760,"wires":[["817b1353.26692"]]},{"id":"fc2b570d.63e678","type":"api-current-state","z":"67df4e7c.1f7bd","name":"","server":"","version":2,"outputs":1,"halt_if":"","halt_if_type":"num","halt_if_compare":"is","entity_id":"input_number.bathroom_1_fan_timer","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":350,"y":880,"wires":[["e03e65a4.47e598"]]},{"id":"d403a264.f9b57","type":"api-current-state","z":"67df4e7c.1f7bd","name":"","server":"","version":2,"outputs":1,"halt_if":"","halt_if_type":"num","halt_if_compare":"is","entity_id":"input_number.bathroom_1_lights_timer","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":360,"y":820,"wires":[["b3517dcc.a07b4"]]},{"id":"817b1353.26692","type":"function","z":"67df4e7c.1f7bd","name":"","func":"msg.payload = 60000*msg.payload\nmsg.delay = msg.payload\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":660,"y":760,"wires":[["c8efec6.c00451"]]},{"id":"b3517dcc.a07b4","type":"function","z":"67df4e7c.1f7bd","name":"","func":"msg.payload = msg.payload*60000\nmsg.delay = msg.payload\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":660,"y":820,"wires":[["85b71847.9e2088"]]},{"id":"e03e65a4.47e598","type":"function","z":"67df4e7c.1f7bd","name":"","func":"msg.payload = msg.payload*60000\nmsg.delay = msg.payload\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":660,"y":880,"wires":[["c6172c9e.97061"]]},{"id":"35c730ce.1a3b2","type":"trigger","z":"67df4e7c.1f7bd","name":"","op1":"","op2":"true","op1type":"nul","op2type":"str","duration":"2","extend":true,"overrideDelay":true,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":1080,"y":760,"wires":[["f3d6f67b.d00478"]]},{"id":"93646c8d.a741b","type":"trigger","z":"67df4e7c.1f7bd","name":"","op1":"","op2":"true","op1type":"nul","op2type":"str","duration":"2","extend":true,"overrideDelay":true,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":1080,"y":820,"wires":[["f3d6f67b.d00478"]]},{"id":"4de61dd7.3c3fa4","type":"trigger","z":"67df4e7c.1f7bd","name":"","op1":"","op2":"true","op1type":"nul","op2type":"str","duration":"2","extend":true,"overrideDelay":true,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":1080,"y":880,"wires":[["25b4adbe.d58032"]]},{"id":"c8efec6.c00451","type":"change","z":"67df4e7c.1f7bd","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"delay","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":860,"y":760,"wires":[["35c730ce.1a3b2"]]},{"id":"85b71847.9e2088","type":"change","z":"67df4e7c.1f7bd","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"delay","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":860,"y":820,"wires":[["93646c8d.a741b"]]},{"id":"c6172c9e.97061","type":"change","z":"67df4e7c.1f7bd","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"delay","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":860,"y":880,"wires":[["4de61dd7.3c3fa4"]]},{"id":"f3d6f67b.d00478","type":"api-call-service","z":"67df4e7c.1f7bd","name":"turn off lights","server":"","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.bathroom_1_ceiling_light, switch.bathroom_1_spot_light","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"on","valueType":"str"}],"queue":"none","x":1310,"y":780,"wires":[[]]},{"id":"25b4adbe.d58032","type":"api-call-service","z":"67df4e7c.1f7bd","name":"turn off fan","server":"","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.bathroom_1_fan","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"on","valueType":"str"}],"queue":"none","x":1310,"y":840,"wires":[[]]}]

comments are welcomed :slight_smile:

Personally I would go with this one, one for each bathroom, just in case you want to disable the PIR automation for every room individually.

However, if you want to keep yours, I’d polish it a little bit. Pretty good flow for an absolute begginer by the way, :wink:

[{"id":"d2c4ae61.901e7","type":"api-call-service","z":"67df4e7c.1f7bd","name":"turn on everything","server":"9405c3fe.d0a6c","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.bathroom_1_ceiling_light, switch.bathroom_1_spot_light, switch.bathroom_1_fan","data":"","dataType":"jsonata","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":610,"y":600,"wires":[[]]},{"id":"d3d3e7ff.698518","type":"server-state-changed","z":"67df4e7c.1f7bd","name":"motion sensor 2","server":"9405c3fe.d0a6c","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.0x158d0006d40c37_motion","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":false,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"x":200,"y":620,"wires":[["1a4e5aed.34bce5","fc2b570d.63e678","3f12595f.0b0956"]]},{"id":"4d86b6c2.6be288","type":"comment","z":"67df4e7c.1f7bd","name":"Bathroom 2","info":"","x":190,"y":560,"wires":[]},{"id":"1a4e5aed.34bce5","type":"api-current-state","z":"67df4e7c.1f7bd","name":"","server":"9405c3fe.d0a6c","version":2,"outputs":1,"halt_if":"","halt_if_type":"num","halt_if_compare":"is","override_topic":false,"entity_id":"input_number.bathroom_1_lights_timer","state_type":"num","state_location":"inputState","override_payload":"msg","entity_location":"","override_data":"none","blockInputOverrides":true,"x":580,"y":660,"wires":[["c8efec6.c00451"]]},{"id":"fc2b570d.63e678","type":"api-current-state","z":"67df4e7c.1f7bd","name":"","server":"9405c3fe.d0a6c","version":2,"outputs":1,"halt_if":"","halt_if_type":"num","halt_if_compare":"is","override_topic":false,"entity_id":"input_number.bathroom_1_fan_timer","state_type":"num","state_location":"inputState","override_payload":"msg","entity_location":"","override_data":"none","blockInputOverrides":true,"x":570,"y":700,"wires":[["c6172c9e.97061"]]},{"id":"35c730ce.1a3b2","type":"trigger","z":"67df4e7c.1f7bd","name":"","op1":"","op2":"true","op1type":"nul","op2type":"str","duration":"2","extend":false,"overrideDelay":true,"units":"s","reset":"on","bytopic":"all","topic":"topic","outputs":1,"x":1115,"y":660,"wires":[["f3d6f67b.d00478"]],"l":false},{"id":"4de61dd7.3c3fa4","type":"trigger","z":"67df4e7c.1f7bd","name":"","op1":"","op2":"true","op1type":"nul","op2type":"str","duration":"2","extend":false,"overrideDelay":true,"units":"s","reset":"on","bytopic":"all","topic":"topic","outputs":1,"x":1115,"y":700,"wires":[["25b4adbe.d58032"]],"l":false},{"id":"c8efec6.c00451","type":"change","z":"67df4e7c.1f7bd","name":"","rules":[{"t":"set","p":"delay","pt":"msg","to":"$round($number(inputState))*60000","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":940,"y":660,"wires":[["35c730ce.1a3b2"]]},{"id":"c6172c9e.97061","type":"change","z":"67df4e7c.1f7bd","name":"","rules":[{"t":"set","p":"delay","pt":"msg","to":"$round($number(inputState))*60000","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":940,"y":700,"wires":[["4de61dd7.3c3fa4"]]},{"id":"f3d6f67b.d00478","type":"api-call-service","z":"67df4e7c.1f7bd","name":"turn off lights","server":"9405c3fe.d0a6c","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.bathroom_1_ceiling_light, switch.bathroom_1_spot_light","data":"","dataType":"jsonata","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1330,"y":660,"wires":[[]]},{"id":"25b4adbe.d58032","type":"api-call-service","z":"67df4e7c.1f7bd","name":"turn off fan","server":"9405c3fe.d0a6c","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.bathroom_1_fan","data":"","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1330,"y":700,"wires":[[]]},{"id":"3f12595f.0b0956","type":"switch","z":"67df4e7c.1f7bd","name":"on?","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":430,"y":600,"wires":[["d2c4ae61.901e7"]]},{"id":"9405c3fe.d0a6c","type":"server","name":"Home Assistant","addon":true}]
1 Like

it took 4 days and a lot of help from awesome people right here. thanks to everyone.

1 Like