Openhab 2 with rfxcom 1 binding! (2 did not work at all)

So i tried getting the rfxcom binding for oh 2 to work but it didnt no matter what i did. Now i got the openhab 1 up and running with no errors from the config itself only a small one when creating items.

This is my 3 test items. 1 sensor with 2 outputs and 1 rf socket

Number OutdoorTemperature { rfxcom="<17938:Temperature" }
Number OutdoorHumidity { rfxcom="<17938:Humidity" }
Switch Socket2 {rfxcom=">5571921:Lighting4:PT2262:command"}

And here’s the error

6-11-09 22:44:20.993 [ERROR] [el.item.internal.GenericItemProvider] - Binding configuration of type ‘rfxcom’ of item ‘Socket2’ could not be parsed correctly.
org.eclipse.smarthome.model.item.BindingConfigParseException: RFXCOM out binding second field should contain 2 parts separated by '.'
at org.openhab.core.binding.internal.BindingConfigReaderDelegate.processBindingConfiguration(BindingConfigReaderDelegate.java:50)
at org.eclipse.smarthome.model.item.internal.GenericItemProvider.internalDispatchBindings(GenericItemProvider.java:312)
at org.eclipse.smarthome.model.item.internal.GenericItemProvider.dispatchBindingsPerType(GenericItemProvider.java:268)
at org.eclipse.smarthome.model.item.internal.GenericItemProvider.addBindingConfigReader(GenericItemProvider.java:102)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_101]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)[:1.8.0_101]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)[:1.8.0_101]
at java.lang.reflect.Method.invoke(Unknown Source)[:1.8.0_101]
at org.apache.felix.scr.impl.helper.BaseMethod.invokeMethod(BaseMethod.java:222)[33:org.apache.felix.scr:2.0.2]
at org.apache.felix.scr.impl.helper.BaseMethod.access$500(BaseMethod.java:37)[33:org.apache.felix.scr:2.0.2]
at org.apache.felix.scr.impl.helper.BaseMethod$Resolved.invoke(BaseMethod.java:615)[33:org.apache.felix.scr:2.0.2]
at org.apache.felix.scr.impl.helper.BaseMethod.invoke(BaseMethod.java:499)[33:org.apache.felix.scr:2.0.2]
at org.apache.felix.scr.impl.helper.BindMethod.invoke(BindMethod.java:41)
at org.apache.felix.scr.impl.manager.DependencyManager.doInvokeBindMethod(DependencyManager.java:1660)
at org.apache.felix.scr.impl.manager.DependencyManager.invokeBindMethod(DependencyManager.java:1636)
at org.apache.felix.scr.impl.manager.SingleComponentManager.invokeBindMethod(SingleComponentManager.java:370)[33:org.apache.felix.scr:2.0.2]
at org.apache.felix.scr.impl.manager.DependencyManager$MultipleDynamicCustomizer.addedService(DependencyManager.java:319)
at org.apache.felix.scr.impl.manager.DependencyManager$MultipleDynamicCustomizer.addedService(DependencyManager.java:295)
at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1215)
at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1136)
at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.trackAdding(ServiceTracker.java:945)
at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.track(ServiceTracker.java:881)
at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:1167)
at org.apache.felix.scr.impl.BundleComponentActivator$ListenerInfo.serviceChanged(BundleComponentActivator.java:120)
at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:109)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:914)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:862)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:801)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:127)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:225)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:464)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:482)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:998)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
at org.openhab.core.binding.internal.BindingConfigReaderFactory.registerDelegateService(BindingConfigReaderFactory.java:69)
at org.openhab.core.binding.internal.BindingConfigReaderFactory.activate(BindingConfigReaderFactory.java:38)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_101]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)[:1.8.0_101]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)[:1.8.0_101]
at java.lang.reflect.Method.invoke(Unknown Source)[:1.8.0_101]
at org.apache.felix.scr.impl.helper.BaseMethod.invokeMethod(BaseMethod.java:222)[33:org.apache.felix.scr:2.0.2]
at org.apache.felix.scr.impl.helper.BaseMethod.access$500(BaseMethod.java:37)[33:org.apache.felix.scr:2.0.2]
at org.apache.felix.scr.impl.helper.BaseMethod$Resolved.invoke(BaseMethod.java:615)[33:org.apache.felix.scr:2.0.2]
at org.apache.felix.scr.impl.helper.BaseMethod.invoke(BaseMethod.java:499)[33:org.apache.felix.scr:2.0.2]
at org.apache.felix.scr.impl.helper.ActivateMethod.invoke(ActivateMethod.java:295)[33:org.apache.felix.scr:2.0.2]
at org.apache.felix.scr.impl.manager.SingleComponentManager.createImplementationObject(SingleComponentManager.java:302)[33:org.apache.felix.scr:2.0.2]
at org.apache.felix.scr.impl.manager.SingleComponentManager.createComponent(SingleComponentManager.java:113)[33:org.apache.felix.scr:2.0.2]
at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:866)[33:org.apache.felix.scr:2.0.2]
at org.apache.felix.scr.impl.manager.SingleComponentManager.getServiceInternal(SingleComponentManager.java:833)[33:org.apache.felix.scr:2.0.2]
at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:724)[33:org.apache.felix.scr:2.0.2]
at org.apache.felix.scr.impl.manager.AbstractComponentManager.enable(AbstractComponentManager.java:399)[33:org.apache.felix.scr:2.0.2]
at org.apache.felix.scr.impl.config.ConfigurableComponentHolder.enableComponents(ConfigurableComponentHolder.java:676)[33:org.apache.felix.scr:2.0.2]
at org.apache.felix.scr.impl.BundleComponentActivator.initialEnable(BundleComponentActivator.java:339)[33:org.apache.felix.scr:2.0.2]
at org.apache.felix.scr.impl.Activator.loadComponents(Activator.java:360)[33:org.apache.felix.scr:2.0.2]
at org.apache.felix.scr.impl.Activator.access$000(Activator.java:53)[33:org.apache.felix.scr:2.0.2]
at org.apache.felix.scr.impl.Activator$ScrExtension.start(Activator.java:260)[33:org.apache.felix.scr:2.0.2]
at org.apache.felix.utils.extender.AbstractExtender.createExtension(AbstractExtender.java:259)[33:org.apache.felix.scr:2.0.2]
at org.apache.felix.utils.extender.AbstractExtender.modifiedBundle(AbstractExtender.java:232)[33:org.apache.felix.scr:2.0.2]
at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:482)[org.osgi.core-6.0.0.jar:]
at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:415)[org.osgi.core-6.0.0.jar:]
at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:232)[org.osgi.core-6.0.0.jar:]
at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:444)[org.osgi.core-6.0.0.jar:]
at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:902)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:165)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:75)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:67)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:102)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
at org.eclipse.osgi.container.Module.publishEvent(Module.java:466)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
at org.eclipse.osgi.container.Module.start(Module.java:457)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1562)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]

