Control brightness of a dimmer switch? (KASA)

I have a Kasa 3-way dimmer switch. All the rest of their switches - single pole, single pole dimmer, three way - they all work great. But this 3-way dimmer… Less than rock solid.

In any event, if the brightness is at max level, the lights won’t turn off from the “remote” switch. So, I’d like some kind of automation that fires when the lights are turned on, as well as when the brightness is adjusted, so that the brightness can never be above 85%.

I cannot seem to figure out how to do this. Can anyone help? Even if it involves Node Red (I’d need some pretty specific instructions for that though, since I have no Node Red automations yet)…

Thanks in advance!!

trigger:
  - platform: numeric_state
    entity_id: light.your_light
    attribute: brightness_pct
    above: 85
action:
   - service: light.turn_on
     target:
       entity_id: light.your_light
     data:
       brightness_pct: 85
1 Like

Thank you! That ended up not being QUIT the solution, but you pointed me in the right direction. I had to adjust the raw brightness value instead of trying to use the percent.

Any idea why this syntax works in Automations but not in Scripts? I’m looking for the most direct solution to set a dummer’s brightness_pct value.

- service: light.turn_on
  target:
    entity_id: light.your_light
  data:
    brightness_pct: 85

I get a

" Invalid action

Unable to determine action @ data[0]" when trying to run in a sctipt

Thanks!

EDIT: This syntax worked:

- service: light.turn_on
    data:
      brightness_pct: 85
    target:
      entity_id: light.your_light

Automations are just scripts with triggers. If it works for one it should work for the other.

That is not valid. See the examples at the bottom of this page: https://www.home-assistant.io/integrations/light/

1 Like

How did you do that? I have a z-wave dimmer switch and don’t see a “raw brightness” property.