RFXCOM Cheap PIR Sensor Binding in Openhab2

I changed it to that new style. This is where I am now.

09:39:48.214 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'Switch_C' received command OFF
09:39:48.219 [INFO ] [ome.core.thing.internal.ThingManager] - Not delegating command 'OFF' for item 'Switch_C' to handler for channel 'rfxcom:lighting4:238adf67:17733:command', because handler is not initialized (thing must be in status UNKNOWN, ONLINE or OFFLINE).
09:39:48.221 [INFO ] [ome.core.thing.internal.ThingManager] - Not delegating update 'OFF' for item 'Switch_C' to handler for channel 'rfxcom:lighting4:238adf67:17733:command', because handler is not initialized (thing must be in status UNKNOWN, ONLINE or OFFLINE).

When I press the original remote:

09:40:06.521 [DEBUG] [g.rfxcom.handler.RFXComBridgeHandler] - Message received: Raw data = 09130000044551013970, Packet type = LIGHTING4, Seq number = 0, Sub type = PT2262, Device Id = 17493, Command = ON_1(1), Pulse = 313
09:40:06.522 [WARN ] [mon.registry.AbstractManagedProvider] - Could not update element with key rfxcom:lighting4:238adf67:17493 in ManagedThingProvider, because it does not exists.

My config now:
Things

Bridge rfxcom:bridge:238adf67 [ serialPort="COM3" ] {
	Thing lighting4 17493 [deviceId="17493", subType="PT2262"]
	Thing lighting4 17685 [deviceId="17685", subType="PT2262"]
    Thing lighting4 17733 [deviceId="17733", subType="PT2262"]
    Thing lighting4 17745 [deviceId="17745", subType="PT2262"]
}

Items

Switch Switch_A { channel="rfxcom:lighting4:238adf67:17493:command" }
Switch Switch_B { channel="rfxcom:lighting4:238adf67:17685:command" }
Switch Switch_C { channel="rfxcom:lighting4:238adf67:17733:command" }
Switch Switch_D { channel="rfxcom:lighting4:238adf67:17745:command" }

Iā€™m not at home now but you can try whether you can see newly added item via the paperUI at the list of things.

Also you can check if errors occur during loading the updated things file, so update things file and in the meanwhile monitor the log for any errors or warnings.

Did you maybe create you two bridges which both connect to the same com-port?

One via the paper-ui and one via the text config?

Hmm alright that doesnā€™t look too good.

10:53:03.999 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'home.things'
10:53:04.000 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'home.things' is either empty or cannot be parsed correctly!
10:53:04.002 [ERROR] [.core.internal.folder.FolderObserver] - Error handling update of file 'C:\openHAB2\conf\things\home.things': null.
java.lang.NullPointerException
        at org.eclipse.smarthome.model.thing.internal.GenericThingProvider.getAllThingUIDs(GenericThingProvider.java:929)[133:org.eclipse.smarthome.model.thing:0.9.0.b4]
        at org.eclipse.smarthome.model.thing.internal.GenericThingProvider.modelChanged(GenericThingProvider.java:884)[133:org.eclipse.smarthome.model.thing:0.9.0.b4]
        at org.eclipse.smarthome.model.core.internal.ModelRepositoryImpl.notifyListeners(ModelRepositoryImpl.java:207)[122:org.eclipse.smarthome.model.core:0.9.0.b4]
        at org.eclipse.smarthome.model.core.internal.ModelRepositoryImpl.addOrRefreshModel(ModelRepositoryImpl.java:120)[122:org.eclipse.smarthome.model.core:0.9.0.b4]
        at org.eclipse.smarthome.model.core.internal.folder.FolderObserver.checkFile(FolderObserver.java:272)[122:org.eclipse.smarthome.model.core:0.9.0.b4]
        at org.eclipse.smarthome.model.core.internal.folder.FolderObserver.access$1(FolderObserver.java:265)[122:org.eclipse.smarthome.model.core:0.9.0.b4]
        at org.eclipse.smarthome.model.core.internal.folder.FolderObserver$WatchQueueReader.processWatchEvent(FolderObserver.java:146)[122:org.eclipse.smarthome.model.core:0.9.0.b4]
        at org.eclipse.smarthome.core.service.AbstractWatchQueueReader.run(AbstractWatchQueueReader.java:122)[98:org.eclipse.smarthome.core:0.9.0.b4]
        at java.lang.Thread.run(Unknown Source)[:1.8.0_121]
