Openhab2 Dimmer & Switch item for Zwave dimmer

So I started using openhab2, and it found all my zwave devices. However i wanted to use my openhab1 sitemap, in witch every zwave dimmer has a Dimmer item and a Switch item. This allows me to easily turn the light on and off, and dim it. However in openhab2 i can only bind the Zwave device to a Dimmer item,… How do i also connect it to a Switch??

The only solution i see now is to write a rule for the Switch item, which updates the Dimmer, but this is probably overly complex.

In openhab1, i had it setup as follows:
Switch Light_GF_Living_Ceiling “Ceiling” (GF_Living, Lights) {zwave=“2:command=SWITCH_MULTILEVEL”}
Dimmer Light_GF_Living_Ceiling_Dimmer “Ceiling Dimmer” (GF_Living, Dimmers) {zwave=“2:command=SWITCH_MULTILEVEL”}

In openhab2 i have the same items (without the {} at the end), and manually have the dimmer thing bound to the dimmer item. However, howto use the switch? Do i have to write a rule?

Ok i solved it by adding a bunch of rules like this (see below)… But this should be possible much easier. Proposal: Make it possible to bind a Thing to multiple “Items”. Such as a fibaro-zwave-dimmer thing, to Switch and a Dimmer.

rule "LightBedSwitch"
when
    Item Light_GF_Bed_Ceiling received command
then
    if (receivedCommand==ON) {
        sendCommand(Light_GF_Bed_Ceiling_Dimmer, 100)
    } else {
        sendCommand(Light_GF_Bed_Ceiling_Dimmer, 0)
    }
end

:smile:

Sure is| A dimmer is based on a switch, so as a dimmer, it already supports what you want. All you need to do is use the Switch in your sitemap -:

Switch item=my_item
Slider item=my_item

will give you a sitemap with a switch and a slider, for the same item.

1 Like

Thanks! Stupid that i didnt think of that.
Does it mean i can also send ON OFF to a dimmer item?

sendCommand(Light_GF_Living_Table_Dimmer, dimValue)

Light_GF_Living_Table_Dimmer,send(ON)

Hmmz lemme try

Yes