I have an automation that turns on a space heater every time my Nest thermostat stops heating but only if the temperature in the room reported by a sensor is below 71.
- alias: 'Space Heater ON if Nest STOPS Heating'
initial_state: on
trigger:
- platform: state
entity_id: sensor.nest_thermostat_hvac_state
from: 'heating'
to: 'off'
condition:
condition: and
conditions:
- condition: time
after: '07:00:00'
before: '21:30:00'
- condition: state
entity_id: input_boolean.heater
state: 'off'
- condition: numeric_state
entity_id: sensor.home_living_room_temperature
below: 71
- condition: or
conditions:
- condition: state
entity_id: device_tracker.iphone1
state: 'home'
- condition: state
entity_id: device_tracker.iphone2
state: 'home'
- condition: state
entity_id: alarm_control_panel.home
state: 'disarmed'
action:
- service: input_boolean.turn_on
entity_id: input_boolean.heater
But it fails. Right now it turned on even though the temperature reported by the sensor is 72.
Where am I going wrong?