It doesn’t like the syntax of your configuration string for Socket2. I don’t use this binding so can’t comment on what the problem. I notice in the examples on the wiki they have a “.1” after the first number but have no idea what that means.

The .1 is the unit code - each sensor id can have multiple units associated (16 I think).

The definition has : instead of . between the packet and devices:
Switch Socket2 {rfxcom=">5571921:Lighting4:PT2262:command"}
should read
Switch Socket2 {rfxcom=">5571921:Lighting4.PT2262:command"}

Although the format in the wiki https://github.com/openhab/openhab/wiki/RFXCOM-Binding suggests there should be another element to the 5571921 element.

A bit lower down in that page it describes how to turn on Debugging to find out what the packet.id is… that might be worth a try.

Cheers
James

I managed to get it working (almost). The syntax is VERY case sensitive.
If it helps this is what got me working almost. There is no error in parsing it so i expect it to be fine

Switch Socket2 {rfxcom=">5571921:LIGHTING4.PT2262:Command"}

Now i get another error…

2016-11-10 12:59:08.280 [WARN ] [inding.rfxcom.internal.RFXComBinding] - RFXCom controller is not connected

It says

2016-11-10 12:55:55.333 [INFO ] [ing.rfxcom.internal.RFXComConnection] - Connecting to RFXCOM [serialPort=‘COM5’ ].

