What am I doing wrong with this flow?

Trying to set up a simple flow with Node-RED to turn off my AC unit when the door is open, then turn it back on when it is closed, and I can’t even get the debug event to fire when the door is opened.


door_open_state

Any thoughts? Appreciate the help.

Remove the injects.
I feel like they’re blocking the message.
Maybe not I’ve never seen them have a pass through.

Can you export the flow here so I can check it out please?

I’ve never seen inject nodes accepting input connections like that. :thinking:

What version of Node-RED are you running?

1 Like

I have a lone trigger in there that was supposed to go after the door open event, but I was trying to get it to work immediately for testing.

[{"id":"9d5430cb.ffc45","type":"tab","label":"Door open HVAC","disabled":false,"info":""},{"id":"dc8d39d9.b3d538","type":"server-state-changed","z":"9d5430cb.ffc45","name":"Door open","server":"2b9a0311.47378c","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.zwa008_door_window_sensor_7_sensor","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"open","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"x":560,"y":280,"wires":[["83c28006.e1491","d2be238a.53e31"],[]]},{"id":"888511aa.f7fa3","type":"trigger","z":"9d5430cb.ffc45","name":"","op1":"","op2":"","op1type":"nul","op2type":"nul","duration":"5","extend":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":160,"y":420,"wires":[[]]},{"id":"4cf90d71.8319c4","type":"api-call-service","z":"9d5430cb.ffc45","name":"Set hvac to off","server":"2b9a0311.47378c","version":1,"debugenabled":false,"service_domain":"climate","service":"set_hvac_mode","entityId":"climate.gc_tbz48_battery_powered_z_wave_thermostat_mode","data":"{ \"hvac_mode\":\"off\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1160,"y":260,"wires":[["8826a55f.2a53e8"]]},{"id":"8826a55f.2a53e8","type":"server-state-changed","z":"9d5430cb.ffc45","name":"Door closed","server":"2b9a0311.47378c","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.zwa008_door_window_sensor_7_sensor","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"closed","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"x":1350,"y":260,"wires":[["6661c0c8.93cda"],[]]},{"id":"765f012c.88478","type":"server-state-changed","z":"9d5430cb.ffc45","name":"Door closed","server":"2b9a0311.47378c","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.zwa008_door_window_sensor_7_sensor","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"closed","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"x":1350,"y":320,"wires":[["76bb712c.277ba"],[]]},{"id":"76bb712c.277ba","type":"api-call-service","z":"9d5430cb.ffc45","name":"Set hvac to cool","server":"2b9a0311.47378c","version":1,"debugenabled":false,"service_domain":"climate","service":"set_hvac_mode","entityId":"climate.gc_tbz48_battery_powered_z_wave_thermostat_mode","data":"{ \"hvac_mode\":\"cool\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1560,"y":320,"wires":[[]]},{"id":"6661c0c8.93cda","type":"api-call-service","z":"9d5430cb.ffc45","name":"Set hvac to heat","server":"2b9a0311.47378c","version":1,"debugenabled":false,"service_domain":"climate","service":"set_hvac_mode","entityId":"climate.gc_tbz48_battery_powered_z_wave_thermostat_mode","data":"{ \"hvac_mode\":\"heat\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1560,"y":260,"wires":[[]]},{"id":"83c28006.e1491","type":"api-current-state","z":"9d5430cb.ffc45","name":"HVAC mode","server":"2b9a0311.47378c","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"climate.gc_tbz48_battery_powered_z_wave_thermostat_mode","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":750,"y":280,"wires":[["f58729cc.d12e88","c56b58f.21d45a8"]]},{"id":"f58729cc.d12e88","type":"switch","z":"9d5430cb.ffc45","name":"Heat/Cool","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"heat","vt":"str"},{"t":"eq","v":"cool","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":940,"y":280,"wires":[["4cf90d71.8319c4","f004b30b.985be"],["69861346.c1148c","1cdafb08.bcb5b5"]]},{"id":"69861346.c1148c","type":"api-call-service","z":"9d5430cb.ffc45","name":"Set hvac to off","server":"2b9a0311.47378c","version":1,"debugenabled":false,"service_domain":"climate","service":"set_hvac_mode","entityId":"climate.gc_tbz48_battery_powered_z_wave_thermostat_mode","data":"{ \"hvac_mode\":\"off\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1160,"y":320,"wires":[["765f012c.88478"]]},{"id":"35b056.49945faa","type":"debug","z":"9d5430cb.ffc45","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":690,"y":160,"wires":[]},{"id":"d2be238a.53e31","type":"inject","z":"9d5430cb.ffc45","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"door open","payloadType":"str","x":640,"y":100,"wires":[["35b056.49945faa"]]},{"id":"c56b58f.21d45a8","type":"inject","z":"9d5430cb.ffc45","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"hvac mode check","payloadType":"str","x":940,"y":100,"wires":[["5ed01091.eb6ba"]]},{"id":"5ed01091.eb6ba","type":"debug","z":"9d5430cb.ffc45","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":970,"y":160,"wires":[]},{"id":"f004b30b.985be","type":"inject","z":"9d5430cb.ffc45","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"hvac mode heat","payloadType":"str","x":1160,"y":120,"wires":[["b824aea6.400f1"]]},{"id":"b824aea6.400f1","type":"debug","z":"9d5430cb.ffc45","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1190,"y":180,"wires":[]},{"id":"1cdafb08.bcb5b5","type":"inject","z":"9d5430cb.ffc45","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"hvac mode cool","payloadType":"str","x":1020,"y":440,"wires":[["12958b73.ed9e85"]]},{"id":"12958b73.ed9e85","type":"debug","z":"9d5430cb.ffc45","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1050,"y":500,"wires":[]},{"id":"2b9a0311.47378c","type":"server","z":"","name":"Home Assistant","addon":true}]

Thanks again for the help.

I believe that binary_sensors have 2 possible states: ‘on’ or ‘off’. Your node is checking for the value ‘open’, which will never happen so your flow never starts.

1 Like

Of course! I need to pay more attention to the sensor type next time.

Also, I figured out that the Aeotec Door Sensor 7 sensor you should be using is

binary_sensor.zwa008_door_window_sensor_7_access_control_door_window_open
and not
binary_sensor.zwa008_door_window_sensor_7_sensor

Thanks again for the help guys! The debug test is working!