Update an Input Slider when light's brightness changed with other scene/script?

I just started (trying to) use Input Sliders to change the brightness of some lights.
I’ve noticed when I changed the light’s brightness from somewhere else in HA (scene, script etc.) the slider doesn’t update to show the light’s current brightness.

Is there an easy way to do this?
Or if I turn on a scene or script that changes the brightness of the light could that scene/script ‘tell the input slider’ to update with the brightness that the scene/script is just set?

You can do the latter option, and set the input slider via the script.

I use input_selects for mine (I have a card with the light on, and an input select beneath for the scenes), and they reset to ‘select’ when the light is switched off.

I have other situations where input slider’s are updated. This is for my ‘alarm clock’ packages, where there is a separate alarm clock in three rooms which swittches the light on at the time selected on the input sliders. I then have a ‘master panel’ where I can set all 3 rooms at the same time.

Code for all of this is on my github. (link in my profile)

Thanks!

I’ve taken a look and seen ones where input_select is your trigger, but haven’t seen where something like a scene or script that when triggered changes an input_slider’s value.

Could you point me to where I should be looking in your files? :slight_smile:

Link removed

It’s part of the “all alarm clock”, set the input sliders, activate that script and it sets the input sliders on the three room alarm clocks.

Hope this helps.

Great, thanks.

Now I’m just having trouble moving the slider when I run the script. The script’s supposed to turn on a scene that sets the landing light brightness to 100% (255), and move the slider to the far right.

Here’s a couple I tried

landing_light_with_slider:
  alias: "Landing Light 100%"
  sequence:
    - service: scene.turn_on
      entity_id: scene.landing_light_100
    - service: input_slider.landing_light_brightness
      data_template:
        entity_id:
          - input_slider.landing_light_brightness
        value: '{{states.input_slider.landing_light_brightness.state | float}}'


landing_light_with_slider:
  alias: "Landing Light 100%"
  sequence:
    - service: scene.turn_on
      entity_id: scene.landing_light_100
    - service: input_slider.landing_light_brightness
      data_template:
        entity_id:
          - input_slider.landing_light_brightness
        value: 255

Any idea on how I should set the slider value in relation to the brightness I’ve set?

…actually ignore that. I realised where I put

- service: input_slider.landing_light_brightness

should be

- service: input_slider.select_value


So this works:
landing_light_with_slider:
  alias: "Landing Light 100%"
  sequence:
    - service: scene.turn_on
      entity_id: scene.landing_light_100
    - service: input_slider.select_value
      data_template:
        entity_id:
          - input_slider.landing_light_brightness
        value: 255

Thanks again for the help!
1 Like

The second version is what you want but you need to remove the ‘date_template’ and replace with ‘data’ as it’s not a template :slight_smile: or you can leave data_template and use’ value: {{255|float}}’

1 Like

Thanks, I tried this below (a little cleaner) and that works too :slight_smile:

landing_light_with_slider_2:
  alias: "Landing Light 100% v2"
  sequence:
    - service: scene.turn_on
      entity_id: scene.landing_light_100
    - service: input_slider.select_value
      entity_id: input_slider.landing_light_brightness
      data:
        value: 255
1 Like