Nikobus v2

@TouF

Are you been able to communicate with the Nikobus system through the Nikobus configurations software? This way you know that your cables and other stuff (USB to serial adapter) are OK.

Dit you install the binding through the paper UI? (loose installed snapshot binding was not working for me, this stayed in “waiting” mode. I’m testing with the OH2.5M4 build).

Also keep in mind that you need to change the address of your modules in openhab. For example, if you have a switching module with address F5C1 (as you can find in your Nikobus configuration software) you need to address this module in opehab as C1F5. No idea why this is but you need to change it this way. Maybe this new version of the binding is a good moment to fix this.

I also use a RPi3 as my openhab server (I do an APT install of openhab). By default it seems that openhab has no access to the serial ports. therefore I execute following command:
adduser openhab dialout
You can try this but if you bridge status is “online” I would think that the communication is OK.

@DaanDW
i do am able to communicate with the hardware and a windows machine running nikobus software. so that part is ok i think.
but maybe my drivers are not working properly once connected to the RPi3, and i’m not sure how to test for that
i also tried to unplug the cable from the 05-207 module and restarted, the pc-link is still seen have “online” so it seems that this info only rely on the fact that openhab can access the /dev/ttyUSB0.

i just upgraded to openHAB 2.5.0~S1738-1 (Build #1738), and did the install threw the paperUI.
then copied my 2 config files in /etc/openhab2/things/nikobus.things & /etc/openhab2/items/nikobus.items

i missed the trick about inverting the address bytes, so just to be sure i declared things with both the original and switched adress.

.items is
Dimmer Light_Salle_a_manger “Ceiling” (FF_PlayRoom, Lights) [ “Lighting” ] { channel=“nikobus:dimmer-module:mypclink:d1:output-1” }
Dimmer Light_Prises_salon “Ceiling” (FF_PlayRoom, Lights) [ “Lighting” ] { channel=“nikobus:dimmer-module:mypclink:d1:output-2” }
Dimmer Light_Salon1 “Ceiling” (FF_PlayRoom, Lights) [ “Lighting” ] { channel=“nikobus:dimmer-module:mypclink:d1:output-3” }
Dimmer Light_Salon2 “Ceiling” (FF_PlayRoom, Lights) [ “Lighting” ] { channel=“nikobus:dimmer-module:mypclink:d1:output-4” }

Switch Light_bureau_spots "BureauPA" (FF_PlayRoom, Lights) [ "Lighting" ] { channel="nikobus:switch-module:mypclink:s3:output-4" }

Rollershutter Volet_bureau_parking "VoletsPA" (GF_Corridor, gShuttersGF) { channel="nikobus:rollershutter-module:mypclink:r2:output-5" }
Rollershutter Volet_bureau_route "VoletsPA" (GF_Corridor, gShuttersGF) { channel="nikobus:rollershutter-module:mypclink:r2:output-6" }

and .things is

Bridge nikobus:pc-link:mypclink [ port = "/dev/ttyUSB0", refreshInterval = 25 ] {
    Thing switch-module s3 [ address = "7830" ]
	Thing switch-module s3bis [ address = "3078" ]
		
    Thing push-button 183E76 "porte" [ address = "183E76", impactedModules = "switch-module:s3bis:4" ]
	Thing push-button 1E64BA "bureau" [ address = "1E64BA", impactedModules = "switch-module:s3bis:4" ]
	Thing push-button 763E18 "porte2" [ address = "763E18", impactedModules = "switch-module:s3bis:4" ]
	Thing push-button BA641E "bureau2" [ address = "BA641E", impactedModules = "switch-module:s3bis:4" ]
}

i was previously using the notation Thing switch-module 3078 “s3” , but it seems the last update integrated the new structure.

my openhab user is part of the dialup group

as for the bundles installed i have :

203 | Active |  80 | 3.15.0.OH2            | nrjavaserial
204 | Active |  80 | 3.6.0                 | Apache Commons Net
205 | Active |  80 | 2.5.0.201911020348    | openHAB Add-ons :: Bundles :: Network Binding
206 | Active |  80 | 2.5.0.201911020349    | openHAB Add-ons :: Bundles :: Nikobus Binding
207 | Active |  80 | 2.5.0.201911020316    | openHAB Core :: Bundles :: Configuration USB-Serial Discovery
208 | Active |  80 | 2.5.0.201911020316    | openHAB Core :: Bundles :: Configuration USB-Serial Discovery for Linux using sysfs scanning
209 | Active |  80 | 2.5.0.201911020317    | openHAB Core :: Bundles :: Configuration Serial
210 | Active |  80 | 2.5.0.201911020314    | openHAB Core :: Bundles :: Serial Transport
211 | Active |  80 | 2.5.0.201911020316    | openHAB Core :: Bundles :: Serial Transport for RXTX
212 | Active |  80 | 2.5.0.201911020316    | openHAB Core :: Bundles :: Serial Transport for RFC2217

even thow i only installed nikobus binding threw paper ui.

i’m still thinking i might be missing something on the serial transport part. is there any bundle, setup, config i should know about ?

Hi all!

Final Nikobus v2 PR got merged - so please use the updated syntax, that is specifying address as a parameter instead of as a thing id:

... [ address="6B00" ]

additionally, impacted modules for button(s) also take thing type&id instead of address(es), i.e.:

... impactedModules = "switch-module:s3bis:2" ]

