Raspberry Pi 3
Home Assistant All In One Installer
Aeotec Z-Stick Gen5
Hi All,
I am attempting to setup my configuration files in a distributed approach from the beginning but I am encounter errors in home-assistant.log. The error I have received in the log file is:
2017-12-02 04:11:48 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: [automation] is an invalid option for [automation]. Check: automation->automation. (See /home/homeassistant/.homeassistant/configuration.yaml, line 15). Please check the docs at https://home-assistant.io/components/automation/
I have checked the docs many times for how to reference files to correctly implement the distributed approach, but I’m at a loss for where my mistake is located.
Below is a portion of my configuration.yaml file as well as the automation.yaml file.
Configuration.yaml
homeassistant:
# Name of the location where Home Assistant is running
name: Home
# Location required to calculate the time the sun rises and sets
latitude: XX.XXXXX
longitude: XX.XXXX
# Impacts weather/sunrise data (altitude above sea level in meters)
elevation: 351
# metric for Metric, imperial for Imperial
unit_system: imperial
# Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
time_zone: America/New_York
customize: !include customize.yaml
group: !include groups.yaml
automation: !include automation.yaml
script: !include scripts.yaml
Automation.yaml
automation:
- alias: "Christmas ligh ts turn on at sunset and turn off five hours later."
trigger:
platform: sun
event: sunset
action:
service: switch.turn_on
entity_id: sensor.aeotec_zw096_smart_switch_6_power
- alias: "Turn off Christmas lights after five hours."
trigger:
platform: state
entity_id: sensor.aeotec_zw096_smart_switch_6_power
to: 'off'
for:
hours: 5
action:
service: switch.turn_off
entity_id: sensor.aeotec_zw096_smart_switch_6_power
The only error I am finding through yaml linter in Atom is an unknown tag error on the line customize: !include.yaml
but there isn’t an error in the log file and the information included in the customize file is updated correctly in the frontend of the HA UI (e.g. changing a sensor to a friendly name).
I would check for extra spaces at the ends of your groups or automation include lines… also I don’t know if it matters but mine is automationS.yaml maybe the pluralization matters?
Thanks for the suggestions. I looked through the YAML and didn’t find and spaces. In addition, I put it through the YAMLlint.com website as well to ensure the syntax is accurate.
I don’t believe the file name is important, but that it is referenced correctly. I have tried playing around this both and that wasn’t the issue. In addition, I have seen it done both ways in some the github accounts that have made their config available.
I believe he is referring to the first line in the code you posted “automation:” Your automations.yaml needs no such heading it just starts with first trigger action etc
In your automation.yaml file remove the first line that says “automation:”. That is not necessary since that reference is aleady included in the configuration.yaml file.
Your trigger for the off automation is when it is “off” for 5 hours so unless you turn it off it will never start that 5 hour timer… you could make it sunset and off-set it +5 hours if that’s what you want vs just a specific time at night. You could also just change that off to on