Input Slider Updates

Hello, I can’t for the life of me figure out how to get an input_slider to stay updated with the light itself.

The slide works perfect to control the lights, but if I were to shut the light off, it remains in it’s position.

Any ideas? This is what I have so far

input_slide.yaml:

kitchen_brightness_slider:
  name: Kitchen Light Brightness
  icon: mdi:lightbulb
  min: 0
  max: 254
  step: 1

automation.yaml:

- alias: Kitchen Light - Adjust Brightness
  trigger:
    platform: state
    entity_id: input_slider.kitchen_brightness_slider
  action:
    - service: light.turn_on
      data_template:
        entity_id: light.ge_12724_3way_dimmer_switch_level_5_0
        brightness: '{{ trigger.to_state.state | int }}'

- alias: Set Kitchen Slider
  trigger:
    platform: state
    entity_id: input_slider.kitchen_brightness_slider
  action:
    - service: input_slider.select_value
      data_template:
        entity_id: input_slider.kitchen_brightness_slider
        value: '{{ states.light.ge_12724_3way_dimmer_switch_level_5_0.attributes.brightness }}'

The reason for this is to use the input slider since the toggle for a dimmer hides the brightness slider when it’s off, so in order to dim the light, you must turn the light on and then dim.

Thanks!

1 Like

I know it’s two months later but did you ever figure this out?

No I didn’t, I actually stopped messing with it after an HA update that introduced a slider for dimmers that behaves very similar to what I was hoping to achieve

1 Like

You’d just need to set the value of the slider to the current brightness setting during an off light event.

Can you share where you found the dimmer slider information?

I know old thread, can you elaborate on this statement? I am trying to figure out how to update a slider if for example someone dims a light via alexa command…