Newbie automation help - Nest humidity to trigger switch with dehumidifier

I have a dehumidifier plugged into a Aeon smart switch, the humidity readings on dehumidifier are crap and boucne all over the place, so i want to trigger it based off the humidity readings from my Nest, and may later independent humidity sensor.

I’ve never done an automation before. Looking at the tutorial, I think I can get started, but want to make sure of the logic.

Essentially I want the dehumidifier to run if the nest reports Humidity over 55% and keep it running unto nest is reporting ~46%

So I’m thinking something like this:

automation: trigger: platform: numeric_state entity_id: sensor.nest_humidity above: 46 below: 55 condition: use_trigger_values action: service: switch.turn_off entity_id: switch.dehumidifier_power

Assuming this works, the flaw I see is that the switch would power back on if humidity registers below 46? is that true? any advice on how to do this properly?

I also might want to add in a time constraint to not have the dehumidifier run at all when we are at work, and then turn on the conditions an hour or so before we would get home to prepare the environment.

thanks.

Your on the right track.
The second part could be done with a or condition and checking the time.

I gave it a go. I didn’t get any errors but it did not trigger despite conditions being met. (humidity > 56)

I’m thinking i need to use an if / else statement. would that be done with value templates as the condition?

logic being:

if sensor.nest_humidity >= 56 then switch.dehumidifier_power switch.turn_on

else

if sensor.nest_humidity <= 46 then switch.dehumidifier_power switch.turn_off

any assistance with creating this condition appreciated.

does the humidity value returned from the nest api contain a % that needs to be removed in the condition template?

I’ll have a look asap I’m at a instance of HA that I can experiment with.

Any luck with testing this out? I’m hoping to spend some time trying to figure it out today.

Honestly I got a bit sidetracked. I’ll do my best to look at it after work. In the mean time share it in the gitter chat and see if they someone there that can help.

I got this to run without any errors in the logs:

automation 1:
  trigger:
    platform: numeric_state
    entity_id: sensor.nest_humidity
    value_template: '{{ states.sensor.nest_humidity.state }}'
    above: 55
  condition: use_trigger_values
  action:
    service: switch.turn_on
    entity_id: switch.dehumidifier_power

automation 2:
  trigger:
    platform: numeric_state
    entity_id: sensor.nest_humidity
    value_template: '{{ states.sensor.nest_humidity.state }}'
    below: 47
  condition: use_trigger_values
  action:
    service: switch.turn_off
    entity_id: switch.dehumidifier_power

but in practice, it didn’t run, dehumidifier was running, humidity dropped to 45% and the automation did not trigger and turn off the switch.

Could you use a different sensor to measure humidity? I use several z-wave sensors around the house that provide humidity.

I just got a couple new ones in, that I need to get my network. the nest was what I had initially.

I’v had pretty good success using the sensor to turn on the Nest thermostat when it measures too hot in a different part of the house that the nest is located.

Why the condition? Have you tried it without that?

I guess I thought it was required. I’ll give it ago with out.

Nope. In fact I’ve never had much luck with use_trigger_values as a condition for some reason.

thanks. I just made the change, and it looks like my leaky house’s humidity is creeping back up, so we’ll see if it works.

I set up my new sensor last night, and pointed the automation to use it instead of the nest, and it seems to be working. It triggered to turn on and off as set. thank you for all the assistance.

I’m assuming something is off with the value_template for the nest, even though in the template editor it returns the relative humidity level as a number.

1 Like

Haven’t tested it well, and maybe this is no longer relevant, but here’s my attempt at the same problem.
I used an interval as my trigger. The thing I am missing is the ability to see if the HVAC is actually running. I would like to add that condition in (HVAC is ON), but I don’t the running state of the HVAC being exposed via the CT100 Z-wave device.

# Turns on the whole house humidifier if the central air is on heat and the indoor humidity drops below 45%
# Turning it off after 29 minutes enables the drum to rotate in the opposite direction on the subsequent startup
# and avoids having to create another automation to turn off the humidifier.
alias: 'Interval 30 Minutes - Heat and Dry - Run Humidifier for 29 Minutes'

trigger:
  - platform: time
    minutes: '/30'
    seconds: 0

condition:
  - condition: and
    conditions:
      - condition: state
        entity_id: climate.2gig_technologies_ct100_thermostat_usa_cooling_1_23
        state: 'Heat'
      - condition: numeric_state
        entity_id: sensor.2gig_technologies_ct100_thermostat_usa_relative_humidity_23_3
        below: 45

action:
   - service: switch.turn_on
     entity_id: switch.ge_45603_plugin_appliance_module_switch_14
   - delay: 0:29
   - service: switch.turn_off
     entity_id: switch.ge_45603_plugin_appliance_module_switch_14