Nikobus - Switch as a pushButton

369 views
Skip to first unread message

Eric Mathieu

unread,
Aug 21, 2014, 6:21:23 AM8/21/14
to ope...@googlegroups.com
Hello,

I just discover openhab few days ago.
I will try to configure my Nikobus installation with openhab. 

i use this command:

Switch LightOne  (gGF, Light) {nikobus="#NA6A882:SHORT[CAB3-1]"}

My problem: the system don't send command to Nikokus when the command is OFF. It's works only with ON commands
It toggles the light only when it sends ON. Thus i have to push the button twice to switch ON the light.

12:07:45.882 INFO  runtime.busevents[:22] - LightOne  received command ON
12:07:45.908 DEBUG o.o.b.n.i.c.NikobusInterface[:233] - Sending : #NA6A882
12:07:45.916 ERROR o.o.b.n.i.NikobusBinding[:113] - Error processing commmand ON for item LightOne  : null
12:07:45.968 DEBUG o.o.b.n.i.c.NikobusInterface[:233] - Sending : #E1


12:08:06.980 INFO  runtime.busevents[:22] - LightOne  received command OFF
12:08:06.994 ERROR o.o.b.n.i.NikobusBinding[:113] - Error processing commmand OFF for item LightOne  : null

Can someone help me on how to do this ? what is wrong ?


A workaround should be to use an exec command: "openhab send LightCmd ON" works perfect in OSGI 
in my project:
Switch LightCmd   {nikobus="#NA6A882:SHORT[CAB3-1]"}
Switch LightOne   (gGF, Light) {exec="openhab send LightCmd ON"}  

but i don't understand how to write the correct command to perform the exec function:  {exec="openhab send LightCmd ON"}  doesn't work !

any idea ?

Thanks a lot

Davy Vanherbergen

unread,
Aug 22, 2014, 1:49:43 AM8/22/14
to ope...@googlegroups.com
Hi Eric,

In openHAB, switches have an ON/OFF state.  A nikobus wall switch doesn't have any state.
What you want to do is configure your openHAB switch to control your module directly like so:

Switch LightOne  (gGF, Light) {nikobus="CAB3:1"}
Switch LightTwo (gGF, Light) {nikobus="CAB3:2"}
Switch LightThree (gGF, Light) {nikobus="CAB3:3"}
...
Switch LightTwelve (gGF, Light) {nikobus="CAB3:12"}

This will allow you to switch channel 1,2, 3 ... 12 on your module on and off using an openHAB switch.

To switch on the lights, you can then use

openhab send LightOne ON

To switch off, you can use

openhab send LightOne OFF


With this configuration, openHAB will maintain the correct ON/OFF state of your light as long as it is only switched via openHAB. If you would use your wall switch to turn on the light, than openHAB is not aware of this and the state in openHAB will not reflect the actual state.

To solve this, you can configure your wall switches in openHAB like so:

Switch WallSwitch {nikobus="#NA6A882[CAB3-1]"}

This will make openHAB listen to wall switch presses. When it notices the switch was pressed, openHAB will read the new status from the nikobus module, so that it is back in sync.

Kind regards,

Davy



Eric Mathieu

unread,
Aug 22, 2014, 2:21:12 AM8/22/14
to ope...@googlegroups.com

Hi Davy

Thanks for your explanation. It's more clear for me now.
I've another question:

The commands

openhab send LightOne ON
openhab send LightOne OFF
 
works fine directly in OSGI console but i cannot find the correct syntax to use it with openhab.
I tried with exec like this: Switch LightOne   (gGF, Light) {exec="ON:openhab send LightCmd ON"}  but it doesn't work (invalid command).
Do you have an example ?

Thanks a lot

Eric

Davy Vanherbergen

unread,
Aug 22, 2014, 1:44:55 PM8/22/14
to ope...@googlegroups.com
You don't need to use the exec function at all. Just declare your switch in the sitemap and it will be ready for use, e.g:

