I am trying to set-up an automation to automatically turn my lights on when my sensors are seeing movement. Sone lights are not very bright and are probably turned on with 1% brightess. I’ve got it done using the yaml script down shown down below in my automations.yaml file. Unfortunately it tells me there is an error.
Logger: homeassistant.config
Source: config.py:416
First occurred: 4:09:03 AM (3 occurrences)
Last logged: 4:09:03 AM
Invalid config for [automation]: [data] is an invalid option for [automation]. Check: automation->data. (See /config/configuration.yaml, line 13).
Invalid config for [automation]: Entity ID all is an invalid entity id for dictionary value @ data[‘condition’][0][‘entity_id’]. Got None. (See /config/configuration.yaml, line 13).
Could someone tell me why this is getting an error?
Best regards,
# Automatisering Hal
- alias: Hal lamp aan bij beweging
trigger:
platform: state
entity_id: binary_sensor.hue_motion_sensor_hal_motion
to: "on"
action:
service: light.turn_on
entity_id: light.hue_hal_lamp
data:
brightness_pct: 100
- alias: Hal lamp uit bij geen beweging voor 5 minuten
trigger:
platform: state
entity_id: binary_sensor.hue_motion_sensor_hal_motion
to: "off"
for:
minutes: 5
action:
service: light.turn_off
entity_id: light.hue_hal_lamp
- alias: Hal lamp aan bij beweging
trigger:
platform: state
entity_id: binary_sensor.hue_motion_sensor_hal_motion
to: "on"
action:
service: light.turn_on
data:
entity_id: light.hue_hal_lamp
brightness_pct: 100
Thank you for your first reply. I’ve changed the configuration file to what you’ve said, but it seems that it still tells me the same error:
Logger: homeassistant.config
Source: config.py:416
First occurred: 4:30:09 AM (2 occurrences)
Last logged: 4:30:09 AM
Invalid config for [automation]: Entity ID all is an invalid entity id for dictionary value @ data[‘condition’][0][‘entity_id’]. Got None. (See /config/configuration.yaml, line 13).
Down below is my full configuration of my first automation. It turns on the lights when the sensor sees something. It turns of the lights after not seeing anything for 5 minutes.
# Automatisering Hal
- alias: Hal lamp aan bij beweging
trigger:
platform: state
entity_id: binary_sensor.hue_motion_sensor_hal_motion
to: "on"
action:
service: light.turn_on
data:
entity_id: light.hue_hal_lamp
brightness_pct: 100
- alias: Hal lamp uit bij geen beweging voor 5 minuten
trigger:
platform: state
entity_id: binary_sensor.hue_motion_sensor_hal_motion
to: "off"
for:
minutes: 5
action:
service: light.turn_off
entity_id: light.hue_hal_lamp
I’m sorry all, I feel so stupid.
I used an automation using a condition to turn on the lights when the sun is going down. I thought the error mentioned line 13 somewhere so I got confused. Thanks for helping me out everyone.