HA Automation yaml error

So I’ve started playing and have created a few automation.
Using Ha I created an automation. When I looked in the automatiom.yalm file I found it created some errors. It doesn’t seem to like - brightness_pct: .

id: '15____________85'
  alias: FrontYardMotion
  description: ''
  trigger:
  - device_id: 5fe_____________74a
    domain: binary_sensor
    entity_id: binary_sensor.hue_outdoor_motion_sensor_1_motion
    for:
      hours: 0
      minutes: 0
      seconds: 2
    platform: device
    type: motion
  condition:
  - after: sunset
    before: sunrise
    condition: sun
  action:
  - brightness_pct: 100
    device_id: a501______________________4
    domain: light
    entity_id: light.frontyardpole
    type: turn_on
  - delay: 00:05:00
  - brightness_pct: 60
    device_id: a501____________________04
    domain: light
    entity_id: light.frontyardpole
    type: turn_on

brightness_pct was deprecated a long time ago… just convert (check the entity state in dev tools to see what brightness it sets) them to brightness.

Looks like HA need to be updated as to not use a deprecated command. :slight_smile:

Thanks, I’ll go check it out.

Yeah it’s still a valid attribute - you just can’t use it in scenes, automations anymore.
If you set it it gets converted.


So the brightness value is 0-255 so it’s easy to just check the state once you set it by brightness_pct to see what the brightness value should be for your automation. Or just use a calculator…

Can someone point me to where brightness_pct was reported to be deprecated for use in automations?

The documentation for the light integration lists four ways to set brightness:

  • brightness
  • brightness_pct
  • brightness_step
  • brightness_step_pct
1 Like

It’s a valid attribute but can’t be used in automations anymore (or maybe it was scenes???) Anyway, I converted all of mine ages ago to use brightness because somewhere it stopped working. I seem to almost recall I changed my automations because it stopped working in scenes… pre-emptive action by me.
From the screenshot, you can see it doesn’t show the brightness_pct - it will convert that to brightness attribute anyway so best to use that. Also the OP is getting an error…

I use brightness_pct in a lot of my automations and it works fine.

1 Like

You won’t find deprecation notes for it. It technically was deprecated for scenes, but the real deprecation was that scenes only accept attributes that are stored on lights. All the things you listed are still available for automations/scripts/services.

1 Like

I can understand the limitation for scenes given that ever since scenes were revised, (possibly when the Scene Editor was introduced in 0.102?) they only handle states (with the exception of transition which was added in 0.109).

I searched through the release notes of the last few releases and found this in 0.106’s notes:

Light - It is no longer allowed to pass both brightness and brightness_pct to light.turn_on service. Previously passing both would have used brightness_pct . - (@balloob - #31452) (light docs)

Basically, that means you can specify either of the two but not both. Other than that, I couldn’t find anything that deprecates the use of brightness_pct in automations.