Nikobus v2

Added new option for rollershutter’s channels

Test jar can be downloaded here - please put it in addons folder of your OH installation and uninstall the binding from UI (the official one). Note you will need 3.1 OH version in order to try it out …

Oke, thx. That ll fix it indeed.
I’m not sure I’ll try 3.1 before it’s released but time will solve this.

Since noone has this issue as far as I know, I will wait for you to confirm if it works before creating a PR.

Oké
I’m gonna setup a second test/snapshot-server and let you know. Hope to test this weekend.

Hi

The delivery of my snapshot nuc has been delayed. So I haven’t had a chance to test the rollershutter status yet.

Hi, just found some time to dive into this. Fresh install, blank simple config.

So I followed your example and currently i have 3 Things:

I created the Push Button as a Thing:

Then i created an Item:

and linked it:

When i klik on the switch button i have to click 2 times in order to send the command to the light.
So this image shows it is on (and i confirm the light is on)

but when i click on it to switch it off, nothing happens with the light itself.


if i click it fast enough, on/off the light is switched on or off.

so it seems that the function of the switch button does not work, is there a push button available?

Also, maybe that is fixed with your custom layout code you send but i don’t know where to use (paste) it.

Nikobus push button is - a push button - and reacts only when it receives an ON command.

So when being manipulated by a switch control, only transitions from OFF -> ON will simulate a press, while transition from OFF -> ON will do nothing - therefore you need to click 2 times. Also, push button does not have a state (of the light you are turning off/on) but you need to refer to relevant Nikobus switch module’s output state, as described in my original post, where you can also find the yaml that does just that.

You can go to Administration | Pages and create a new layout page - and paste

config:
  label: TestSwitch
blocks: []
masonry:
  - component: oh-masonry
    slots:
      default:
        - component: f7-card
          config:
            title: Home Office Light
          slots:
            default:
              - component: f7-card-content
                slots:
                  default:
                    - component: f7-row
                      config:
                        class:
                          - justify-content-center
                          - align-items-center
                          - padding-bottom
                      slots:
                        default:
                          - component: f7-icon
                            config:
                              f7: lightbulb
                              class:
                                - padding-right-half
                          - component: Label
                            config:
                              text: =items.gBasement_HomeOffice_Light_Ceiling_Powered.state
                    - component: oh-button
                      config:
                        outline: true
                        text: Toggle
                        action: command
                        actionCommand: ON
                        actionItem: gBasement_HomeOffice_PushButton_Light_Toggle

ofc you need to adjust item names.

Thanks @crnjan
i’ve created the thing “gBasement_HomeOffice_Light_Ceiling_Powered” and linked it to my Output 8.
I created a page based on your code and i now have my first working pushbutton for Nikobus (you are great!)

To be sure i understuud you correct. You said “please make sure to set “semantic class” of your linked channel to none since you don’t need it as part of your semantic model, it’s needed just so you can send commands to it”
So i created my 2 Items “gBasement_HomeOffice_Light_Ceiling_Powered” linked to Output 8 and “gBasement_HomeOffice_PushButton_Light_Toggle” linked to my Thing “Nikobus Push Button 1CA9BC:1”
both with “sematic class” set to “none”.
Correct?

Is there a way to update the status faster? When i click “Toggle” is takes some time before it goes from OFF to ON. If i check the Items page, this is the same for “gBasement_HomeOffice_Light_Ceiling_Powered” which seems logic because your code reads its .state.

is it ok, for now, that i use “Run mode (Ctrl-R)” to test the code of the pages?

If i get this working correct i’m ready to move on to a push button with an integrated feedback led !

How long does it take to see the change?

EDIT: please set impactedModules parameter of your push button so it will re-read Nikobus switch module’s status after you tapped the button, assuming something like below:

switch-module:ac139383b4:2

EDIT2: AFAIK it should be ok to use the run mode for testing.

“sematic class” set to “none”.

This in no way impacts the functionality, but affects how this items are considered when i.e. auto-populating locations/equipment/properties tabs so you can ignore that for now probably and adjust how you see best fit later on.

It takes between 20 and 45sec to update the status from “ON” to “OFF” or visa versa.

about the impactedModules parameter. which address should i type in?

If you have set all up as on your screenshots then switch-module:ac139383b4:2 should do the trick.

ac139383b4 = switch module’s id
2 = second group (module has 2 groups, 6 channels each - so channel 8 => second group)

Please see doc for details.

OK! that works instantly now!
i also understand your clarification about the :2 and i’ll re-read the doc better.

Can the lightbulb be turned on (yellow) and off? are those images that are in a library?

i’ll go ahead and add a push button with a feedback led in the same way as you instructed me.
i’ll keep you posted!
Thanks!

You can do all sort of stuff, the yaml I shared is just a simple (testing) widget.

Changing your yaml a bit:

