RFXCOM 2.0 binding

I’ve tried to get rfxcom binding working with the latest OH2 snapshot. I’ve tried to configure it both using a things file and through the paperUI manual configuration. It does not work in either case. I cannot.use discovery since I have to have the FTDI drivers installed for my mysensors gateway to work. My things file look like this:

Bridge rfxcom:bridge:rfxtrx [ serialPort="/dev/rfxtrxUSB" ] {
}

The log does not give any good description of what is wrong, but this is what I have been able to discover:

One point that might be interesting finding the issue with the rfxcom binding is that when I initialising as the first binding I get the simple error message:

15:59:14.740 [DEBUG] [g.rfxcom.handler.RFXComBridgeHandler] - Checking RFXCOM transceiver connection, thing status = OFFLINE
15:59:14.741 [DEBUG] [g.rfxcom.handler.RFXComBridgeHandler] - Connecting to RFXCOM transceiver
15:59:14.741 [DEBUG] [rnal.connector.RFXComSerialConnector] - Disconnecting
15:59:14.741 [DEBUG] [rnal.connector.RFXComSerialConnector] - Closed
15:59:14.777 [ERROR] [g.rfxcom.handler.RFXComBridgeHandler] - Connection to RFXCOM transceiver failed: null

However, as soon as I install the mysensor binding the error changes to this:

16:00:11.205 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'mysensors.things'
16:00:11.232 [INFO ] [smarthome.event.ThingAddedEvent     ] - Thing 'mysensors:bridge-ser:gateway' has been added.
16:00:11.256 [INFO ] [me.event.ThingStatusInfoChangedEvent] - 'mysensors:bridge-ser:gateway' changed from UNINITIALIZED to INITIALIZING
16:00:11.294 [INFO ] [me.event.ThingStatusInfoChangedEvent] - 'mysensors:bridge-ser:gateway' changed from INITIALIZING to ONLINE
16:00:11.295 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'mysensors.things'
16:00:13.637 [WARN ] [essage.ApplicationUpdateMessageClass] - Got ApplicationUpdateMessage without request, ignoring. Last message was SendData.
16:00:14.740 [DEBUG] [g.rfxcom.handler.RFXComBridgeHandler] - Checking RFXCOM transceiver connection, thing status = OFFLINE
16:00:14.740 [DEBUG] [g.rfxcom.handler.RFXComBridgeHandler] - Connecting to RFXCOM transceiver
16:00:14.741 [DEBUG] [rnal.connector.RFXComSerialConnector] - Disconnecting
16:00:14.741 [DEBUG] [rnal.connector.RFXComSerialConnector] - Closed
RXTX fhs_lock() Error: opening lock file: /var/lock/LCK..mysensorsUSB: File exists. It is mine

eP$ testRead() Lock file failed
16:00:14.742 [ERROR] [g.rfxcom.handler.RFXComBridgeHandler] - Connection to RFXCOM transceiver failed: null

I initially thought this was related to the lock file as indicated by the second batch of log messages, so there is an issue open for it here with all the details: https://github.com/openhab/openhab2-addons/issues/671

Are there any plans to add support for the newer types soon? (e.g., Chime support which is currently lacking)

Thanks in advance

Hi Guys,

Does any one have any working examples for setting up a ‘BLINDS1’ item, together with commands. The new documentation for this binding is still a little short of detail, i.e no examples.

I have been working with RFXcom to get the tranceiver to talk to my Motorlux blind motors and as of today this is now working. :slight_smile:

Now I an starting to work on getting openHAB 2 to talk to the RFXcom transceiver and some examples for the OH2 binding would be really helpful.

Thanks,
Mike

Further to my last message…

I now have the RFXCOM transceiver set up on openHAB 2 as a thing. Where I need guidance is the correct syntax for setting up items and then sending commands via the binding.

Following is what the the RFXmngr outputs when a command is sent to my test blind from RFXmngr.

Details of the RFXtrx433 after discovery in the Paper UI are as follows.

Any help would be greatly appreciated.

Cheers,
Mike

In my item file I have tried the following options (plus many more) but no success yet:

Rollershutter BR_Blind "MAIN BLIND" (GF_Mancave) {channel = "rfxcom:RFXtrx433:A18RHMF:Shutter " }

This item at least links to the RFXtrx433, but did nothing, I guess mainly due to the fact that there is no addressing info for the blind motor.

Rollershutter BR_Blind "Main Blind" (GF_Mancave) { rfxcom = ">0.0.1.1:Blinds1.A-OK_AC114:Shutter" }

This at least sends the commands from the UI, but no action from the transceiver.

I am sure my problem is just a syntax issue, but with no examples I am struggling to solve my issue.

Any help or advice would be appreciated.

Did you try this:

Edit: here are some more examples:

Thanks for the reply and yes I did look at this.

The ID code is: 00 00 01 which is “1” in decimal and same for the unit code which is also “1”, so no conversion needed.

I also saw the other post and have tried various combinations including the following:

Rollershutter BR_Blind "Main Blind" (GF_Mancave) { rfxcom = ">1.1:BLINDS1.A-OK AC114:Shutter" }

Rollershutter BR_Blind "Main Blind" (GF_Mancave) { rfxcom = ">1.1:BLINDS1.A-OK_AC114:Shutter" }

Rollershutter BR_Blind "Main Blind" (GF_Mancave) { rfxcom = ">1.1:BLINDS1.AC114:Shutter" }

I am starting to wonder if the issue is the space in “A-OK AC114” as this is what the screen on RFXmngr shows after a transmission, but I am not seeing any error messages in the OH2 log using log:tail.

I also just tried the following (from the post linked above) and go not response from the transceiver (watching the LED’s for activity): Note: the unit is showing as ONLINE in the Paper UI.

Rollershutter rsCurtain_BR "Curtains" (GF_Mancave) { rfxcom=">1.1:BLINDS1.DC106:Shutter" }

Could the issue be associated with the fact that the RFXtrx device was set up using the Paper UI using discovery. Do I need to manually set it up in the things file?

I might try a manual setup of the “thing” later tonight based on the following “only” example from the documentation for the binding:

Bridge rfxcom:bridge:usb0 [ serialPort="/dev/tty.usbserial-06VVEG1Y" ] {
    Thing lighting2 100001_1 [deviceId="100001.1", subType="AC"]
}

However this defeats the purpose of the discovery function in the Paper UI.

OK, after 3 days of frustration and trying many different options, I now have this working (all configured via the Paper UI and sorry the process was not obvious!!). :sweat:

I still have a few gremlins to sort out, but when I am done I will document my findings here to help anyone who also wants to go down this path. This info may also be useful to add to the documentation for the binding.

1 Like

Any dokumentation on the Rfxcom setup process?

I’ve just managed to set up the rfxcom on my pi.

After many failed attempts to get it working I checked and the openhab service is started as the openhab user, which doesnt have access to /dev/ttyUSB0
Add it to the correct group and it should start working.

Hopefully that helps.

Hi,

I’m trying my best to get to grips with Raspberry Pi & OpenHAB. How do I add /dev/ttyUSB0 to the correct group?

Thanks.

Run this: sudo usermod openhab -a -G dialout

Then restart the openhab service and watch the log, you should see if confirm that it finds the RFXCOM

I’ve the same issue and added openhab to group dailout. That doesn’t work for me and i get the ERROR

[ERROR] [g.rfxcom.handler.RFXComBridgeHandler] - Connection to RFXCOM transceiver failed
java.io.IOException: device not found (2)

OH throws an exception during discovery:

2016-11-08 16:56:14.114 [ERROR] [rnal.discovery.RFXComBridgeDiscovery] - Error occured during discovery
java.io.IOException: device not found (2)
        at jd2xx.JD2XX.listDevices(Native Method)
        at jd2xx.JD2XX.listDevicesByDescription(JD2XX.java:826)


Greatings Peter

I’ve also tried this, but get the following exception:

2016-11-18 20:58:33.321 [ERROR] [g.rfxcom.handler.RFXComBridgeHandler] - Connection to RFXCOM transceiver failed
java.io.IOException: device not opened (3)
	at jd2xx.JD2XX.openEx(Native Method)[205:org.openhab.binding.rfxcom:2.0.0.201611161557]
	at jd2xx.JD2XX.openBySerialNumber(JD2XX.java:806)[205:org.openhab.binding.rfxcom:2.0.0.201611161557]
	at org.openhab.binding.rfxcom.internal.connector.RFXComJD2XXConnector.connect(RFXComJD2XXConnector.java:49)[205:org.openhab.binding.rfxcom:2.0.0.201611161557]
	at org.openhab.binding.rfxcom.handler.RFXComBridgeHandler.connect(RFXComBridgeHandler.java:167)[205:org.openhab.binding.rfxcom:2.0.0.201611161557]
	at org.openhab.binding.rfxcom.handler.RFXComBridgeHandler.access$8(RFXComBridgeHandler.java:142)[205:org.openhab.binding.rfxcom:2.0.0.201611161557]
	at org.openhab.binding.rfxcom.handler.RFXComBridgeHandler$1.run(RFXComBridgeHandler.java:115)[205:org.openhab.binding.rfxcom:2.0.0.201611161557]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_101]
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)[:1.8.0_101]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)[:1.8.0_101]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)[:1.8.0_101]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_101]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_101]
	at java.lang.Thread.run(Thread.java:745)[:1.8.0_101]

Cheers
James

@james_2_roberts: Linux have native FTDI drivers, which prevent JD2XX driver to open device. You should add manually “RFXCOM USB Transceiver” which use traditional serial port driver rather than JD2XX.

As many user struggles with this “device not open (3)” error, I’m planning to add following information to log.

