Setting brightness with automations

Hello,

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

Thank you!

It’s data for the service light.turn_on.

Try:

- 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
2 Likes

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

What am I doing wrong?

You could attempt to change the second part of the automation to use “data” in a similar manner to the first one as “entity_id” is service data.

1 Like

I don’t believe the error message is referring to the two automations you posted.

Here’s the error message:

Invalid config for [automation]: Entity ID all is an invalid entity id for dictionary value @ data[‘condition’][0][‘entity_id’]. Got None.

It refers to an entity_id named all in a condition. The automations you posted don’t have conditions.

Somewhere you have an automation with a State Condition. Find that automation and review its condition.

1 Like

This error does not relate to the automation you are showing.

1 Like

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.