Common items in OH2

I am migrating from a working OH1 environment to OH2 and I have converted all my items, rules, sitemaps, persistance etc but I am finding I am having a couple of problems with some sitemap controls that modify the same “thing”.

I have a thing which is a dimmer. I have a switch to control it for on and off, I also have a slider for fine dimming control, as well as a switch with mappings for dimming at certain levels:

Items:

Switch      Fibaro_Kitchen1_Light   "Bench Lights"  	                          { channel="zwave:device:Controller:node15:switch_dimmer" }
Dimmer      Fibaro_Kitchen1_Dimmer  "Dimmer [%d %%]"   (gKitchen, gDimmers_Kodi)  { channel="zwave:device:Controller:node15:switch_dimmer" }

Sitemap:

Switch item=Fibaro_Kitchen1_Light icon="light"				
Slider item=Fibaro_Kitchen1_Dimmer icon="dimmablelight"				
Switch item=Fibaro_Kitchen1_Dimmer label="Bench" icon="dimmablelight" mappings=[0="Off", 1="Low", 30="Med", 100="full"]	

When I toggle the first switch, there is a definite delay, but the slider goes up to 100 and the other switch is mapped to full
Toggling the first switch off, I get the same result with the delay (didn’t seem to be there in OH1)

My problem is with the opposite control. If I slide the slider right down to 0 or use the switch mapping of “off”, the top switch does not change state.

can anyone help?
Thanks

I think you don’t have to use a second item for this purpose, just using the dimmer item as a switch without mapping) should suffice.

Yes I could but I use a phone mostly for control and the strike rate for a toggle vs a swipe I prefer. Was all good in 1.8 so thought it should be same in 2

I think you didn’t get it rigtht. just do a

Switch item=Fibaro_Kitchen1_Dimmer icon="dimmablelight"	

and you will get a switch for your dimmer. You do not need a second item for this purpose.

Ok sorry I misunderstood.

However trying this I still get the same behaviour.

So with one item:

Dimmer      Fibaro_Kitchen1_Dimmer  "Dimmer [%d %%]"   (gKitchen, gDimmers_Kodi)  { channel="zwave:device:Controller:node15:switch_dimmer" }

(no other item defined with the same channel) and this (part of) sitemap:

Switch item=Fibaro_Kitchen1_Dimmer icon="light"				
Slider item=Fibaro_Kitchen1_Dimmer icon="dimmablelight"				
Switch item=Fibaro_Kitchen1_Dimmer label="Bench" icon="dimmablelight" mappings=[0="Off", 1="Low", 30="Med", 100="full"]

when switching light with with the Off-button (from the third line), the switch in the first line will stay ON?
This is strange… It’s a shame, that I can’t verify this behavior for now, as I’m @ work.

Did you autodiscover zwave? If so, please ensure, that the channel is not linked to any other item through Paper UI.

Correct thats what I have. I do have Dimmer, Dimmer_1 and Dimmer_2 channels on the fibaro dimmer but Im not using them - perhaps its getting confused?

Doing some more testing - from a web browser using classicUI it seems to be working as expected - from IOS app - everything seems “unrelated” and when dimming via the slider, the on off switch doesnt change state.

Using Basic UI from a browser I get the same behaviour as the IOS app?

1st law of openHAB (maybe not the 1st, but…): one channel belongs to one item. You could use more than one channel per item, but never use multiple items per channel.

The above screenshot is what was discovered automatically

If you did not switch off autolinking, all these channels are linked to automatically generated items, you can use these items in rules or sitemaps as if they where defined in .items files. Or simply unlink the channels and configure the items manually through .items :slight_smile: