Catt00
(Peter)
March 9, 2018, 8:38pm
1
Im trying to turn off all my light with a switch, but it says invalid config.
What can I do, still fresh on it.
esting configuration at /home/homeassistant/.homeassistant
ERROR:homeassistant.util.yaml:YAML file /home/homeassistant/.homeassistant/automations.yaml contains duplicate key “service”. Check lines 176 and 183.
ERROR:homeassistant.util.yaml:YAML file /home/homeassistant/.homeassistant/automations.yaml contains duplicate key “entity_id”. Check lines 177 and 184.
- alias: Knappen
trigger:
platform: event
event_type: click
event_data:
entity_id: binary_sensor.switch_158d0002007994
click_type: single
action:
service: homeassistant.turn_off
entity_id:
- input_boolean.permanent_light_phase
- group.tvrum_lampor
- light.kokso
- light.hall_taklampa
- light.hallway_ledstrip
service: switch.turn_on
entity_id:
- input_boolean.natt_switch
m0wlheld
(Christoph Dahlen)
March 9, 2018, 8:48pm
2
Check indentation, YAML is very picky about. And use arrays, when more than one trigger, condition or action service is defined. I recommend doing this in general:
- alias: Knappen
trigger:
- platform: event
event_type: click
event_data:
entity_id: binary_sensor.switch_158d0002007994
click_type: single
action:
- service: homeassistant.turn_off
entity_id:
- input_boolean.permanent_light_phase
- group.tvrum_lampor
- light.kokso
- light.hall_taklampa
- light.hallway_ledstrip
- service: switch.turn_on
entity_id:
- input_boolean.natt_switch
1 Like
Yup, like m0wlheld said. Sample of one of my automations with more than one action.
- alias: Turn on driveway floodlight when there is movement
trigger:
- platform: state
entity_id: binary_sensor.drivewaypir
to: 'on'
condition:
- condition: state
entity_id: sun.sun
state: 'below_horizon'
action:
- service: homeassistant.turn_on
entity_id: script.timed_driveway
- service: light.turn_on
entity_id:
- light.orb_light
data:
brightness: 250
rgb_color: [255, 255, 0]
flash: long
Catt00
(Peter)
March 10, 2018, 8:36am
4
Thanks. Just forgot how it should be. Now I will try to remember it.