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