I’ve been using it for a couple of days now just fine, I added the RFXCOM binding through paperui and added the “things” as they came in the inbox.
Since I’m upgrading from OH1 I’ve reused my items file and edited the channels accordingly (found the channel string by checking the thing name in paper UI), example:
I’ve removed my things file for the time being in an attempt to configure through the paperUI (I recall doing this the first time in order to understand the syntax).
I don’t see anything in the inbox (paperui or karaf console), but exceptions thrown in openhab.log:
2017-02-18 19:26:32.897 [DEBUG] [org.openhab.binding.rfxcom ] - BundleEvent INSTALLED - org.openhab.binding.rfxcom
2017-02-18 19:26:33.071 [DEBUG] [org.openhab.binding.rfxcom ] - BundleEvent RESOLVED - org.openhab.binding.rfxcom
2017-02-18 19:26:33.082 [DEBUG] [org.openhab.binding.rfxcom ] - BundleEvent STARTING - org.openhab.binding.rfxcom
2017-02-18 19:26:33.114 [DEBUG] [org.openhab.binding.rfxcom ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.config.discovery.DiscoveryService}={component.name=org.openhab.binding.rfxcom.discovery, component.id=200, service.id=343, service.bundleid=227, service.scope=bundle} - org.openhab.binding.rfxcom
2017-02-18 19:26:33.164 [ERROR] [org.openhab.binding.rfxcom ] - [org.openhab.binding.rfxcom.discovery(200)] Error during instantiation of the implementation object
java.lang.NoClassDefFoundError: org/openhab/binding/rfxcom/RFXComBindingConstants
at org.openhab.binding.rfxcom.internal.discovery.RFXComBridgeDiscovery.<init>(RFXComBridgeDiscovery.java:56)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)[:1.8.0_101]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)[:1.8.0_101]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)[:1.8.0_101]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)[:1.8.0_101]
I’ll try and apt-get update/upgrade, followed by an uninstall and re-install of the whole OH2 packages.
@james_2_roberts I’m by no means an expert on the binding, but I do have it working happily on OH2 via paperUI. I would suggest you go through paperUI first just to make sure that you have the binding working correctly, before trying to get the text based .things file method working.
Also are you using beta 5 or the release version of OH2? If you are still on beta 5, I suggest you upgrade to the release version.
One other point - I don’t think you need the rfxcom.cfg file with the OH2 binding as the serial port is configured in the thing definition (as an aside, even if you did use a config file, the syntax of your line does not look correct as with OH2 we no longer prefix the binding name on each line of the config file - thus your line should read serialPort=/dev/ttyUSB0 ).
I’m making progress. I performed a clean install of OH2 (apt-get purge, followed by install), this time I started with an empty list of bindings and just installed the rfxcom binding, along with the rfxcom.cfg file.
The rfxcom wasn’t found by the paperUI, so there’s no way I can configure it?
What if you only define the bridge in the things file, and let the lighting5 things add them self by creating some activity on the rfxcom device (switch on the lights assuming these are light devices etc.)
At least, when I got my rfxcom bridge defined, the things came ‘automagically’ in the inbox when the devices started to communicate (temperature sensors by timer, door sensors after I open/closed the door and so on).
I followed the PaperUI route, installing both the RFXCOM binding through the PaperUI, and also configuring it manually, specifying only the serial port as: /dev/ttyUSB0
The resulting logs show:
==> events.log <==
2017-02-19 12:22:07.615 [ThingAddedEvent ] - Thing 'rfxcom:bridge:a99227cd' has been added.
2017-02-19 12:22:07.669 [hingStatusInfoChangedEvent] - 'rfxcom:bridge:a99227cd' changed from UNINITIALIZED to INITIALIZING
2017-02-19 12:22:07.679 [hingStatusInfoChangedEvent] - 'rfxcom:bridge:a99227cd' changed from INITIALIZING to OFFLINE
==> openhab.log <==
2017-02-19 12:22:07.766 [ERROR] [g.rfxcom.handler.RFXComBridgeHandler] - Connection to RFXCOM transceiver failed: invalid port
hm, I’m using a raspberry pi so the only suggestion I have left is to check /etc/default/openhab2:
I’ve added this (specifically /dev/ttyUSB0 for rfxcom):
EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB0:/dev/ttyS0:/dev/ttyAMA0:/dev/ttyACM0"
Also added “openhab” to the dialout group in /etc/group.
@james_2_roberts Just reading back up the thread, I see that you tried the paperUI route but you were not able to get it to work due to an ‘invalid port’ error. How exactly did you specify the port? i.e. did you manually install the RFXCom USB Transceiver?
Also, just to make sure that you’ve got all the bases ticked, are you 100% sure you have the port correct and accessible to the openhab user? Have you started openHAB with the port in the environment variable correctly (EXTRA_JAVA_OPTS)?
As Robert says, you can use the 1.8 binding in OH2, if you prefer.
For the OH2 binding, the only other things that I can think of to check are:
Check that the device actually exists at /dev/ttyUSB0 (you can just do a ls -la /dev/ttyUSB0). Frequently with Linux, when you plug/unplug a device, it increments the device port number, hence the reason it is usually easier to use a symlink for the port, so you know what it is going to be every time.
As far as I am aware, the serial bundle should be installed by default. However, it may be worth checking in your karaf that this has actually been installed.
Hi @rtvb , I tried using the 1.9 snapshot and 1.10 snapshots before the 2.0 binding - my preference was to get OH2 up and running “as was” before attempting to migrate to 2.0 bindings - I can’t say I relish migrating the rest of the bindings after the experience so far with rfxcom
I have a “Thermostat3” device that I can control with the RfxCom. Would like to control it with the binding as well. What needs to be done to add an extra device? Just testing? Implementing certain calls? I can both test and program myself.
After a recent update of packages to latest Ubuntu 22.04 version, the RFXCOM driver is no longer working for me using IP (tcpbridge) option.
I can only make the RFXCOM binding work from my Docker container with a direct serial connector. The RFXCOM IP option (tcpbridge) is no longer working for me using a tool like ser2net. Most likely because the JD2XX driver is not available in Linux Ubuntu anymore. @pauli_anttila : Do you know how I can manually add the JD2XX driver to Ubuntu?
See also this post + this post. Scroll to the end of both posts.
It can be reproduced with a clean installation of Ubuntu 22.04. It fails with ser2net regardless of whether Docker is used or not.
Edit: It turned out it was a misconfiguration of the ser2net yml config file. I had added a banner, which should be removed. After that everything works fine.