Hey guys,
I’m trying to convert most of my config from separate sensors/automations/switches folders to a more appropriate ‘packages’ system. So I am only using parts of my ‘proven to work’ configurations. Setting up my sensors, input booleans, customizations, etc in the package folder is working fine. But every time I also try to include some automations in the package file Home Assistant goes bonkers! When I run the automations seperate in their normal ‘automations folder’, everything works as expected.
Error:
2017-08-17 23:26:15 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: required key not provided @ data['action']. Got None required key not provided @ data['trigger']. Got None. (See ?, line ?). Please check the docs at https://home-assistant.io/components/automation/
My package file named ‘button_slaapkamer.yaml’ looks like this:
And again, when I exclude the automations from the file everything works as expected!
#------------------------------------------------------------------------------
# Fibaro The Button slaapkamer
# @NickSchaepkens
# Original Repo : https://github.com/NickSchaepkens
#------------------------------------------------------------------------------
##############################
##### Instructies #####
##############################
# Bij het aanmaken van een nieuwe entity in dit bestand:
# - vervangen button_X door button_Y
# - friendly names aanpassen
# Customize
#------------------------------------------------------------------------------
homeassistant:
customize:
binary_sensor.button_slaapkamer_1:
icon: mdi:circle
friendly_name: Button slaapkamer 1x
binary_sensor.button_slaapkamer_2:
icon: mdi:circle
friendly_name: Button slaapkamer 2x
binary_sensor.button_slaapkamer_3:
icon: mdi:circle
friendly_name: Button slaapkamer 3x
# Input booleans
#------------------------------------------------------------------------------
input_boolean:
button_slaapkamer_1:
initial: off
button_slaapkamer_2:
initial: off
button_slaapkamer_3:
initial: off
# Binary sensors
#------------------------------------------------------------------------------
binary_sensor:
- platform: template
sensors:
button_slaapkamer_1:
entity_id:
- input_boolean.button_slaapkamer_1
value_template: "{{ states.input_boolean.button_slaapkamer_1.state == 'on' }}"
button_slaapkamer_2:
entity_id:
- input_boolean.button_slaapkamer_2
value_template: "{{ states.input_boolean.button_slaapkamer_2.state == 'on' }}"
button_slaapkamer_3:
entity_id:
- input_boolean.button_slaapkamer_3
value_template: "{{ states.input_boolean.button_slaapkamer_3.state == 'on' }}"
# Automations
#------------------------------------------------------------------------------
automation:
- alias: button_slaapkamer_1
trigger:
- platform: event
event_type: zwave.node_event
event_data:
entity_id: zwave.button_slaapkamer
basic_level: 1
action:
- service: homeassistant.turn_on
entity_id: input_boolean.button_slaapkamer_1
- delay: '00:00:01'
- service: homeassistant.turn_off
entity_id: input_boolean.button_slaapkamer_1
- alias: button_slaapkamer_2
trigger:
- platform: event
event_type: zwave.node_event
event_data:
entity_id: zwave.button_slaapkamer
basic_level: 2
action:
- service: homeassistant.turn_on
entity_id: input_boolean.button_slaapkamer_2
- delay: '00:00:01'
- service: homeassistant.turn_off
entity_id: input_boolean.button_slaapkamer_2
- alias: button_slaapkamer_3
trigger:
- platform: event
event_type: zwave.node_event
event_data:
entity_id: zwave.button_slaapkamer
basic_level: 3
action:
- service: homeassistant.turn_on
entity_id: input_boolean.button_slaapkamer_3
- delay: '00:00:01'
- service: homeassistant.turn_off
entity_id: input_boolean.button_slaapkamer_3
What am I doing wrong here?!