- component: f7-icon
  config:
    f7: "=items.gBasement_HomeOffice_Light_Ceiling_Powered.state === 'ON' ? 'lightbulb_fill' : 'lightbulb'"

should change icon as well when turning light on/off. Icons used Framework7 Icons … and there are others too …

So far so good!
i was able to add multiple pushbuttons with the procedure you described.
Looks like this now:

performed some tests and only if i quickly click the toggle button of multiple
cards after eachother then sometimes the status is not updated. If i wait a long time it gets fixed or
when an update occures on the impacted modules address, then the status is shown correctly.
For example, these 4 lights are on the same switch module. If the status of “Keukeneiland” is out of sync and i can fix it by putting for example “Berging” on and off. I suppose this is because they are on the same impacted module?
Is the “refresh time” mandatory or can this be changed?

Interesting remark you gave me about the Framework7 Icons and that other librarys exist.
So component: f7-icon specifies which library to use. Is there a link with more information about this and how i can learn more about YAML for openHAB, library’s and so on?

Are the feedback LEDs working?

if i quickly click the toggle button of multiple
cards after eachother then sometimes the status is not updated

If impactedModules parameter is setup for push button(s) then each tap should trigger a channel read of respective switch module. Since status refresh is done on a group level, each status read returns values for 6 channels - so yes, if lights are within same group, one status refresh will update channel values for all 6 within that group.

I don’t think “quickly clicking” is a real use case, but if you see issues, please provide full logs with DEBUG level set for nikobus binding.

Is the “refresh time” mandatory or can this be changed?

Not sure what refresh time you mean?

There are a lot of good articles here in community regarding UI, i.e.

Yes, i can confirm that the feedback LED’s are working correctly, even if i “force” the system by pushing like an idiot on the available “Toggle” buttons. The feedback LED’s always keep following the real status of the lights! This is great news, your NikoBus binding rocks!

I will continue to add more lights and see how it evolves during “normal use”. I’ll let you know i the behavior comes back.

I also tested the behavior of multiple feedback LED’s. For example. i have a room with 3 doors. From each door you can control the lights in the room. And each push button has a feedback LED integrated. All my test went without any issues. The LED’s respond as fluent as when i use the physical buttons and the LED’s are updated at the same speed. This is great!

By the “refresh time” i meant the status refresh of a group on the switch module.

i’ll read through the articles you send me.
Is there a logica i need to follow? For example one page per room or floor of the building? And create cards in them corresponding to the real world. Or isn’t there a strict rule to follow?

Next thing on my list are the lights that are dimmable and are connected to my Dimmer module.
Can i re-use most of the code you send me and use the same approach or do they work differently?
I read your doc and saw you mention .things and .items files. I suppose that the Things and Items i created are stored elsewhere?

Glad to hear LEDs are also working.

You can ignore .things and .items files since you are adding items and things through UI - which I would recommend …

One question - all your push buttons have a feedback LED? Even those you use with dimmers?

yes indeed, almost all push buttons have feedback LED’s, even those i use with dimmers. Dimmers are configured with one push button. For some, the last dimmed value is used when they are switched on again. Pressing the pushbutton for a short or long time makes it dimming more or less. To reverse the process you stop pushing it and when you push it again for a short or long time it dimmes the other way. A short press switches the light of (or on).

Dimmers work pretty much the same, the only difference is its state - it’s not ON and OFF, but 0 - 100.

The preferred method for controlling module’s outputs is directly linking module’s output channel - via switch for switch modules and via dimmer for dimmer modules. That way you can both directly see current state + manipulate it. But this method communicates directly with the Nikobus modules, hence your LEDs don’t “know” what is going on. Therefore you need to simulate button presses (what you are doing now). So when you tap the Toggle button, an ON command is send to Nikobus binding and that triggers a simulated button press to be send to Nikobus PC-Link. When you tap again, a new button press is send. If you don’t release the Toggle button (keep pressing it), nothing is happening, so only the initial tap/press will trigger the command.

On the other hand, if you press a real, physical Nikobus button, it will send a “press message” every ~100ms until you release it. While this does not make any difference for a switch module (you need to tap, release and tap again a button to turn light off/on), it makes a difference for dimmer. Using current approach, my guess is that taping Toggle button will - turn your light on and off, probably keeping last set dimmer value when turning on. So no dimming capability.

There are ways around this, the easiest would be to bind directly to dimmer’s output channel, as described above - so you can directly manipulate output via i.e. slider control - but loosing the LED status … or have a combination of Toggle button + slider … or write a rule that would start a timer and send ON commands until one does not release a button … up to you which road you’ll take, if you’ll have any questions, just let me know.

Hi crnjan,
Is de “Reverse Direction” option for rollershutters only available in the Snapshot 3.1 version of OpenHAB or in te 3.1 M1 Milestone verison too?