In the cellar I have a room where I sometimes dry washing during the winter. I have a dehumidifier in the room connected to a smart plug. What I would like to automate it so that during a certain time period (low energy tariff at night) if the humidity in the room goes above a certain level, then the dehumidifier is switched on. Also if the humidity is already high when the set time period begins, the dehumidifier is switched on.
Looked at various automation examples, but unfortunately not able to get my head around how to set this up.
Not sure what your exact entities are, but I should think it might look something like this:
- alias: Dehumidifier on
trigger:
- platform: time
at: 'HH:MM:SS'
- platform: numeric_state
entity_id: sensor.HUMIDITY
above: NN
- platform: homeassistant
event: start
condition:
- condition: time
after: 'HH:MM:SS'
before: 'HH:MM:SS'
- condition: numeric_state
entity_id: sensor.HUMIDITY
above: NN
action:
service: switch.turn_on
entity_id: switch.DEHUMIDIFIER
That would be the “turn on” part. You’ll also want a “turn off” part that turns it off either when the humidity drops below another threshold or when the time period ends. There might be more elegant ways to do this, but at least this gives you an idea of how you might start.