Now that I have my alarm data showing up in HASS, I’m trying to get something set up so that when the alarm is armed ‘Away’, it triggers a scene to turn off specified lights and devices that don’t need to be on when no one’s home (I’m sure everyone has left something on that didn’t need to be on when they went away or to work at one point or another).
Through some trial and error and using the config checker, I arrived at this automation that the config checker said was valid:
#- alias: 'Alarm Arm Away Turn off Lights'
# trigger:
# condition: state
# entity_id: alarm_control_panel.home_alarm
# from: 'pending'
# to: 'Arm Away'
# action:
# service: scene.turn_on
# entity_id: scene.armed_away_lights
This should trigger this scene (found in my scenes.yaml):
- name: armed_away_lights
entities:
light.leviton_dz6hd1bz_decora_600w_smart_dimmer_level_55_0:
state: off
This one light I put in for testing - most likely, I’d set up a group of devices I wanted to be turned off upon arming it away once I actually get it working.
But when I restarted HA, it crashed all over itself and the following was in the home-assistant.log file:
2017-10-10 19:32:18 ERROR (Thread-2) [homeassistant.util.yaml] mapping values are not allowed here
in "/home/homeassistant/.homeassistant/automation_old.yaml", line 237, column 15
2017-10-10 19:32:18 ERROR (MainThread) [homeassistant.bootstrap] Error loading /home/homeassistant/.homeassistant/configuration.yaml: mapping values are not allowed here
in "/home/homeassistant/.homeassistant/automation_old.yaml", line 237, column 15
Line 237 is ‘entity_id: alarm_control_panel.home_alarm’
Based on my other automatons, it ‘looks’ right, but there’s obviously something about it that’s not playing nice - perhaps the condition ‘state’ doesn’t like the entity ‘alarm_control_panel.home_alarm’?