Central ventilation - prevent same flow to start twice

This is the logic for the moist detection I use:

[{"id":"d8700be4.836268","type":"server-state-changed","z":"60dbc815.eaf0c8","name":"Badkamer vocht trigger","server":"a244206a.52df3","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.badkamer_relative_humidity_trigger_vochtig","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":"","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"x":140,"y":200,"wires":[["11eda126.2c433f"]]},{"id":"f331a66b.8f9828","type":"comment","z":"60dbc815.eaf0c8","name":"Badkamer vantilatie trigger","info":"","x":130,"y":80,"wires":[]},{"id":"31cac87d.8735f8","type":"trigger","z":"60dbc815.eaf0c8","name":"delay off 120m","op1":"","op2":"off","op1type":"nul","op2type":"str","duration":"60","extend":true,"units":"min","reset":"on","bytopic":"all","outputs":1,"x":380,"y":480,"wires":[["ac1a15f0.213d08","3a03b168.341a1e","39bffd2c.cc3d42"]]},{"id":"e01fff9.5c0ac","type":"inject","z":"60dbc815.eaf0c8","name":"","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"on","payloadType":"str","x":390,"y":60,"wires":[["11eda126.2c433f"]]},{"id":"a8e7492e.afdb48","type":"inject","z":"60dbc815.eaf0c8","name":"","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"off","payloadType":"str","x":390,"y":100,"wires":[["11eda126.2c433f"]]},{"id":"8a6d0859.8d6e98","type":"api-current-state","z":"60dbc815.eaf0c8","name":"MV2 aan","server":"a244206a.52df3","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"switch.fibaro_system_fgs223_double_relay_switch","state_type":"str","state_location":"","override_payload":"none","entity_location":"","override_data":"none","blockInputOverrides":false,"x":580,"y":180,"wires":[["fd97b9be.3e3b98"],[]]},{"id":"fd97b9be.3e3b98","type":"api-call-service","z":"60dbc815.eaf0c8","name":"Zet MV2 uit","server":"a244206a.52df3","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.fibaro_system_fgs223_double_relay_switch","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":730,"y":180,"wires":[[]]},{"id":"63553029.fc1ee","type":"api-current-state","z":"60dbc815.eaf0c8","name":"MV3 aan","server":"a244206a.52df3","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"switch.fibaro_system_fgs223_double_relay_switch_2","state_type":"str","state_location":"","override_payload":"none","entity_location":"","override_data":"none","blockInputOverrides":false,"x":580,"y":240,"wires":[[],["b5861c5e.74f64"]]},{"id":"e027c8fd.e9f458","type":"api-call-service","z":"60dbc815.eaf0c8","name":"Zet MV3 uit","server":"a244206a.52df3","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.fibaro_system_fgs223_double_relay_switch_2","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":730,"y":540,"wires":[[]]},{"id":"11eda126.2c433f","type":"switch","z":"60dbc815.eaf0c8","name":"On / Off","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":360,"y":200,"wires":[["8a6d0859.8d6e98","63553029.fc1ee","951c1b1a.d9bb88"],["951c1b1a.d9bb88"]]},{"id":"7e527d1f.b285c4","type":"api-call-service","z":"60dbc815.eaf0c8","name":"Zet MV2 aan","server":"a244206a.52df3","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.fibaro_system_fgs223_double_relay_switch","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":890,"y":480,"wires":[[]]},{"id":"25aeee94.fc5be2","type":"api-call-service","z":"60dbc815.eaf0c8","name":"Zet MV3 aan","server":"a244206a.52df3","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.fibaro_system_fgs223_double_relay_switch_2","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":910,"y":240,"wires":[[]]},{"id":"ac1a15f0.213d08","type":"api-current-state","z":"60dbc815.eaf0c8","name":"MV2 aan","server":"a244206a.52df3","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"switch.fibaro_system_fgs223_double_relay_switch","state_type":"str","state_location":"","override_payload":"none","entity_location":"","override_data":"none","blockInputOverrides":false,"x":560,"y":480,"wires":[[],["a090de6d.71d2e"]]},{"id":"3a03b168.341a1e","type":"api-current-state","z":"60dbc815.eaf0c8","name":"MV3 aan","server":"a244206a.52df3","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"switch.fibaro_system_fgs223_double_relay_switch_2","state_type":"str","state_location":"","override_payload":"none","entity_location":"","override_data":"none","blockInputOverrides":false,"x":560,"y":540,"wires":[["e027c8fd.e9f458"],[]]},{"id":"a090de6d.71d2e","type":"delay","z":"60dbc815.eaf0c8","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":720,"y":480,"wires":[["7e527d1f.b285c4"]]},{"id":"b5861c5e.74f64","type":"delay","z":"60dbc815.eaf0c8","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":740,"y":240,"wires":[["25aeee94.fc5be2"]]},{"id":"951c1b1a.d9bb88","type":"rbe","z":"60dbc815.eaf0c8","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":210,"y":480,"wires":[["31cac87d.8735f8","bbc0a7bd.51db38"]]},{"id":"a244206a.52df3","type":"server","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

It is however not 100% reliant on node red. I havent found an easy way of doing it inside node red itself, but HA offers a very quick and easy solution. a binary sensor - trend. so I let NR listen to that trigger. This is that code in HA (configuration > Binary sensor:

- platform: trend
  sensors:
    badkamer_relative_humidity_trigger_vochtig:
      entity_id: sensor.philio_technology_corp_ph_pat02_b_eu_multisensor_2in1_relative_humidity
      min_gradient: 0.08
      device_class: moisture

This is how it reacts and works in my home with the 2in1 sensor from philio.
On the left axis I have put moist+temperature.
On the right axis I have put the trigger, the binary_sensor - trend (1 = moist detected. 0 = dry)
image
When I myself go and take a shower, I can hear the vent go to HIGH within 1, maybe 2 minutes at most from the time I open the tap.

It looks like a solid solution. I have not played around with binary sensors yet, so will have a close look at it. Thanks for the support and sharing the flows.

Will give it a try and will come back in case of succes, failures or questions :slight_smile:

no problem. good luck :slight_smile: