Dehumidifier works fine without time condition

Hello

I got my dehumidifier working with a smart plug, taking the humidity readings from an esp8266 and the automation works just as it should.

Now, I wanted to add a time condition, so it won’t run between the hours of 23:00 and 07:00. I have wrote that into the ‘on’ section but left it out of the ‘off’ part, as if the dehumidifier is on and runs past 23:00, then I need it to turn off once below 55% rh.

Currently though, since adding the time condition, it didn’t turn on after 23:00 but it never switched back on in the morning. I think I checked at around 08:00 and the humidity was above 70%.

Any ideas please!


#dehumidifier
- id: '........'
alias: _high humidity
trigger:
platform: numeric_state
entity_id: sensor.bedroom_cupboard_humidity
above: 65
condition:
# Prefix the first line of each condition configuration
# with a '-'' to enter multiple
- condition: time
after: '07:00:00'
before: '23:00:00'
action:
- service: homeassistant.turn_on
entity_id: switch.dehumidifier

- id: '........'
alias: _low humidity
trigger:
platform: numeric_state
entity_id: sensor.bedroom_cupboard_humidity
below: 55
action:
- service: homeassistant.turn_off
entity_id: switch.dehumidifier

put a time trigger in to turn it on at 0700. then you can also put in a condition that the humidity is above 65.

trigger:
  - platform: numeric_state 
    entity_id: sensor.bedroom_cupboard_humidity
    above: 65
  - platform: time
    at: '07:00:00'
condition:
  - condition: time
    after: '06:59:00'
    before: '23:00:00'
  - condition: numeric_state
    entity_id: sensor.bedroom_cupboard_humidity
    above: 65

that way if the humidity is already above 65% at 0700 then it will turn on. If the humidity isn’t above 65 at 0700 then it will wait until the humidity gets above 65% then turn on.

1 Like

That’s great, thank you. Never thought of a timer but that looks like it’ll do the job perfectly. I’ve been banging my head about this as I’ve literally done as the documents state but something is askew.

I’ve already amended the code, which I’m preempting it not working but then I’ll run your script Sunday night (UK time) and report back. Thanks

1 Like

Hello. My code change didn’t work, as expected. So I implemented yours and it all kicked in first thing this morning! Thank you very much for that, I don’t think I’d have arrived at that conclusion.

1 Like

Hello,

As I’m using a Sonoff S20, there’s no sort of power tracking, so when the dehumidifier is full, I have no idea unless I see that it’s been on for hours with the humidity high.

Does anybody have a way to implement code, for example that’d look to see if the humidity has increased within a set range once the dehumidifier has been running. Then I could trigger an alert, which I have already set up for alerts through Telegram

Thanks

use a state trigger for the humidity being above x (whatever percent the humidity should stay below while running) and use a condition that the humidifier s20 is ‘on’.