I am really struggling with getting an automation to trigger for turning a relay off when a target humidity and temperature are reached. Essentially I want to turn off the relay when a temperature AND relative humidity are in a certain range.
In the most basic case I have the following in the states under developer tools:
{{ states.sensor.liberty_hill_humidity_in.state }}
34
{{ states.sensor.liberty_hill_temp.state }}
24.6
{{ states.sensor.liberty_hill_humidity_in }}
<template TemplateState(<state sensor.liberty_hill_humidity_in=34; unit_of_measurement=%, friendly_name=Main Floor RH, device_class=humidity @ 2021-02-21T08:59:51.097616-05:00>)>
{{ states.sensor.liberty_hill_temp }}
<template TemplateState(<state sensor.liberty_hill_temp=25.2; unit_of_measurement=°F, friendly_name=Outside Temp., device_class=temperature @ 2021-02-21T10:16:52.888312-05:00>)>
My automation is currently stripped down to:
trigger:
- platform: time_pattern
minutes: /1
condition:
- condition: device
type: is_on
device_id: 0bc7fc57176e25715459e733d2f31b89
entity_id: switch.flush_1d_relay_current_value_2
domain: switch
- condition: numeric_state
entity_id: sensor.liberty_hill_temp
value_template: '{{ float(states.sensor.liberty_hill_temp.state) }}'
above: '20'
below: '50'
- condition: numeric_state
entity_id: sensor.liberty_hill_humidity_in
above: '35'
below: '40'
value_template: '{{ float(states.sensor.liberty_hill_humidity_in.state) }}'
action:
- type: turn_off
device_id: 0bc7fc57176e25715459e733d2f31b89
entity_id: switch.flush_1d_relay_current_value_2
domain: switch
It never triggers and when I manually execute it always shuts off the relay even though not all conditions are met. This is driving me crazy at the moment and am not sure how to go about fixing it.
Thank you in advance!