Restrict dimmable light minimum brightness to 10%

Hi, Home Assistant newbie here.

When I use the dimmer at home, I sometimes accidentally set the brightness to the lowest instead of turn it off. What I want is an automation that will adjust brightness back to 10% when it’s lower than a threshold.

So I have an automation like this:

- id: '1577165608021'
  alias: Restrict Dimmable light to 10% minimum
  description: ''
  trigger:
  - below: '128'
    entity_id: light.dining_room_ceiling_light
    platform: numeric_state
    value_template: '{% if states.light.dining_room_ceiling_light.state == "on"  %}{{
      states.light.dining_room_ceiling_light.attributes.brightness }}{% else %}0{%
      endif %}'
  condition: []
  action:
  - data:
      brightness_pct: 10
    entity_id: light.dining_room_ceiling_light
    service: light.turn_on

This solution seems to have some problem:

  1. When I decrease brightness from 100% down to the minimum, the automation is correctly triggered and brightness set to 10%.
  2. At this time, when I try to decrease brightness to the minimum again, the automation is NOT triggered, and the light stay at minimum brightness.

Did I miss anything? Thank you!

Do you not get any errors in your log? The value_template in your trigger is never evaluated, your automation will trigger only when the brightness goes below 128, if it is already below 128 it will only trigger again when the brightness goes above 128 and then again below 128. Try below: 10, remove the value template and add a condition to only trigger if the light is already on.

1 Like

What dimmers do you have ?
Mine have a parameter setting for minimum brightness

I was hoping to find such setting on my jasco dimmer. Unfortunately it just has some dim steps and rates, but no min. I could cheat and use steps to ‘pseudo enforce’ min, but the slider and choice of steps makes a flickering set of lights still possible. I fixed it with a nodered automation that changes any value under min to 0.