I have an ‘away’ automation that turns the thermostat off when I leave. I want it to store the mode the thermostat was in (heat, cool, etc) so that when I return, it can set it back to that mode. I currently have the following:
configuration.yaml:
input_select: !include input_select.yaml
input_select.yaml:
prior_nest_mode:
initial: na
name: Prior Mode
options:
- na
- off
- heat
- cool
- auto
- eco
And the in my away automation I have:
- alias: Away
trigger:
- platform: state
entity_id: device_tracker.redacted
from: 'home'
to: 'not_home'
- platform: zone
event: leave
zone: zone.home
entity_id: device_tracker.redacted
condition:
condition: and
conditions:
- condition: state
entity_id: device_tracker.redacted
state: not_home
- condition: state
entity_id: input_boolean.doug_home
state: 'on'
- condition: zone
entity_id: device_tracker.redacted
zone: zone.not_home
action:
- service: alarm_control_panel.alarm_arm_away
entity_id: alarm_control_panel.redacted_home
- service: media_player.turn_off
entity_id:
- media_player.everywhere
- media_player.bathroom
- media_player.bedroom
- media_player.livingroom
- service: input_select.select_option
data_template:
entity_id: input_select.prior_nest_mode
option: {{ states('climate.living_room') }}
- service: nest.set_operation_mode
data:
operation_mode: 'eco'
- service: nest.set_away_mode
data:
away_mode: 'away'
- service: input_boolean.turn_off
data:
entity_id: input_boolean.doug_home
- service: shell_command.pushover
data:
msg: 'The apartment has been set to AWAY MODE'
Running hassio homeassistant check
returns:
ERROR:homeassistant.util.yaml:invalid key: "OrderedDict([("states('climate.living_room')", None)])"
in "/config/automations/away.yaml", line 35, column 0
Failed config
General Errors:
- Error loading /config/configuration.yaml: invalid key: "OrderedDict([("states('climate.living_room')", None)])"
in "/config/automations/away.yaml", line 35, column 0
Successful config (partial)
But it all looks sane to me? Why can’t it use the state as the selector value? Thanks