2016-11-19 12:25:49.330 [ERROR] [.r.handler.RFXComBridgeHandler:217 ] - Connection to RFXCOM transceiver failed, reason java.io.IOException: device not opened (3)
at jd2xx.JD2XX.openEx(Native Method)
at jd2xx.JD2XX.openBySerialNumber(JD2XX.java:806)
at org.openhab.binding.rfxcom.internal.connector.RFXComJD2XXConnector.connect(RFXComJD2XXConnector.java:49)
at org.openhab.binding.rfxcom.handler.RFXComBridgeHandler.connect(RFXComBridgeHandler.java:162)
at org.openhab.binding.rfxcom.handler.RFXComBridgeHandler.access$8(RFXComBridgeHandler.java:142)
at org.openhab.binding.rfxcom.handler.RFXComBridgeHandler$1.run(RFXComBridgeHandler.java:115)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

2016-11-19 12:25:49.331 [INFO ] [.r.handler.RFXComBridgeHandler:220 ] - Automatically Discovered RFXCOM bridges use FTDI chip driver (D2XX). Reason for this error normally is related to operating system native FTDI drivers, which prevent D2XX driver to open device. To solve this problem, uninstall OS FTDI native drivers or add manually universal bridge ‘RFXCOM USB Transceiver’, which use normal serial port driver rather than D2XX.

Could this help user to understand the reason for the error and how to solve it?

I updated to the newest SNAPSHOT, rfxcom is working nice. It discovers new items, but when i try to add from the inbox to my things i get a error:

17:15:04.155 [INFO ] [me.event.ThingStatusInfoChangedEvent] - 'rfxcom:lighting1:ac76c43e:A_1' changed from UNINITIALIZED to INITIALIZING
17:15:04.174 [INFO ] [me.event.ThingStatusInfoChangedEvent] - 'rfxcom:lighting1:ac76c43e:A_1' changed from INITIALIZING to UNINITIALIZED (HANDLER_INITIALIZING_ERROR): org.eclipse.smarthome.core.thing.Bridge.getHandler()Lorg/eclipse/smarthome/core/thing/binding/BridgeHandler;
17:15:04.172 [ERROR] [ome.core.thing.internal.ThingManager] - Exception occured while initializing handler of thing 'rfxcom:lighting1:ac76c43e:A_1': java.lang.NoSuchMethodError: org.eclipse.smarthome.core.thing.Bridge.getHandler()Lorg/eclipse/smarthome/core/thing/binding/BridgeHandler;
java.util.concurrent.ExecutionException: java.lang.NoSuchMethodError: org.eclipse.smarthome.core.thing.Bridge.getHandler()Lorg/eclipse/smarthome/core/thing/binding/BridgeHandler;
        at java.util.concurrent.FutureTask.report(FutureTask.java:122)[:1.8.0_111]
        at java.util.concurrent.FutureTask.get(FutureTask.java:206)[:1.8.0_111]
        at org.eclipse.smarthome.core.common.SafeMethodCaller.callAsynchronous(SafeMethodCaller.java:186)[98:org.eclipse.smarthome.core:0.9.0.201611102032]
        at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:79)[98:org.eclipse.smarthome.core:0.9.0.201611102032]
        at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:63)[98:org.eclipse.smarthome.core:0.9.0.201611102032]
        at org.eclipse.smarthome.core.thing.internal.ThingManager$9.run(ThingManager.java:761)[105:org.eclipse.smarthome.core.thing:0.9.0.201611102032]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_111]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_111]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)[:1.8.0_111]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)[:1.8.0_111]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_111]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_111]
        at java.lang.Thread.run(Thread.java:745)[:1.8.0_111]
Caused by: java.lang.NoSuchMethodError: org.eclipse.smarthome.core.thing.Bridge.getHandler()Lorg/eclipse/smarthome/core/thing/binding/BridgeHandler;
        at org.openhab.binding.rfxcom.handler.RFXComHandler.initialize(RFXComHandler.java:110)
        at org.eclipse.smarthome.core.thing.internal.ThingManager$9$1.call(ThingManager.java:764)
        at org.eclipse.smarthome.core.thing.internal.ThingManager$9$1.call(ThingManager.java:1)
        at org.eclipse.smarthome.core.common.SafeMethodCaller$CallableWrapper.call(SafeMethodCaller.java:177)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_111]
        ... 3 more

Hi Pauli,

It helps understand the problem, it doesn’t help me understand what I need to do:

  1. Uninstall native OS FTDI drivers - I assume there’ll be implications with this?
  2. Add it manually - presumably as a thing, this would be my prefered option, however, the only details I have are those which were those auto-discovered which I assume would need to be different - .things file:
Bridge rfxcom:bridge:usb0 [ serialPort="/dev/tty.usbserial-06VVEG1Y" ]

Thanks
James

@james_2_roberts you can add the bridge (RFXCOM USB Transceiver) via Paper UI, its about 3/4 of the way down the list under “add manually” option from the inbox screen