Nikobus Binding Dimmer example

Hi,

Can anyone share a example on how to control / implement a nikobus dimmer?
Currently the dimmer module channel is configured as a standard switch, but that only allows ON/OFF.
How do I implement dimming?

Thanks for your feedback.

Pascal.

Try using Dimmer in stead of Switch to declare the item.

Hi Davy,

Thanks for coming back to me.
The Item is declared as Dimmer.

> Dimmer nk_dm1 {nikobus="0CE4:1"}

I’ve creates a rule based on the demo

> rule "Dimmed Light"
>     when
>         Item nk_dm1 received command
>     then
>         var Number percent = 0
>         if(nk_dm1.state instanceof DecimalType) percent = nk_dm1.state as DecimalType

>         if(receivedCommand==INCREASE) percent = percent + 5
>         if(receivedCommand==DECREASE) percent = percent - 5

>         if(percent<0)   percent = 0
>         if(percent>100) percent = 100
>         postUpdate(nk_dm1, percent);
> end

in my sitemap I added.

> Slider item=nk_dm1

But that doesn’t seem to work.

Which UI are you using? If you use the basic-ui (which has a slider in the UI), then you don’t need the rule. When you slide the rule, it will send the new value to the dimmer item when you stop sliding.
If you are using the classic-ui (which has the up/down buttons), then you need the rule.
But if I remember correctly, you will need to use postCommand instead of postUpdate in the rule. The nikobus items will not listen to state changes, only commands.

*sendCommand
:smile:

@watou , good catch! Thanks!

Some more findings:

Looks like an issue in classic.ui. on openhab 1.8.0.
No slider or up/down buttons are shown at all. (keeps showing “loading”)

I’ve tried similar from an openhab 1.7.1 which is linked (via MQTT binding) as a master to the 1.8.0 Nikobus slave.
On 1.7.1 classic-ui the slider buttons appear, and the dimmer commands are send to the eventbus. (FYI the rules specified above are not needed, the INCREASE and DECREASE commands are published on the eventbus without them by default)

Also works like a charm using the android app on both versions.

Slider issue in 1.8.0 has been solved by adding the values to the label. See Here
Nikobus dimmers are working fine now.