(FYI @stefaanbolle and others using the initial version of the binding).

@DaanDW - there is no long/short press for Nikobus button(s), each press will generate an event (if kept pressed, there will be a bunch of them). Can you share more details about what you want to accomplish?

@TouF - bridge will show as online if it can open the serial port, there is no additional check in place - can you please set log level to TRACE and share the logs?

Please see readme for reference.

This is definitely wrong, last number can only be 1 or 2 - switch-module:s3bis:4.

@TouF

The impacted module part can indeed only be 1 or 2.

1 for:

  • the first 6 channels of a 12 channel switch or dimmodule.
  • the first 3 channels of a rollershutter module
  • all channels for the small 4 channel switch or dimmodule

2 for:

  • the last 6 channels of a 12 channel switch or dimmodule.
  • the last 3 channels of a rollershutter module

When u install the binding through the paper UI, make sure u delete all the Nikobus binding related *.jar files in the openhab addons folder.

a part of my configuration files: (OLD SYNTAX! as used for the 2.5M4 binding installed through the paperUI)

*.things

Bridge nikobus:pc-link:PCL1 [port="/dev/ttyUSB0", refreshInterval=30]{	
	Thing switch-module 7C26 "Nikobus switchmodule 1"@"Nikobus system"
	Thing push-button 207C1A "Nikobus button BP11-C" [impactedModules = "7C26-1"]
	Thing push-button 607C1A "Nikobus button BP11-D" [impactedModules = "7C26-1"]
}

*.items

Switch Licht_backdoor 	"Light backdoor"    <light>  (Garden) 			{channel="nikobus:switch-module:PCL1:7C26:output-3"}

Switch BP11-C "knop C" {channel="nikobus:push-button:PCL1:207C1A:button", autoupdate="false"}
Switch BP11_C "knop D" {channel="nikobus:push-button:PCL1:607C1A:button", autoupdate="false"}

I do not have tested the new syntax yet.
I hope this can help you.

@crnjan

For the new syntax, do I need to install the last snapshot binding? (I’m using now openhab 2.5M4 and the Nikobus binding v 2.5M4)

About the long presses, this is a frequently used function in Nikobus installations.

This is a part of my *.items file of my Nikobus V1 binding installation. The V1 binding supports the detection of long presses.

Switch BP31_D "Kitchen lights off" {nikobus="#N655C1B[70B6-1]"}
Switch BP31_D_L "All off" {nikobus="#N655C1B:LONG[70B6-1,70B6-2]"}

I’m using this double function in a lot of places in my house. This way you can use a button to turn the light of certain room off and a long press can be used to turn a certain area of the house off (ground floor, the whole house, garden, …)

The need for a long press detection in openhab is because this “all off” funtions are also used in combination with other bindings. So when I turn my ground floor off with a long press on a Nikobus button it’s also turn off some Yeelight bulbs and DMX led strips. In my TV room I use a long press to also turn off my TV and DMX LED strips. I use it also to set my heating to ECO-mode when I leave my house.

So as you can see, the long press detection is a needed and frequently used feature for me. So it would be great if you can help me to realise this with the V2 binding. Or if you can give me some suggestions how to detect longer presses in a rule or someting?

1 Like

Hi!

PR was merged ~4 days ago so I guess any snapshot made after that should contain the new version of binding - it is mainly a change in how it is configured - and there is no expected breaking change anymore.

I was asking about long press functionality if it was used in Nikobus domain only - than I’m sure one could configure the Nikobus installation itself to threat long-press differently - giving also the benefit it would work without the OH.

In v1 version the long press was triggered if button triggered 25 sequential events, waiting for max 85ms between each. Will think about this a bit how to solve it …

I hope there are no other issues with the binding? Had been running it for weeks now and all good (using 10s as update interval)…

The long presses that affect Nikobus components are indeed configurated in the Nikobus configuration and not in openhab for the best performance and that they also work without openhab.

I used this long press detection in openhab to control other bindings with it. The advantage of openhab is that it is possible to combine different eco systems with each other.

Therefore thank you that you want to look for a possible solution for this.

thanks @DaanDW & @crnjan .
i simplified my config for the moment, and set
log:set TRACE org.openhab.binding.nikobus

but i don’t have any traces, even when i push on the yellow button of the module.

i did test 2 different ubs to serial adapter, they are both recognized as

[223031.510518] usb 1-1.3: new full-speed USB device number 7 using dwc_otg
[223031.642813] usb 1-1.3: New USB device found, idVendor=067b, idProduct=2303, bcdDevice= 3.00
[223031.642827] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[223031.642837] usb 1-1.3: Product: USB-Serial Controller
[223031.642846] usb 1-1.3: Manufacturer: Prolific Technology Inc.
[223031.645383] pl2303 1-1.3:1.0: pl2303 converter detected
[223031.649713] usb 1-1.3: pl2303 converter now attached to ttyUSB0

the only difference i see is that i’m plugged in a 05-207 and not a 05-200.
this was ok on the V1 binding, and should be working on V2 (at least DaanDW said so).
i do not have a touchscreen on the nikobus network, but i do have a lot of buttons with led that might be using the “feedback” fonctionnality.
i’m still not fluent in nikobus system, i just bough a house with that system in place.
maybe i’m missing something on this part.

has anyone tested the V2 binding with a 05-207 niko module ?

hi!

I would say if the same setup works with the v1 binding than it should work with v2 too. There is not much to see from the shared log above, can you maybe stop OH, delete all the logs and start it again and share the logs? Are you sure you don’t have the v1 version of Nikobus installed too?

Btw, can we close this issue now? @DaanDW?

inmho you can, with v2 no issues with sync

1 Like

Yes, I think we can close it now the new binding is here. seems that there are no more sync problems. sync on dimmer modules seems even better than with the V1 binding (in the V1 binding dim values where not always 0 when you switch off the light).

@TouF

The yellow button just send the module address on to the bus. I think that there is no functionality for it in the binding.

If it was working with the V1 binding it also should work with the V2 binding. The used serial communication should be the same on the two binding versions.
Maybe you need to look in the menu of the feedback module (maybe there is a setting that block the communication to the serial port? PC-logic has such a function for the SMS module that can connected to the PC-logic).

When you connect the PC with the Nikobus configuration module, can you control the module outputs with the configuration software?

I also use a PL2303 based convertor cable.

Hi everyone,
communications are now working, modules are up
i’m not really sure what changed, my openhab/nikobus config is the same.
i just played a little with the differents usb ports. So most likely a serial/usb config problem to begin with.
thanks a lot for your help, i’ll start to look deeper in the binding now.

Hi everyone,

I installed a clean windows version of openhab2.5M4 on my NUC. Just installed the Nikobus 2.5M4 binding using PaperUI.

Am I right to create a .thing file first just with a bridge to connect to my PcLink:

Bridge nikobus:pc-link-serial:mypclink [ portName = “/dev/ttyUSB1”, refreshInterval = 30 ] {
}

I’ve got two connections from my Nuc:
Com1 to PcLogic for use with Nikobus software
Com2 to PcLink for use with Openhab2

So i guess /dev/ttyUSB1 is right for Com2?

How can I check my connection is “Online”

Still no result after trying all kind of settings: /dev/tty/USB1, Com1, Com2 etc.

Should i first install a serial binding? In Paper UI I only can choose v1 of a Serial binding.

Hi!

Can you try adding something like

Bridge nikobus:pc-link:mypclink [ port = "/dev/ttyUSB0", refreshInterval = 60 ] {
  Thing switch-module s1 [ address = "FF2A" ]
}

to your .things file and

Switch Light_FF_Gallery_Wall "Wall" (FF_Gallery, Lights) [ "Lighting" ] { channel="nikobus:switch-module:mypclink:s1:output-4" }

to the .items file and give it a spin? Also set log level for Nikobus to TRACE and than share the logs.

Address above is not correct for your installation but should at least cause binding to produce logs …

I would recommend that you not use you Nikobus configuration software and openhab at the same time. both will start polling the status of the modulles and this will create a heavy load on the bus.
I also think that you can disturb the polling mechanism by using both at the same time.

Hi Guys,

Thanks for your answers but no result at this time.

@crnjan
On a windows machine (NUC) the port-adress should be “Com1” instead of “/dev/ttyUSB0”?

When your Nikobus software reports “2AFF” as pclink address the Openhab address is “FF2A”. Right?

Did not change the log level to trace but I will this weekend.

@DaanDW
My Openhab NUC is placed near my Nikobus installation so with Remote desktop I use this PC for openhab and for configuration of Nikobus. For now I removed one “USB to serial” cable (for the Nikobus software) to fix my Openhab problem. But after Openhab is started and uses my Com1 it should be possilble to use a second “USB tot serial” (Com2) to connect the Openhab software I guess?