How to re-check an entity state after 5 min by using a trigger-state node?

I am trying to check whether a door has been open for at least 5 min or not. I tried the current_state node which easily allows me to wait for a time and then check the entity state but for some reason, it does not work for me and not sure why, and by no works I mean it never outputs anything none of the debug nodes (not sure if the reason is that is a binary_sensor.sliding_door_master_room but I doubt it):

I switched to the trigger-state node and this one works fine, however, I am not sure how to re-check the state after 5 min.

I have the following now but I don’t like it and am pretty sure there is a better solution:

Possible “hacky” solutions could be:

  • a function with a timer for 5 min and get the state from globals

The whole idea after this is to toggle the AC on/off or decrease/increase it is temperature if a door has been open for a given amount of time.

I am open to ideas, can I get some?

The current state node has a facility where you can say “for 5 minutes” and it won’t trigger if the condition has not been met for 5 minutes.

It’s nice!

You’re close…

Current state ONLY sends when it’s either coming out of a wait that was previously triggered, like @Rudd-O says - OR if you triggered the node somehow with any message incoming. Your current state node is not sending anything because no message came in to tell it to.

The Trigger state nodes (or events: state node) send on change - so they fire by themselves on ANY change.

So think of them like this:

  • When ‘THING’ Changes Send Message - Use Trigger State or events: state
  • I need to ask the current state of ‘THING’ and get a response - current state

So in your second image - change the SECOND trigger node to a current state node and you’ll be where you want to be.

You dont want to use trigger state for both - because on change BOTH trigger state nodes fire and send messages. THe first one into the delay, and the second one into whatever comes next. So you’d get:

Fire > wait 5 min (AND) Fire send down the line, then 5 minutes later - another Fire which will send the original message down the line>

If you use ONLY current state - you never see anything fire

But by using trigger state then the wait - into current state, what will happen is it will fire on its own, wait, then send that message into the current state which will get the CURRENT status and pass it along.

1 Like

Thank you for the great explanation is very clear to me now, and thanks @Rudd-O as well.

PS: I want to mark this as the solution but do not see the option yet, will keep an eye and mark it as soon as it appears

2 Likes