Simple Example needed: Switch and Slider for Dimmer

Good evening,

a short question: Some of you managed to assign both a switch and a slider to a dimmer. I own some Tradfri bulbs that are dimmable, but it would be great to have a switch on the UI as well to quickly switch on and off.

It basically works in my Firefox browser, but the two only show a consistent status after a manual page refresh.

Frame label="Trafri" 
    {
        Slider item=Night_Light_Brightness_Tobias label="Helligkeit"
        Switch item=Night_Light_Brightness_Tobias label="An/Aus"
    } 

It owuld be beautiful if this would work instantly just like in PaperUI. Is there a simple way to get a synchronous behaviour?

Thanks,
Tobias

Hi Tobias,
you should use both channels of your TRADFRI bulbs. There is one channel for brightness (=dimmer) and one channel for power. I made the same mistake as you and turned off my TRADFRI bulbs by dimming down to 0. Trust me it’s faster and more consistent to switch them off through the power channel.

Please note that if you turn off a bulb it’s brightness setting will remain and might confuse you at times. It did for me and therefore I chose to change the labelcolor of the Slider item if the light was off in my sitemap. If a light is off the label of the corresponding dimmer will be in red to let me know that the dimmer setting is currently ineffective. Looks roughly like this:

Slider item=tradfri_wz_1_dimmer label=“Helligkeit” labelcolor=[tradfri_wz_1_switch==OFF=“red”]
Switch item=tradfri_wz_1_switch label=“An/Aus”

Regards
Andreas

Die you try an other Browser? MS Edge works for me. I had problems with mit updating pages with Firefox and chrome but this could not be resolved until now.
I use Edge when i try to open a basic ui in the PC.

Good morning,

thanks for the hints. However, this morning it seems to work while yesterday, when I went to bed, it did definitely not work. Note, the system was running over night. Is it possible that the behaviour of OpenHAB is very much dependent on caches that are rebuilt from time to time?

@AndreasBrett: In PaperUI, I have only the channels “brightness” and “color_temperature” for my bulbs. There is no power channel for me. Is this maybe a different firmware on the bulbs or something?

As I have no power channel: Currently, I have only one item( Night_Light_Brightness) assinged to both the switch and the slider. Would it be better to assign separate items (one switch, one dimmer) to the “brightness” channel?