Switch item=LightOne

Davy


--
You received this message because you are subscribed to a topic in the Google Groups "openhab" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openhab/GzUuO3H0lCs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openhab+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab.
For more options, visit https://groups.google.com/d/optout.

Eric Mathieu

unread,
Aug 22, 2014, 3:38:50 PM8/22/14
to ope...@googlegroups.com
Yes, it's what i already done but in this case:

The first time i click the button in openhab, the lamp goes UP. Normal -:)
Now i click again on the openhab button to turn off the lamp. And nothing happens. The icon in openhab changes (normal) but the lamp stays on. In the OSGI console, i see that the switch receive command OFF.
Now i click again on the openhab button: the lamps lights goes out. The icon in openhab changes and shows a light ON.
Now i click again on the openhab button: the lamps stays OFF, The icon in openhab changes and shows a light OFF.

So, the nikobus switch (configured as a pushbutton) seems to react only when it receive a ON command. It ignores the OFF command. I presume it's not normal.

Of course, if i configure/use the niko switch module in place of the button, it reacts on both command : ON & OFF. 

But like i use buttons with feedback, the led (on the niko button) doesn't react when i configure/use switch module. It only work when i use the configuration of a button.

May be i miss something. -:(


Thanks

Eric


Davy Vanherbergen

unread,
Aug 23, 2014, 8:41:12 AM8/23/14
to ope...@googlegroups.com

So, the nikobus switch (configured as a pushbutton) seems to react only when it receive a ON command. It ignores the OFF command. I presume it's not normal.

This is working as designed. Unlike a real switch, a push button doesn't maintain state and can only be pushed.

If you want to show push buttons in the UI, you can use a configuration like

Switch item=LightCmd mappings=[ON="On"]

Whenever you press it, it will send the ON command and mimic your wall switch being pressed.

If you prefer a switch in the UI, you could configure a rule to convert both the ON and OFF commands to ON. 

Switch item=LightProxy

rule "Toggle Wall Switch"
when
    Item LightProxy changed
then
    sendCommand(LightOne, ON)

The recommended approach is still to configure the nikobus switch module instead. If not, you'll probably have to create some clever rules to keep the status of the user interface in sync with the status of your lights.

In openHAB, there is no specific support for the feedback module, which I assume you are using. I'm not aware how that one works, but maybe you can reprogram it so that it listens to changes in the switch module rather than the wall switches to determine if a feedback led should be activated.

familie....@gmail.com

unread,
Aug 24, 2014, 9:24:45 AM8/24/14
to ope...@googlegroups.com

Hey guys,

I'm running into the same issues since I have a lot of buttons on my wall-switches configured as a push-button. If I'm correct, by including: 


Switch WallSwitch {nikobus="#NA6A882[CAB3-1]"}


into the Openhab-configuration, the synchronization-issues should be solved? So if I push the push-button on the wall-switch, Openhab is triggered and will request the status of "CAB3-1" (which should become "On" since the light was off). This will make sure that the status of my channel (which is shown in my sitemap) is correct. If I push again the same push-button on the wall-switch, Openhab will be triggered again and will reguest the status of this channel (this time it should show "Off").


Am I correct ?

Cheers

Tijl



PS Davy, I'm indeed planning to write that step by step in the near future, but first I should be able to have it working :-)

Davy Vanherbergen

unread,
Aug 24, 2014, 9:43:16 AM8/24/14
to ope...@googlegroups.com, familie....@gmail.com
Hi Tijl,

Yes, you are correct. It's not the same issue as Eric has though. In his case the synchronization issue is with the LED on his wall switches.

Kind regards,

Davy

familie....@gmail.com

unread,
Aug 31, 2014, 7:55:57 AM8/31/14
to ope...@googlegroups.com, familie....@gmail.com
Hi guys,

I have been trying to get this working, but without luck. From my IPAD I can switch all my channels and this works perfecty. However when using my wall-switches (push button), it gets completely out of sync.As advised, I included the necessary lines that should poll my modules when I push a button on my wall-switches.

Home items:

Switch Onderbreking_buitenverlichting             "Onderbreking_buitenverlichting"                                             { nikobus="C715:1" }
Switch STOPC_GF_Living_midden_tuin                 "Stopcontact midden tuin"                     (GF_Living, Lights)                { nikobus="C715:2" }
Switch Light_O_Licht_achter_zijkant             "Licht tuin Rondom"                         (O_achtertuin, Lights_beneden)    { nikobus="C715:3" }
Switch Light_O_Voor                             "Licht voordeur"                            (O_voortuin, Lights_beneden)    { nikobus="C715:4" }
Switch Light_GF_Keuken_aanrecht                 "Licht aanrecht"                            (GF_Kitchen, Lights_beneden)    { nikobus="C715:5" }
Switch Light_FF_Zolder                             "Licht zolder"                                 (FF_Corridor, Lights_boven)        { nikobus="C715:6" }
Switch Light_FF_Hall_boven                         "Licht hall"                                 (FF_Corridor, Lights_boven)        { nikobus="C715:7" }
Switch Light_FF_Badkamer                         "Licht badkamer"                             (FF_Bath, Lights_boven)            { nikobus="C715:8" }
Switch Light_FF_Ouders_Plafond                     "Licht ouders"                                 (FF_Bed, Lights_boven)            { nikobus="C715:9" }
Switch Light_FF_X_Plafond                     "Licht Jasper"                                 (FF_Child1, Lights_boven)        { nikobus="C715:10" }
Switch Light_FF_Y_Plafond                     "Licht Jolien"                                 (FF_Child3, Lights_boven)        { nikobus="C715:11" }
Switch Light_FF_Z_Plafond                     "Licht Jonas"                                 (FF_Child2, Lights_boven)        { nikobus="C715:12" }


Switch WallSwitch {nikobus="#N94584F[C715-8]"}



Home sitemap:

Text label="Verdieping" icon="firstfloor" {
            Frame label="Verdieping" {
               
                    Group item=FF_Bath
                    Group item=FF_Child1
                    Group item=FF_Child2
                    Group item=FF_Child3
                    Group item=FF_Bed
                    Group item=FF_Corridor
                    Group item=FF_Attic
                    Group item=Lights_boven                                               
            }

In the log-file, I can see it when I push the push-button "11:29:21.452 DEBUG o.o.b.n.i.c.NikobusCommandReceiver[:161]- Received NikobusCommand [command=#N94584F, repeats=3]", but it doesn't initiate the polling of the Nikobus-module.

Do you have a clue what could be the reason ?

tnx

Tijl

Davy Vanherbergen

unread,
Aug 31, 2014, 8:35:58 AM8/31/14
to ope...@googlegroups.com, Tijl de waele
Switch WallSwitch {nikobus="#N94584F[C715-8]"}


This should be Switch WallSwitch {nikobus="#N94584F[C715-2]"}

The last part behind the dash can only be 1 or 2. If you use 1, it will poll the first 6 channels of the module. If you use 2 it will poll the channels 6-12.


Daan Dewinne

unread,
Dec 10, 2014, 6:28:51 AM12/10/14
to ope...@googlegroups.com
When you use Nikobus buttons with feedback (and also a feedback module 05-207) it is important that all of your buttons in the UI also send the effective button adress (the feedback module use this data to update the LED status on the buttons) . When you control the Nikobus modules directly it will take some time untill the LED on your Nikobus button gets an update (The feedback module calculates the status of the outputs on its own and will correct this occasionally by request the status of the Nikobus modules).

Op vrijdag 22 augustus 2014 21:38:50 UTC+2 schreef Eric Mathieu:
Reply all
Reply to author
Forward
0 new messages