10:53:04.026 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'home.things'
10:53:04.034 [DEBUG] [g.rfxcom.handler.RFXComBridgeHandler] - Handler disposed.
10:53:04.035 [DEBUG] [rnal.connector.RFXComSerialConnector] - Disconnecting
10:53:04.042 [DEBUG] [rnal.connector.RFXComSerialConnector] - Serial port event listener stopped
10:53:04.042 [DEBUG] [rnal.connector.RFXComSerialConnector] - Interrupt serial listener
10:53:04.042 [DEBUG] [rnal.connector.RFXComSerialConnector] - Close serial out stream
10:53:04.043 [DEBUG] [rnal.connector.RFXComSerialConnector] - Close serial in stream
10:53:04.043 [DEBUG] [rnal.connector.RFXComSerialConnector] - Close serial port
10:53:09.035 [ERROR] [ome.core.thing.internal.ThingManager] - Exception occured while calling thing updated at ThingHandler 'org.openhab.binding.rfxcom.handler.RFXComBridgeHandler@be6d06': null
java.util.concurrent.TimeoutException
        at java.util.concurrent.FutureTask.get(Unknown Source)[:1.8.0_121]
        at org.eclipse.smarthome.core.common.SafeMethodCaller.callAsynchronous(SafeMethodCaller.java:188)[98:org.eclipse.smarthome.core:0.9.0.b4]
        at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:81)[98:org.eclipse.smarthome.core:0.9.0.b4]
        at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:65)[98:org.eclipse.smarthome.core:0.9.0.b4]
        at org.eclipse.smarthome.core.thing.internal.ThingManager.thingUpdated(ThingManager.java:518)[105:org.eclipse.smarthome.core.thing:0.9.0.b4]
        at org.eclipse.smarthome.core.thing.internal.ThingRegistryImpl.notifyTrackers(ThingRegistryImpl.java:227)[105:org.eclipse.smarthome.core.thing:0.9.0.b4]
        at org.eclipse.smarthome.core.thing.internal.ThingRegistryImpl.notifyListenersAboutUpdatedElement(ThingRegistryImpl.java:150)[105:org.eclipse.smarthome.core.thing:0.9.0.b4]
        at org.eclipse.smarthome.core.thing.internal.ThingRegistryImpl.notifyListenersAboutUpdatedElement(ThingRegistryImpl.java:1)[105:org.eclipse.smarthome.core.thing:0.9.0.b4]
        at org.eclipse.smarthome.core.common.registry.AbstractRegistry.updated(AbstractRegistry.java:167)[98:org.eclipse.smarthome.core:0.9.0.b4]
        at org.eclipse.smarthome.core.common.registry.AbstractProvider.notifyListeners(AbstractProvider.java:57)[98:org.eclipse.smarthome.core:0.9.0.b4]
        at org.eclipse.smarthome.core.common.registry.AbstractProvider.notifyListenersAboutUpdatedElement(AbstractProvider.java:82)[98:org.eclipse.smarthome.core:0.9.0.b4]
        at org.eclipse.smarthome.model.thing.internal.GenericThingProvider.access$4(GenericThingProvider.java:1)[133:org.eclipse.smarthome.model.thing:0.9.0.b4]
        at org.eclipse.smarthome.model.thing.internal.GenericThingProvider$21.accept(GenericThingProvider.java:1044)[133:org.eclipse.smarthome.model.thing:0.9.0.b4]
        at org.eclipse.smarthome.model.thing.internal.GenericThingProvider$21.accept(GenericThingProvider.java:1)[133:org.eclipse.smarthome.model.thing:0.9.0.b4]
        at java.util.ArrayList.forEach(Unknown Source)[:1.8.0_121]
        at org.eclipse.smarthome.model.thing.internal.GenericThingProvider.createThingsFromModelForThingHandlerFactory(GenericThingProvider.java:1054)[133:org.eclipse.smarthome.model.thing:0.9.0.b4]
        at org.eclipse.smarthome.model.thing.internal.GenericThingProvider.access$1(GenericThingProvider.java:1008)[133:org.eclipse.smarthome.model.thing:0.9.0.b4]
        at org.eclipse.smarthome.model.thing.internal.GenericThingProvider$1$1.accept(GenericThingProvider.java:236)[133:org.eclipse.smarthome.model.thing:0.9.0.b4]
        at org.eclipse.smarthome.model.thing.internal.GenericThingProvider$1$1.accept(GenericThingProvider.java:1)[133:org.eclipse.smarthome.model.thing:0.9.0.b4]
        at java.util.concurrent.ConcurrentHashMap$KeySetView.forEach(Unknown Source)[:1.8.0_121]
        at org.eclipse.smarthome.model.thing.internal.GenericThingProvider$1.apply(GenericThingProvider.java:239)[133:org.eclipse.smarthome.model.thing:0.9.0.b4]
        at org.eclipse.smarthome.model.thing.internal.GenericThingProvider$1.apply(GenericThingProvider.java:1)[133:org.eclipse.smarthome.model.thing:0.9.0.b4]
        at org.eclipse.smarthome.config.core.BundleProcessorVetoManager.applyActionFor(BundleProcessorVetoManager.java:121)[94:org.eclipse.smarthome.config.core:0.9.0.b4]
        at org.eclipse.smarthome.model.thing.internal.GenericThingProvider$6.accept(GenericThingProvider.java:320)[133:org.eclipse.smarthome.model.thing:0.9.0.b4]
        at org.eclipse.smarthome.model.thing.internal.GenericThingProvider$6.accept(GenericThingProvider.java:1)[133:org.eclipse.smarthome.model.thing:0.9.0.b4]
        at java.lang.Iterable.forEach(Unknown Source)[:1.8.0_121]
        at org.eclipse.smarthome.model.thing.internal.GenericThingProvider.createThingsFromModel(GenericThingProvider.java:323)[133:org.eclipse.smarthome.model.thing:0.9.0.b4]
        at org.eclipse.smarthome.model.thing.internal.GenericThingProvider.modelChanged(GenericThingProvider.java:870)[133:org.eclipse.smarthome.model.thing:0.9.0.b4]
        at org.eclipse.smarthome.model.core.internal.ModelRepositoryImpl.notifyListeners(ModelRepositoryImpl.java:207)[122:org.eclipse.smarthome.model.core:0.9.0.b4]
        at org.eclipse.smarthome.model.core.internal.ModelRepositoryImpl.addOrRefreshModel(ModelRepositoryImpl.java:99)[122:org.eclipse.smarthome.model.core:0.9.0.b4]
        at org.eclipse.smarthome.model.core.internal.folder.FolderObserver.checkFile(FolderObserver.java:272)[122:org.eclipse.smarthome.model.core:0.9.0.b4]
        at org.eclipse.smarthome.model.core.internal.folder.FolderObserver.access$1(FolderObserver.java:265)[122:org.eclipse.smarthome.model.core:0.9.0.b4]
        at org.eclipse.smarthome.model.core.internal.folder.FolderObserver$WatchQueueReader.processWatchEvent(FolderObserver.java:146)[122:org.eclipse.smarthome.model.core:0.9.0.b4]
        at org.eclipse.smarthome.core.service.AbstractWatchQueueReader.run(AbstractWatchQueueReader.java:122)[98:org.eclipse.smarthome.core:0.9.0.b4]
        at java.lang.Thread.run(Unknown Source)[:1.8.0_121]