with no errors at the top of the log. It gives me this error when i try to use the item

@Kai Do you know anything about this, or could you tell me who made the binding? Seems like very few people know anything about rfxcom

That’s me :blush: I have tested RFXCOM 1.0 binding 1,5 years ago together with OH2, without any problems. OH2 have been changed a lot since that. I still use OH1 as my stable system and OH2 with RFXCOM 2.0 binding for development.

To be able to help, you should enable debug logging to get more information. Does temperature and humidity sensor work?

Although there were hardly any changes wrt the 1.x compat layer - so if it worked once, I would expect it to still work unless there were changes in the 1.x binding itself.

The 1.9 binding works fine for me on OH2 with some Somfy blinds and an Owl power monitor (I had difficulties getting the blinds control to work with the 2.0 binding).

@Oliver_Roed_Scholer Are you sure that your com port has not changed? If you are on a linux box, the com port may change if you plug/unplug, hence it may be easier to use symlinks (e.g. https://github.com/openhab/openhab/wiki/symlinks).

I see you did some more coding on the OH2.0 addon. For me most of the things are workin now.(sometimes a connection error) Can you take a look at my issue: https://github.com/openhab/openhab2-addons/issues/1305

@pauli_anttila No the temperature and humidity doesnt work. I enabled debug logging for the rfxcom binding and all it gives me is

2016-11-10 21:52:14.866 [WARN ] [inding.rfxcom.internal.RFXComBinding] - RFXCom controller is not connected

The exact same thing the normal log tells me.

The com port doesnt change. Doesnt matter how many times i plug it in or unplug it always show up as com5. Also im on windows server 2012. I dont see why symlinks would make a difference

Com port changing is more a linux issue, and so symlinks can be used to provide a constant com port name. As you are on Windows, this does not apply to you.

@pauli_anttila @Kai I have the binding in \openhab2\addons and i manually added a openhab.cfg file in \conf\services where i have this

############## RFXCOM Binding ###################

Serial port of RFXCOM interface

rfxcom:serialPort=COM5

Set mode command for controller (optional)

rfxcom:setMode=0D0000020353000800240000

I read in some other threads that the serial binding is required and i installed that (fixed many errors) so the only error left is rfxcom is not connected. Am i not seeing some steps here?

Thermostat1 messages doesn’t support battery level, which channels are accidentally added to Thermostat1 message handler. Just created PR to fix this issue.

@Oliver_Roed_Scholer, could you still paste you logs with debug level? Do you see “Reset controller” log message. If not then problem is that binding can’t open the serial port. Which windows version are you using?

There is some more errors this time for some reason. Its too big to post on pastebin so i uploaded it to google drive.

https://drive.google.com/open?id=0Bz2l6T6MKIoVVkVJeUdicVg4Ymc

I am using Windows server 2012 R2

Edit: i think it deletes some of the log when it reaches a limit. Started server again and uploaded new log

Could not find any debug messages from rfxcom binding from your log.

Are you sure? This is a screenshot from the one i uploaded on drive

Seems like serious errors that disables the binding

There is only one log message from rfxcom binding and it’s from INFO level. If DEBUG level is enabled for rfxcom binding, there should be some messages before and after connection.

Java doesn’t have native support for serial port communication, so openhab is using nrjavaserial library to provide serial communication. I’m not surprised if Windows Server 2012 is not supported by the lib.

Tried running it on a windows 10. No difference still says its not connected so i dont think its the librarys fault. Im really stuck getting this to work