For minute in trigger

  alias: 'Finestra Cucina Dx - Thermo off'
  trigger:
    platform: state
    entity_id: binary_sensor.door_window_sensor_158d0000e8bc0e
    from: 'off'
    to: 'on'
    for:
      minutes: 2
  action:
  - service: climate.set_preset_mode
    data:
      entity_id: climate.netatmo_cucina
      preset_mode:

Hello how could i translate the trigger especially the for minute 2 in node red? Thank you

Use a delay node, then check the state again? That’s about the most straightforward way.

Or you can use a wait until with a 2 minute timeout

I usually just use a delay node, check state, and then perform action.

One example? There is a node that make this instruction.

Event node state changed > delay > check state > do something

poll state node could not be used to perform the task?

Why a poll state node?

to define the waiting time. if I have not misunderstood

You’re not looking to change the poll rate. You’re looking for a state change. When that state change occurs, wait 2 minutes and check the state is still the same(expected), then perform your action.

and not exist a node that perform this?

I don’t understand.

You’re wanting a node that does the entire process?

No. A node doesn’t exist to act this way. You are responsible for writing your flows

ok now i try

Just use the node red trigger and have the trigger reset if another “on” state comes from the motion sensor. Like this:
image

Here’s how I do it for my bathroom.

Explained here:

2 Likes

could i see the code?

https://pastebin.com/86D4gNy1

Here ya go.

is this correct??

https://pastebin.com/Jwi427Fv

[{"id":"101b4b2f.cc4735","type":"trigger","z":"78e7e9e3.82d2b8","op1":"","op2":"{\"message\":\"Tende Aperte!\", \"position\": 100}","op1type":"nul","op2type":"json","duration":"2","extend":false,"units":"min","reset":"on","bytopic":"all","name":"Deleyed Off","x":710,"y":336,"wires":[["40c1e2b6.c8642c"]]},{"id":"45cf3e5b.21829","type":"server-state-changed","z":"78e7e9e3.82d2b8","name":"Illuminazione Camera da letto","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.illumination_158d0001656f8f","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":152,"y":288,"wires":[["5e0a4218.5e30ec"]]},{"id":"5e0a4218.5e30ec","type":"switch","z":"78e7e9e3.82d2b8","name":">3100","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"2000","vt":"str"},{"t":"btwn","v":"2000","vt":"num","v2":"1000","v2t":"num"},{"t":"lt","v":"1000","vt":"str"}],"checkall":"true","repair":true,"outputs":3,"x":354,"y":288,"wires":[["de7e8da7.c955","99790d4b.414ae"],["77316a5b.4ae2c4","cecbf4eb.ae0958"],["101b4b2f.cc4735","abd234b8.0a2ba8"]]},{"id":"40c1e2b6.c8642c","type":"time-range-switch","z":"78e7e9e3.82d2b8","name":"10-17","startTime":"10:00","endTime":"17:00","startOffset":0,"endOffset":0,"x":882,"y":288,"wires":[["e27f1178.876ac","1e8a2801.648578"],[]]},{"id":"1e8a2801.648578","type":"api-call-service","z":"78e7e9e3.82d2b8","name":"Tenda al","version":1,"debugenabled":false,"service_domain":"cover","service":"set_cover_position","entityId":"cover.curtain_158d00028821ae","data":"{\"position\": {{payload.position}}}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1052,"y":336,"wires":[[]]},{"id":"e27f1178.876ac","type":"api-call-service","z":"78e7e9e3.82d2b8","name":"Tende IOs","version":1,"debugenabled":false,"service_domain":"script","service":"my_notify","entityId":"","data":"{\"message\":\"{{payload.message}}\",\"title\":\"Smart Home Alerts\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1058,"y":288,"wires":[[]]},{"id":"de7e8da7.c955","type":"trigger","z":"78e7e9e3.82d2b8","op1":"","op2":"{\"message\":\"Tende Chiuse!\", \"position\": 30}","op1type":"nul","op2type":"json","duration":"2","extend":false,"units":"min","reset":"on","bytopic":"all","name":"Deleyed Off","x":710,"y":240,"wires":[["40c1e2b6.c8642c"]]},{"id":"77316a5b.4ae2c4","type":"trigger","z":"78e7e9e3.82d2b8","op1":"","op2":"{\"message\":\"Tende Chiuse!\", \"position\": 50}","op1type":"nul","op2type":"json","duration":"2","extend":false,"units":"min","reset":"on","bytopic":"all","name":"Deleyed Off","x":710,"y":288,"wires":[["40c1e2b6.c8642c"]]},{"id":"99790d4b.414ae","type":"change","z":"78e7e9e3.82d2b8","name":"reset","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":514,"y":256,"wires":[["77316a5b.4ae2c4","101b4b2f.cc4735"]]},{"id":"cecbf4eb.ae0958","type":"change","z":"78e7e9e3.82d2b8","name":"reset","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":514,"y":288,"wires":[["de7e8da7.c955","101b4b2f.cc4735"]]},{"id":"abd234b8.0a2ba8","type":"change","z":"78e7e9e3.82d2b8","name":"reset","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":514,"y":320,"wires":[["77316a5b.4ae2c4","de7e8da7.c955"]]}]

why reset?

If the payload starts at 1500 and a minute passes and the payload goes up to 2500 both the middle and top trigger nodes will be running. After a minute the middle one will fire and pass its payload to the time-range node and then a minute later the top trigger-node will pass its payload to the time-range node. What the reset nodes do is when a value changes range it will stop/reset the other two trigger nodes.

how would you redefine this flow? I had done without reset.
https://pastebin.com/5fUmEKvF