[SOLVED] Need help with manual RFXCOM thing configuration

I am switching back and forth between my 1.8.3 and 2.0b5 installation on one RPi. Therefor I do not want to change serial drivers. And I have decided not to use the autodiscovery anyway. So I’m trying to get my RFXCOM binding working.

This is the configuration:

$ ls -l /dev/*USB*
crw-rw---- 1 root dialout 188, 0 Dec 24 14:48 /dev/ttyUSB0
crw-rw-rw- 1 root dialout 188, 1 Dec 29 21:05 /dev/ttyUSB1

(USB1 is my RFXCOM)

demo.things

Bridge rfxcom:bridge:usb1 [ serialPort="/dev/ttyUSB1" ] {
    Thing lighting2 remote1_1 [deviceId="12345678.1", subType="AC"]
    Thing lighting2 remote1_2 [deviceId="12345678.2", subType="AC"]
    Thing lighting2 remote1_3 [deviceId="12345678.3", subType="AC"]
    Thing lighting2 remote1_0 [deviceId="12345678.0", subType="AC"]
}

demo.items

Switch	Remote_KAKU1_1	 { channel="rfxcom:lighting2:usb1:remote1_1:command" }
Switch	Remote_KAKU1_2	 { channel="rfxcom:lighting2:usb1:remote1_2:command" }
Switch	Remote_KAKU1_3	 { channel="rfxcom:lighting2:usb1:remote1_3:command" }
Switch	Remote_KAKU1_0	 { channel="rfxcom:lighting2:usb1:remote1_0:command" }

openhab is manually installed in /opt/openhab2.
I have set these permissions: chmod -R openhab:openhab /opt/openhab2
running oh2 through ssh session with user pi, with command sudo /opt/openhab2/start.sh
Both users openhab (created for 1.8.3) and pi have been added to the dialout group

I get only a little output:

openhab>log:set DEBUG org.openhab.binding.rfxcom
openhab>log:tail
21:58:21.860 [DEBUG] [org.openhab.binding.rfxcom          ] - BundleEvent STARTING - org.openhab.binding.rfxcom
21:58:21.894 [DEBUG] [org.openhab.binding.rfxcom          ] - BundleEvent STARTED - org.openhab.binding.rfxcom
21:58:22.059 [DEBUG] [org.openhab.binding.rfxcom          ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.config.discovery.DiscoveryService}={component.name=org.openhab.binding.rfxcom.discovery, component.id=199, service.id=327, service.bundleid=215, service.scope=bundle} - org.openhab.binding.rfxcom
21:58:22.132 [DEBUG] [org.openhab.binding.rfxcom          ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory}={component.name=org.openhab.binding.rfxcom.internal.RFXComHandlerFactory, component.id=200, service.id=328, service.bundleid=215, service.scope=bundle} - org.openhab.binding.rfxcom
openhab>smarthome:things
hue:bridge:home (Type=Bridge, Status=ONLINE, Label=Hue Bridge, Bridge=null)
ntp:ntp:local (Type=Thing, Status=ONLINE, Label=NTP Server, Bridge=null)
sonos:PLAY1:living (Type=Thing, Status=OFFLINE, Label=PLAY 1, Bridge=null)
astro:sun:home (Type=Thing, Status=ONLINE, Label=Astro sun data, Bridge=null)
astro:moon:home (Type=Thing, Status=ONLINE, Label=Astro moon data, Bridge=null)

When I click a button/switch in the basic ui I see this in the console:

22:04:51.638 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'Remote_KAKU1_1' received command ON
22:04:51.641 [WARN ] [ome.core.thing.internal.ThingManager] - Cannot delegate command 'ON' for item 'Remote_KAKU1_1' to handler for channel 'rfxcom:lighting2:usb1:remote1_1:command', because no thing with the UID 'rfxcom:lighting2:usb1:remote1_1' could be found.
22:04:51.647 [WARN ] [ome.core.thing.internal.ThingManager] - Cannot delegate update 'ON' for item 'Remote_KAKU1_1' to handler for channel 'rfxcom:lighting2:usb1:remote1_1:command', because no thing with the UID 'rfxcom:lighting2:usb1:remote1_1' could be found.
22:04:51.648 [INFO ] [marthome.event.ItemStateChangedEvent] - Remote_KAKU1_1 changed from OFF to ON

Any help is appreciated.

(If I get this working, I’ll contribute to the documentation :smile:)

I noticed that I had opened a .things file on a stale enviroment, not the RPi. :blush:
I added the thing definition to the proper file and now it started working just fine :smile:

Note to self: never ever again use 2 nearly similar environments;