Hi!
So I am completely new to Openhab - Just set up OH2 on my Pi Zero W last week to see how it works out. And I am having some issues figuring out how to correctly set up my things.
I am running “3rd Party Bluetooth binding” to connect my custom BLE devices to my raspberry pi. The device that I am trying to set up first is a light dimmer.
So my device shows up in paper UI and has a bluetooth:ble:EC8B40DD1553:1BC50000-1BC50001-switchstate channel. It takes up a numeric value from 0 to 100 which indicates the current dimming level. When you set it in the paper UI the device turns on a light with the correct percentage. If something fails, the device will again update this channel to indicate the correct value.
Now I am trying to represent that in my items file as a light dimmer. I thought that it would be as simple as this: Dimmer FF_Bedroom_Light "Light main" <light> (FF_Bedroom, gLight) ["Lighting"] {channel="bluetooth:ble:EC8B40DD1553:1BC50000-1BC50001-switchstate"}
But this isn’t exactly working. If I set the “Light main” to 100%, the device state updates to 1%. So my guess is that Dimmer sets values in an interval from 0 to 1.0? But I am not sure. Do I have to use a transform here?
Another thing that I have is a switch module. This one accepts an enum that is has on/off values (in paper UI it shows up as a drop down menu). How do I set up my thing so that it will show up as a switch instead?
Have you checked for addition channels in PaperUI by clicking on “show more”? With some bindings you will find several more channels when this is clicked.
I think I figured it out. I changed my items file to: Number FF_Bedroom_Light "Luc glavna" <light> (FF_Bedroom, gLight) ["Lighting"] {channel="bluetooth:ble:EC8B40DD1553:1BC50000-1BC50001-switchstate"}
And changed my sitemap to (from Default): Slider item=FF_Bedroom_Light label="Bedroom"
It now shows up in the UI as a slider and changing it updates the value correctly and the icon looks correct and everything.