10:53:09.037 [INFO ] [smarthome.event.ThingUpdatedEvent   ] - Thing 'rfxcom:bridge:238adf67' has been updated.
10:53:09.038 [INFO ] [smarthome.event.ThingUpdatedEvent   ] - Thing 'rfxcom:lighting4:238adf67:17493' has been updated.
10:53:09.039 [INFO ] [smarthome.event.ThingUpdatedEvent   ] - Thing 'rfxcom:lighting4:238adf67:17685' has been updated.
10:53:09.040 [INFO ] [smarthome.event.ThingUpdatedEvent   ] - Thing 'rfxcom:lighting4:238adf67:17733' has been updated.
10:53:09.040 [INFO ] [smarthome.event.ThingUpdatedEvent   ] - Thing 'rfxcom:lighting4:238adf67:17745' has been updated.

Yes I can see the things as ā€˜uninitializedā€™ in Paper UI, and my bridge is ā€˜onlineā€™. I removed the bridge and other items that were added through paper UI before.

First thank you @martinvw for your efforts on this! Good work!

I had some time to test this today. I had the similar problems that @westward had - so I had to add the bridge first manually to Things file and after that I could add bridge also manually from PaperUI, but after that seems to work ok.

Of course I had to discover all Ligthning4 things again, because the device id changes. Everything seems to work ok. I will run this binding on my production openhab also for few days and report if I see issues.

