Show a dimmable lamp as both a switch and slider in sitemap?

So this sort of works

Frame label="Nightstand" {
      Switch item=NightstandDimmer_LightLevel label="Lamp" icon="light"
      Slider item=NightstandDimmer_LightLevel label="Dim"
 }

Is there a better way?

If the channel supports both ways (hence, this approach works), I think this is acceptable :slight_smile: whatever works, right? Does the switch get’s updated with the slider? 0 means OFF and vice versa?

I would ask though, why do you need a switch if you have a slider? slider is super simple to interact with.

Other option is to use proxy elements, where you have a switch and a rule that changes the dimmer value based on the switch.

I personally recommend people to not control items directly but go with scenes (e.g. bright, comfy, romantic, study, relax, off, auto (where auto depends on the time of day for example). I found this easier to handle if your lights get more complex, like, light temperature depending on the day, brightness depending on the lightning around the lamp (sunshine vs rain), and other things, like rollershutters and motion sensors are involved. When this all is part of your “automation”, you don’t really “switch” on or off but between scenes. But this is just a sidenote, not a solution to your problem.

Yup, both switch and slider works and when one is actuated, the other updates appropriately.

Except when I want to control brightness or dimness, I find the sliders annoying. I like having the option to use either. I just thought it was verbose and goofy.

I thought there might be a way in defining a Group item or something like that.

My Lutron dimmers display as both a Slider and a Switch in Paper UI. I wanted that in my iOS app

You could use visibility to hide the slider whenever the lamp is off if you want your sitemap to be a little cleaner.

3 Likes