Breaking my head in Node-Red. Heater with motion sensor

Hi all,

I’m almost cross eyed…
I want to automate a simple task via Node Red, but can’t get my head around it. Hope someone could help me out.

Situation:
I have 2 patio heaters; switch.heater_left and switch.heater.right.
They are in a group: group.heaters.

They can be turned on by a Zigbee switch separately.

I want to make use of a Zigbee motion sensor (binary_sensor.parasol), so that if no motion is detected, the group will be turned off after 10 minutes of no motion.

I don’t want them to turn on if motion is detected. Only turn them on with the switch. And off after 10 minutes of no motion or manual by the switch.

I’v tried a couple of things, but with unwanted behavior…

Hi there, Please try this flow.

[{"id":"0338dda6747f35f6","type":"server-state-changed","z":"51045e07.bbf87","name":"binary_sensor.parasol","server":"d177950.2a5aa68","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.parasol","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":"10","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":2220,"wires":[["402dd20372f41777"],[]]},{"id":"402dd20372f41777","type":"api-call-service","z":"51045e07.bbf87","name":"group.heaters","server":"d177950.2a5aa68","version":3,"debugenabled":false,"service_domain":"homeassistant","service":"turn_off","entityId":"group.heaters","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":550,"y":2220,"wires":[[]]},{"id":"d177950.2a5aa68","type":"server","name":"Home Assistant","version":1,"legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

It looks like this

image

If this doesnot work you will have to share the state of the binary sensor and your flow in nodered to have a better look

1 Like

Wow… So simple! :smiley: I was thinking way too complicated with conditions and such…
Testing right now, but is seems logic.

Thank you sheminasalam.

1 Like