One question about the device id. If I have this in rfxmgr:

Packettype    = Lighting4
subtype       = PT2262
Sequence nbr  = 78
Code          = E00021 decimal:14680097
S1- S24  = 1110 0000 0000 0000 0010 0001 
Pulse         = 362 usec
Signal level  = 7  -64dBm

What is the device id? I read the code, but bitwise operations are not things that I read fluently :slight_smile:

I would just use the debug logging for rfxcom or the inbox, you can not easily say it without having the raw message. I think the rfxmgr defines something else as the device-id then the binding does.

Some options I can think of now without having a proper computer (working from the computer of my father in law):

  • Maybe youā€™r not allowed to have a name with only numbersā€¦?
  • Can you rename the 238adf67 and check whether that one still appears online, maybe you now two with the same name.
  • Try with a minimal sample.

If we have this working we should definitely update the readme Iā€™ll try to make some time for that this weekend.

I renamed ā€˜238adf67ā€™ in things and items to ā€˜usb0ā€™. I see it changed in Paper UI and there is still only one rfxcom transceiver listed. So that seems to be OK.

Keeps saying ā€˜handler is not initializedā€™ in the logs when I use the switch from the sitemap.

okay and changing the all numeric thing idā€™s to eg switch_17493

And you could ofcourse try to restart openHAB if you did not yet do thatā€¦

11:41:01.011 [ERROR] [.core.internal.folder.FolderObserver] - Error handling update of file 'C:\openHAB2\conf\things\home.things': null.
java.lang.NullPointerException
        at org.eclipse.smarthome.model.thing.internal.GenericThingProvider.getAllThingUIDs(GenericThingProvider.java:929)[133:org.eclipse.smarthome.model.thing:0.9.0.b4]
        at org.eclipse.smarthome.model.thing.internal.GenericThingProvider.modelChanged(GenericThingProvider.java:884)[133:org.eclipse.smarthome.model.thing:0.9.0.b4]
        at org.eclipse.smarthome.model.core.internal.ModelRepositoryImpl.notifyListeners(ModelRepositoryImpl.java:207)[122:org.eclipse.smarthome.model.core:0.9.0.b4]
        at org.eclipse.smarthome.model.core.internal.ModelRepositoryImpl.addOrRefreshModel(ModelRepositoryImpl.java:120)[122:org.eclipse.smarthome.model.core:0.9.0.b4]
        at org.eclipse.smarthome.model.core.internal.folder.FolderObserver.checkFile(FolderObserver.java:272)[122:org.eclipse.smarthome.model.core:0.9.0.b4]
        at org.eclipse.smarthome.model.core.internal.folder.FolderObserver.access$1(FolderObserver.java:265)[122:org.eclipse.smarthome.model.core:0.9.0.b4]
        at org.eclipse.smarthome.model.core.internal.folder.FolderObserver$WatchQueueReader.processWatchEvent(FolderObserver.java:146)[122:org.eclipse.smarthome.model.core:0.9.0.b4]
        at org.eclipse.smarthome.core.service.AbstractWatchQueueReader.run(AbstractWatchQueueReader.java:122)[98:org.eclipse.smarthome.core:0.9.0.b4]
        at java.lang.Thread.run(Unknown Source)[:1.8.0_121]
11:41:01.020 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'home.things'
11:41:01.028 [DEBUG] [g.rfxcom.handler.RFXComBridgeHandler] - Handler disposed.
11:41:01.029 [DEBUG] [rnal.connector.RFXComSerialConnector] - Disconnecting
11:41:01.029 [DEBUG] [rnal.connector.RFXComSerialConnector] - Serial port event listener stopped
11:41:01.029 [DEBUG] [rnal.connector.RFXComSerialConnector] - Interrupt serial listener
11:41:01.029 [DEBUG] [rnal.connector.RFXComSerialConnector] - Close serial out stream
11:41:01.029 [DEBUG] [rnal.connector.RFXComSerialConnector] - Close serial in stream
11:41:01.030 [DEBUG] [rnal.connector.RFXComSerialConnector] - Close serial port
11:41:06.029 [ERROR] [ome.core.thing.internal.ThingManager] - Exception occured while calling thing updated at ThingHandler 'org.openhab.binding.rfxcom.handler.RFXComBridgeHandler@1bfa484': null
java.util.concurrent.TimeoutException
        at java.util.concurrent.FutureTask.get(Unknown Source)[:1.8.0_121]
        at org.eclipse.smarthome.core.common.SafeMethodCaller.callAsynchronous(SafeMethodCaller.java:188)[98:org.eclipse.smarthome.core:0.9.0.b4]
        at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:81)[98:org.eclipse.smarthome.core:0.9.0.b4]
        at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:65)[98:org.eclipse.smarthome.core:0.9.0.b4]
        at org.eclipse.smarthome.core.thing.internal.ThingManager.thingUpdated(ThingManager.java:518)[105:org.eclipse.smarthome.core.thing:0.9.0.b4]
        at org.eclipse.smarthome.core.thing.internal.ThingRegistryImpl.notifyTrackers(ThingRegistryImpl.java:227)[105:org.eclipse.smarthome.core.thing:0.9.0.b4]
        at org.eclipse.smarthome.core.thing.internal.ThingRegistryImpl.notifyListenersAboutUpdatedElement(ThingRegistryImpl.java:150)[105:org.eclipse.smarthome.core.thing:0.9.0.b4]
        at org.eclipse.smarthome.core.thing.internal.ThingRegistryImpl.notifyListenersAboutUpdatedElement(ThingRegistryImpl.java:1)[105:org.eclipse.smarthome.core.thing:0.9.0.b4]
        at org.eclipse.smarthome.core.common.registry.AbstractRegistry.updated(AbstractRegistry.java:167)[98:org.eclipse.smarthome.core:0.9.0.b4]
        at org.eclipse.smarthome.core.common.registry.AbstractProvider.notifyListeners(AbstractProvider.java:57)[98:org.eclipse.smarthome.core:0.9.0.b4]
        at org.eclipse.smarthome.core.common.registry.AbstractProvider.notifyListenersAboutUpdatedElement(AbstractProvider.java:82)[98:org.eclipse.smarthome.core:0.9.0.b4]
        at org.eclipse.smarthome.model.thing.internal.GenericThingProvider.access$4(GenericThingProvider.java:1)[133:org.eclipse.smarthome.model.thing:0.9.0.b4]
        at org.eclipse.smarthome.model.thing.internal.GenericThingProvider$21.accept(GenericThingProvider.java:1044)[133:org.eclipse.smarthome.model.thing:0.9.0.b4]
        at org.eclipse.smarthome.model.thing.internal.GenericThingProvider$21.accept(GenericThingProvider.java:1)[133:org.eclipse.smarthome.model.thing:0.9.0.b4]
        at java.util.ArrayList.forEach(Unknown Source)[:1.8.0_121]
        at org.eclipse.smarthome.model.thing.internal.GenericThingProvider.createThingsFromModelForThingHandlerFactory(GenericThingProvider.java:1054)[133:org.eclipse.smarthome.model.thing:0.9.0.b4]
        at org.eclipse.smarthome.model.thing.internal.GenericThingProvider.access$1(GenericThingProvider.java:1008)[133:org.eclipse.smarthome.model.thing:0.9.0.b4]
        at org.eclipse.smarthome.model.thing.internal.GenericThingProvider$1$1.accept(GenericThingProvider.java:236)[133:org.eclipse.smarthome.model.thing:0.9.0.b4]
        at org.eclipse.smarthome.model.thing.internal.GenericThingProvider$1$1.accept(GenericThingProvider.java:1)[133:org.eclipse.smarthome.model.thing:0.9.0.b4]
        at java.util.concurrent.ConcurrentHashMap$KeySetView.forEach(Unknown Source)[:1.8.0_121]
        at org.eclipse.smarthome.model.thing.internal.GenericThingProvider$1.apply(GenericThingProvider.java:239)[133:org.eclipse.smarthome.model.thing:0.9.0.b4]
        at org.eclipse.smarthome.model.thing.internal.GenericThingProvider$1.apply(GenericThingProvider.java:1)[133:org.eclipse.smarthome.model.thing:0.9.0.b4]
        at org.eclipse.smarthome.config.core.BundleProcessorVetoManager.applyActionFor(BundleProcessorVetoManager.java:121)[94:org.eclipse.smarthome.config.core:0.9.0.b4]
        at org.eclipse.smarthome.model.thing.internal.GenericThingProvider$6.accept(GenericThingProvider.java:320)[133:org.eclipse.smarthome.model.thing:0.9.0.b4]
        at org.eclipse.smarthome.model.thing.internal.GenericThingProvider$6.accept(GenericThingProvider.java:1)[133:org.eclipse.smarthome.model.thing:0.9.0.b4]
        at java.lang.Iterable.forEach(Unknown Source)[:1.8.0_121]
        at org.eclipse.smarthome.model.thing.internal.GenericThingProvider.createThingsFromModel(GenericThingProvider.java:323)[133:org.eclipse.smarthome.model.thing:0.9.0.b4]
        at org.eclipse.smarthome.model.thing.internal.GenericThingProvider.modelChanged(GenericThingProvider.java:870)[133:org.eclipse.smarthome.model.thing:0.9.0.b4]
        at org.eclipse.smarthome.model.core.internal.ModelRepositoryImpl.notifyListeners(ModelRepositoryImpl.java:207)[122:org.eclipse.smarthome.model.core:0.9.0.b4]
        at org.eclipse.smarthome.model.core.internal.ModelRepositoryImpl.addOrRefreshModel(ModelRepositoryImpl.java:99)[122:org.eclipse.smarthome.model.core:0.9.0.b4]
        at org.eclipse.smarthome.model.core.internal.folder.FolderObserver.checkFile(FolderObserver.java:272)[122:org.eclipse.smarthome.model.core:0.9.0.b4]
        at org.eclipse.smarthome.model.core.internal.folder.FolderObserver.access$1(FolderObserver.java:265)[122:org.eclipse.smarthome.model.core:0.9.0.b4]
        at org.eclipse.smarthome.model.core.internal.folder.FolderObserver$WatchQueueReader.processWatchEvent(FolderObserver.java:146)[122:org.eclipse.smarthome.model.core:0.9.0.b4]
        at org.eclipse.smarthome.core.service.AbstractWatchQueueReader.run(AbstractWatchQueueReader.java:122)[98:org.eclipse.smarthome.core:0.9.0.b4]
        at java.lang.Thread.run(Unknown Source)[:1.8.0_121]
11:41:06.032 [INFO ] [smarthome.event.ThingUpdatedEvent   ] - Thing 'rfxcom:bridge:usb0' has been updated.
11:41:06.033 [INFO ] [smarthome.event.ThingUpdatedEvent   ] - Thing 'rfxcom:lighting4:usb0:switch_17493' has been updated.
11:41:06.035 [INFO ] [smarthome.event.ThingUpdatedEvent   ] - Thing 'rfxcom:lighting4:usb0:switch_17685' has been updated.
11:41:06.036 [INFO ] [smarthome.event.ThingUpdatedEvent   ] - Thing 'rfxcom:lighting4:usb0:switch_17733' has been updated.
11:41:06.037 [INFO ] [smarthome.event.ThingUpdatedEvent   ] - Thing 'rfxcom:lighting4:usb0:switch_17745' has been updated.

Openhab restart doesnā€™t seem to help.

Iā€™m sorry, I fear that is caused by the changes in the binding :frowning:

I tested your config with stable rfxcom and with my own its fails only with my own.

This seems to work better, no more uninitialized handlers, I however did not mean to make the on/off commands required, so some work is required there. I think the pulse is optional, Iā€™ll put it is a review comment of myself to the PR, Iā€™ll fix it later.

	Thing lighting4 L17493 [deviceId="17493", subType="PT2262", onCommand="OFF_0", offCommand="OFF_0"] 
	Thing lighting4 L17685 [deviceId="17685", subType="PT2262", onCommand="OFF_0", offCommand="OFF_0"]
    Thing lighting4 L17733 [deviceId="17733", subType="PT2262", onCommand="OFF_0", offCommand="OFF_0", pulse=350]
    Thing lighting4 L17745 [deviceId="17745", subType="PT2262", onCommand="OFF_0", offCommand="OFF_0", pulse=350]

Alright, now we are getting somwhere. Iā€™m planning to switch to Paper UI + sitemap/rules only, but for now Iā€™d like to get it working so we can at least squash the remaining bugs from your changesā€¦

You used OFF_0 for onCommand too, I assume this needs to be ON_1 looking at the enum in your code.

I changed my things, the switch is not operating yet, the ā€˜handler uninitializedā€™ messages are gone.
I had some errors until I restarted openhab. Now itā€™s working! Anything else you want me to try/do before I switch over to srict paper ui + sitemaps/rules (without items/things files)?

The default options should be
on: ON_1
off OFF_4

Maybe you could also define the pulse as expected. Do you have debuging output for on/off switching? Maybe we can tell whatā€™s wrong from that debug information.

I updated the commit to make on / off commands optional with a sane default.

ON_1 and OFF_0 are working for me without any issues.

@all I have a new version because of some code review comments and I noted that if you changed the configuration ie reversed on/off for example that was overwritten if a new message came in.

If someone has time to test that would be great!

Can anyone recommend me cheap sensors from Aliexpress that work with RFXCOM?
Itā€™s difficult to find the different models (jumpers, etc).

I have some of these: Free Shipping! External antenna Wireless PIR Sensor 315MHZ or 433MHz PIR Motion Sensor Detector For gsm pstn Home Security Alarm
http://s.aliexpress.com/nAVnqAbm?fromSns=Copy to Clipboard
(from AliExpress Android)

They have the PT2262 chip with jumpers or DIP switches.

Basically all the PT2262 will work. Those are the cheapest.

Donā€™t use those sensors for detecting permanent presence (for example pointing into your living room) because they will transmit on every detected move and will drain battery fast.

They usually only send ON commands and never OFF. Hence most are only called ā€œalarm sensorā€. Leaving the room or closing a door will not be transmitted to openhab. You would have to use the expire binding.

Good search terms for Ali: 433 MHz sensor

Thanks for the suggestion!
The battery point is interesting - are there any cheap sensors that solve this? Iā€™m unsure whatā€™s best - I assume if not on every move, there needs to be a particular time interval. Ideally a specific datetime - but this is not possible with cheap sensors (or even expensive sensors) anywayā€¦