Reset State Node?

If I have a state node set using if state is something for x seconds can I reset that like a trigger node and make it check for x seconds again?

Why wouldn’t it do that by itself?

I would assume that as long as it stayed in that same state (ex. ‘on’ for 60 seconds), then nothing would change. Seems like it would have to change to ‘off’ then ‘on’ for 60 seconds to run again.

1 Like

Ya that’s what I thought I guess I’ll keep using the trigger node.

Say my motion sensor has been off for 30s then if the door is closed I want it to reset and check another 30s. I do that know with a trigger node but was seeing if I could simplfy it.

Could you share what you got so far and the overall goal of the flow please?

Right now I have this and it’s fine but I just watched a video about new features of the sate node, not really that new anymore, and using FOR x time and how to simplify flows but doesn’t seem it will work for what I’m doing.

I’m not entirely sure what you’re trying to achieve, because I don’t understand your use case from the description above.

For me I use the msg.reset node to reset a delay node in several flows in order the cause the logic to start over.

The simple use case for this is if you want a light to turn off 5 minutes after motion was detected. But if motion occurs during those 5 minutes, you want to restart that timer. The restart is achieved with the msg.reset node. Hope this helps.

Paste the code please, not a picture. Export the flow and paste it here.

No, you can’t.

3 Likes

My motion sensor has a “blind time” - the time, in minutes, the sensor will stay on when initial detection occurs. So, if blind time = 1, then the sensor state will report ‘on’ for at least 1 minute. If there is another detection before the blind time expires, then it stays ‘on’ for another minute. If the blind time expires, then the state is ‘off’ (the timer is in the sensor, not my automation) Thus:

Capture

[{"id":"a1f8653c.15a248","type":"trigger-state","z":"fe1a8042.af255","name":"Garage Motion","server":"f3f422ce.9f2a6","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"binary_sensor.garage_motion_motion","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"targetType":"this_entity","targetValue":"","propertyType":"current_state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"on","propertyValue":"new_state.state"},{"targetType":"entity_id","targetValue":"switch.garagelightswitch","propertyType":"current_state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"off","propertyValue":"new_state.state"}],"inputs":1,"outputs":2,"customoutputs":[],"outputinitially":false,"state_type":"str","enableInput":true,"x":102,"y":191,"wires":[["97e6a3ea.2d8cd"],[]]},{"id":"97e6a3ea.2d8cd","type":"api-call-service","z":"fe1a8042.af255","name":"Garage Light On","server":"f3f422ce.9f2a6","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":[],"deviceId":[],"entityId":["switch.garagelightswitch"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":310,"y":191,"wires":[["4e0859a3.102238"]]},{"id":"4e0859a3.102238","type":"ha-wait-until","z":"fe1a8042.af255","name":"No Motion","server":"f3f422ce.9f2a6","version":2,"outputs":1,"entityId":"binary_sensor.garage_motion_motion","entityIdFilterType":"exact","property":"state","comparator":"is","value":"off","valueType":"str","timeout":"0","timeoutType":"num","timeoutUnits":"minutes","checkCurrentState":true,"blockInputOverrides":true,"outputProperties":[],"x":290,"y":249,"wires":[["4ff57502.55030c"]]},{"id":"4ff57502.55030c","type":"api-call-service","z":"fe1a8042.af255","name":"Garage Light Off","server":"f3f422ce.9f2a6","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":["switch.garagelightswitch"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":519,"y":248,"wires":[[]]},{"id":"f3f422ce.9f2a6","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30,"areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]

Note the use of the “trigger: state” node which checks if already on.

1 Like

Well there’s your answer. :rofl:

1 Like

Kermit Hath Spoken. :smiley: