Hi, I want to control lights and volume with sliders, not + and - buttons. I tried to create input_number entities, and make automations for updating each way, but this approach has several drawbacks:
Quite a lot of code is required, and worse, must be duplicated (if I haven’t missed a good way of making generic automations)
I suspect loops might occur - slider is changed -> value is changed (and different values might be reported during the transition) -> slider is updated -> new value command is sent -> slider is changed
Is it possible somehow to just map a slider to an attribute?
Thank you! I have a similar automation, but another automation is required in addition in order to update the slider when the brightness or volume is changed elsewhere. What I am really looking for, is a simpler way without having to create an input number and two automations for each of several tens of lights and a handful of media_players
Thanks a lot again Unfortunately, what I really want is to have unique sliders for each light or media_player, and also to solve the looping problem, without having to write kilobytes of code. I am beginning to see the challenge, though - changing the value of a given attribute usually (?) requires calling some service, so there must be a somewhat complex mapping. Alternatively, light widgets could support a slider directly.
the widget light_with_brightness gives you a on off switch where you can set brigthness with a slider.
for mediaplayer volume that isnt there, but its possible to create a custom widget based on the mediaplayer widget.
but you need to program in javascript for that.
edit: or you can create a small appdaemon app that set the volume for media players by changing a slider