I am using HA for years now and most of the things I was able to figure out.
Now I want an automation to run but I can’t figure out why it won’t run correct.
I want my dehumidifier to switch on and of on a certain humidity percentage.
This part works fine.
The thing is that if the Garage door is open for a while I want the dehumidifier to turn off.
This part I can’t seem to get working.
My automations look like below.
#####
- id: Ontvochtiger aan
alias: Ontvochtiger aan
trigger:
- above: 67
entity_id: sensor.temp_hum_garage_wp_humidity
for:
minutes: 10
platform: numeric_state
conditions:
alias: "garagedeur dicht"
and:
- condition: state
entity_id: binary_sensor.garagedeur_hoofd_contact
state: on
action:
- entity_id: switch.ontvochtiger
service: homeassistant.turn_on
initial_state: "on"
#####
- id: Ontvochtiger uit
alias: Ontvochtiger uit
trigger:
- below: 65
entity_id: sensor.temp_hum_garage_wp_humidity
for:
minutes: 10
platform: numeric_state
Conditions:
alias: "garagedeur dicht"
or:
- condition: state
entity_id: binary_sensor.garagedeur_hoofd_contact
state: off
action:
- entity_id: switch.ontvochtiger
service: homeassistant.turn_off
initial_state: "on"
I hope someone can point me in the right direction.
Myself, I would create a “threshold sensor” and use the upper and lower limits of humidity that you desire.
Then you can use this as a binary sensor to turn on and off the dehumidifier.
I would then create on automation that deals with turning the dehumidifier on and off based on the binary sensor state, with the condition to only turn the dehumidifier on if the door is closed:
I would then create a 2nd automation the turns the dehumidifier off if the door is opened and the dehumidifier is on, and if the door becomes closed and threshold sensor is on then turn dehumidifier on. Something like:
There are 101 ways of doing this and could achieve the whole thing in one automation particularly if using template’s etc - but for simplicity the above should work.
Thanks, I used your suggestion and so far it seems to work.
Now I can finetune it so that it does not unnecessary when I open the door just to get in and out.