Help with Nest humidity automation

Hi all,

Hope I’m posting this in the correct place.

I’ve got 2 Nest thermostats (Gen 2 and Gen 3), and I want to use the humidity sensor on it to give me a telegram alert when the humidity is over a certain value.

The telegram bot works for other scripts/automations, so I think that’s fine. The thermostats are providing their humidity information too.

I spent some time looking at another thread for some help, and it got me closer, but still not quite all the way.

My automation looks like this so far, its still a WiP for testing at the moment:

- id: '1560871514053'
  alias: humidity - too high
  trigger:
  - above: '50'
    entity_id: sensor.downstairs_thermostat_floor_humidity
    platform: numeric_state
    value_template: '{{states.sensor.downstairs_thermostat_floor_humidity.state | int }}'
  condition: []
  action:
  - data:
      message: The house is too humid!
    service: telegram_bot.send_message

Which, if I’m reading it correctly, should get the thermostat to return an integer. However, it doesn’t seem to actually work.

Any ideas would be much appreciated, hoping it’s a simple mistake I’ve made!

Remove the entire line containing value_template.

Thanks for the reply.

I did try it without that line included, but it didn’t work. Five minutes ago however, I got a Telegram notification! It seems to have worked.
Perhaps it only triggers once the reading moves above 50, rather than is already above 50. Does that sound logical?

Correct. It triggers when humidity rises and crosses the threshold of 50. Any further increase beyond the threshold won’t trigger the automation. Humidity must fall below 50 then rise above it in order to trigger the automation again.

If humidity was already above the threshold when you started testing the automation, that would explain why it didn’t trigger.

In any case, that value_template serves no purpose.

Thanks for the reply, good to know a bit more about how it works!