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.
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.
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:
[{"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.
Well thereâs your answer.
Kermit Hath Spoken.