Trigger state node help

I setup a trigger state node where I want it to trigger when my door lock is unlocked and the door is open, but it is not sending out on the blocked node versus the allowed node. Am I doing something wrong or am I misunderstanding how this works?

image

Might want to check the state is changing of binary_sensor.front_door_contact using the Current State / Debug node to verify the sensor is working and you are getting the expected value.

And check what reversing the conditions does.

@MaxK current state worked and is sending the expected value. I did reverse the conditions and I did get the state of the sensor which is the primary now after switching it. Is this expected the state of the primary entity?

I just wanted to verify that the binary_sensor.front_door_contact was working correctly. I have had sensors fail and thought it was the logic. Your sensor is working correctly.

The entity in the Entity Properties (lock_schlage_lock in your original flow above) is what triggers the conditions evaluation (when there is a change from unlocked to locked or locked to unlocked). Then, if all conditions are true, you get the flow to debug 13. Otherwise, you get the flow to debug 14. And msg.payload contains the lock_schlage_lock value.

When binary_sensor.front_door_contact is the entity in the Entity Properties, then it is waiting for it to change from on to off or off to on. If all conditions are true, debug 13, otherwise debug 14. And msg.payload contains the value of binary_sensor.front_door_contact.

This is the expected behavior. You will not get a trigger and condition evaluation on the second condition if it changes state.

1 Like

It makes sense now why the first one was failing now. The lock was in state of “unlocked” and the door sensor was still closed = “off”. Reversing it the door is open = “on” and the lock is unlocked to satisfying the conditions. Thank you for the explanation! This is going to help me with more complex automations.