Events state versus Inject : different working

Hi all,

I have a newbie question …
Please find below my node-red example :

At the left side, If I click on “ON” button, I don’t have any problem : the “OR gate” is true.
But if I open my door (the sensor “capteur_ouverture_porte_terrasse” is on), the “OR gate” is false.

Do you have any idea ?

Many thanks.
@urelb

Events state nodes doesn’t set the values the same way as a inject (on default).

Add a debug on the event state node set to complete message and you will see where the “new state” is on, and just copy the path.

But I’m not sure what your nodes are doing.
It’s always better to include your sequence in your question.

Thanks for your answer Hellis81.

Ok well, I know for the sequence but I don’t know how to make it … I’ll check how to do for the next time !:wink:

I put a debog node on the event state :

binary_sensor.ouv_porte_terrasse : msg.payload : string[2]
“on”

What I want to do :

1_ If my door sensor send “on” (door open)
2_ I want to wait 30 seconds (here I change delay node by the switch one to check this problem)
3_ Then check if my door sensor OR another door sensor is still open
4_ If yes I want to break my aqara plug.

I think there is a problem with my OR GATE.

It works by doing 2 differents path (without my OR gate).