State changed duration

#1

Hi

i using Hass.io and Node red, and i want to create the following flow:

State Sensor X
Change to Y

I want to create split/flow that if time is < 20 min from state change go to 1 and if not go to 2

0 Likes

#2

These examples in the cookbook will be of help

https://cookbook.nodered.org/basic/route-on-context

https://cookbook.nodered.org/basic/trigger-timeout

0 Likes

#3

Tnx for the response but according to this
i can call/set node if i didnt get response more than X time

i want for example create the following flow.

Door sensor open -> the node should check if the Boolean (state) was change to home more than 30 min
do do action X if less open the light.

0 Likes

#4

Flow 1 (home in last 30 mins)
What ever you want -[Trigger]-[Change Node to set global value]

Trigger node Send true then wait for 30 minutes then send false
So if triggered in the last 30 mins global value is true otherwise false

Flow 2
Door sensor open -[switch node to check global value]----
If global value is true do something otherwise don't

0 Likes

#5

Which node did you use? Possible to paste an example here please I am new in the field.

Tnx
!

0 Likes

#6

The trigger and change node and the switch node as per my last reply

0 Likes