OpenHAB2 / LightwaveRF / Mood controller

UPDATE

Ah… I spoke to soon… just seen a posting made a few hours ago by neil_renaud on here:

To quote his post:
“The Lightwave light switches don’t send any information ever. So when they are switched at the actual switch nothing knows about it. This is one of the limitations with Lightwave. However the RFXCom433E can receive commands from the remotes… so you don’t have to pair a remote with a switch you can push a button on a remote get an update in Openhab and then do whatever you want with it (switch on your Hues for example)”

So, it looks like I need to be using a RFXCom433E device rather than the gateway.

If anyone knows any different, please let me know… failing that I’ll order a RFXCom433E and see how I get on.

Regards, David

Hey,

The easiest way will be the RfxCom with the new Lightwave API you could
possibly fudge it by binding the socket to a room with no devices and then
when the link send the radio massage we could detect that and you could
possibly create a rule off the back of it…

Would require changes to the binding.

Neil

Hi Neil,

Thanks for the response… I’ve just ordered the RfxCom as that looks like the “right” solution. I’ll wait for that to arrive and have a play… it hadn’t occurred to me to check before buying the gateway, I just assumed those messages would be picked up by the gateway and forwarded on.

kind regards,
David

No the gateway was designed as a link between the phone app and the switches. The remotes all go directly.

If you do ever plan to still use the Lightwave phone apps then you may still want the binding as it can update openhab to the same state as requested using the phone app…that being said if you are using openhab not sure there is a use case to use the lightwave phone app.

Thanks Neil, with your input and a bit of further reading I think I’ve got it figured out (hopefully!).

In terms of the use case, I don’t want to introduce another app (on top of Nest/Alex/HomeKit/OpenHAB/Hue etc)… in fact whilst I myself use the OpenHAB app (as I’ve got more control over my world), I’ve patched all the key items into HomeKit which the family see as more “friendly”. This means they live exclusively in HomeKit and we’re all happy controlling a mixed environment of hardware thanks to OpenHAB.

Hi there,

I’m back… I’ve received my RFXtrx433E and set it up (manually added it as a thing, setting the port). It shows as ONLINE in my list of things however when I activate the LightwaveRF switches I don’t get any messages in the log and no new items are being discovered/automatically appearing as I believe they should:

Via PaperUI I’ve enabled “AD LightwaveRF”, plus enabled/disabled the skip transceiver configuration option but it doesn’t seem to make any difference.

Can you give me any pointers as to what I’m missing?

Thanks, David

Hi,

I’ve made progress and got it working, or a workaround anyway.

I moved the RFXcom onto a Windows machine and looked at the config… LightwaveRF wasn’t enabled. So I enabled it and moved it back to the Pi, worked fine and items appeared in the inbox as I pressed buttons on the LightwaveRF devices. I moved it back to the Windows PC and returned it default config, moving it back to the Pi I found that nothing worked and changing the config options didn’t make any difference. I’m therefore thinking that OpenHAB isn’t (correctly) enabling the LightwaveRF option on the RFXcom device, hence no items are found. Does that sound logical?

I’ve got a workaround, however I’m either missing something, or the binding isn’t successfully setting up the RFXcom.

Regards, David

Hi @dwaterson ,

Here’s how I got my RFXcom working with my setup. I don’t think you needed to enable the Lightwave on the RFXcom software as thats for receiving, it transmits on all channels… if I recall correctly.

In Linux
Added the USB interface (/dev/ttyUSB0) to the Dialout group

In Paper UI
Install RFXCOM Binding
Manually add RFXcom USB Transceiver as a Thing and configure to use usb port.
RFXcom USB Transceiver Thing should be online, if not stop and check setup, no point in continuing.

In Linux (Because can’t add items in Paper UI)
Added items files for each room. (mine is /etc/openhab2/items)

Example of my downstairshallway.items file:

Switch DownstairsHallwayLight "Downstairs Hallway Light" { rfxcom=">010301.1:LIGHTING5.LIGHTWAVERF:Command"}
Dimmer DownstairsHallwayDimmer "Downstairs Hallway Dimmer [%d %%]" { rfxcom=">010301.1:LIGHTING5.LIGHTWAVERF:DimmingLevel"  }
Switch DownstairsHallwaySocket1 "Downstairs Hallway Door Left Socket" { rfxcom=">010302.1:LIGHTING5.LIGHTWAVERF:Command"}
Switch DownstairsHallwaySocket2 "Downstairs Hallway Door Right Socket" { rfxcom=">010302.2:LIGHTING5.LIGHTWAVERF:Command"}
Switch DownstairsHallwaySocket3 "Downstairs Hallway Lounge Left Socket" { rfxcom=">010303.1:LIGHTING5.LIGHTWAVERF:Command"}
Switch DownstairsHallwaySocket4 "Downstairs Hallway Lounge Right Socket" { rfxcom=">010303.2:LIGHTING5.LIGHTWAVERF:Command"}
Switch DownstairsHallwaySocket5 "Downstairs Hallway Cupboard Left Socket" { rfxcom=">010304.1:LIGHTING5.LIGHTWAVERF:Command"}
Switch DownstairsHallwaySocket6 "Downstairs Hallway Cupboard Right Socket" { rfxcom=">010304.2:LIGHTING5.LIGHTWAVERF:Command"}

I used first to digits for floor 01. Third and fourth digit for room number 03. Then fifth and sixth digit for device number. The decimal I used if the device had two functions like on/off and dimmer .1 and .2, otherwise always .1

In PaperUI
Add a manual RFXCom Lighting 5 thing for each device.
Choose RFXcom as bridge and Device Id (010301.1) to match items file and Sub Type (Lightwave), Name and Room.
Open newly created thing and then link the switch and/or dimmer item to the thing

On Device and in Paper UI
Put your Lightwave device in pair mode (Hold button/buttons down for five seconds and the leds should flash)
Withing 5-10 seconds, activate the switch/dimmer in PaperUI and then the device should flash blue.
Now turning control on/off in PaperUI should activate device

That should be you good to go.

Hope it’s clear enough and helps you get going. Let me know if you get stuck and I’ll do my best to try to help you.

Regards,
Ben

2 Likes

Hi @Phelzier,

Have you been able to receive commands from a switch - I got as far as setting up RFXCOM with OH2, but couldn’t see any events received from a remote mood switch - I figured that it hadn’t been implemented yet?

Cheers
James

Hi @james_2_roberts,

Sorry, I’ve not got any Lightwave items that transmit, only receive.

Did you enable Lightwave on the RFXtrx hardware using the RFXtrx software on your pc? Page 5 of this RFXtrx Manual. You need to enable Lightwave and then flash/set mode on the device.

Regards
Ben

Hi @Phelzier,

Thanks for the summary - that’s a really helpful guide.

My issue last night was I didn’t think I needed to enable LightwaveRF via the RFXcom manager, I thought that enabling it on the RFXCOM USB Transceiver thing would be sufficient. Once I enabled it via the manager everything started working.

@james_2_roberts - Yes it definitely receives commands from the switches. In fact the things automatically appear as the receiver detects the radio transmissions following button pushes on the switches. The things also appear with the correct channels for each switch too so it’s then a really easy task to create the items manually in the items file. I’ve got the LightwaveRF switches controlling devices via OpenHAB, plus monitoring their signal strength.

Ok, so all good so far… I’m left with one issue but not spent much time on it yet. This relates to the mood controllers. The standard switches are working great, linking items to the “Command channel” is all good. But the mood controller is proving more tricky. I’m linking an item to the “Mood channel” however I keep receiving a warning on the console whenever I press the real world button saying that MOOD1 (or MOOD2, MOOD3) isn’t recognised. (I’m grab the exact message shortly, not at home at the moment).

I’ve tried creating the item as a switch/number/string but all are unsuccessful. My next action was to try setting up as a switch but incorporate a mapping for MOOD1 etc to see if that would translate the status (I need to look into this as I’ve not had to create mappings on items before). This might be the right or wrong approach, I ran out of time last night so didn’t get much time to think about it.

Regards, David

Hi,

I’ve now got the Error message that is displayed (thanks to eldest child who was at home!)

[ERROR] [binding.rfxcom.handler.RFXComHandler] - Error occurred during message receiving: Can’t convert MOOD1 to SwitchItem

Regards, David

Sorry @dwaterson, I’m at a loss here as don’t have mood controller but glad you’re now able to receive :slight_smile:

Hey,

As switches can only receive on/off try binding it to a String - you’ll then need a rule when String changes to do what you want…(I’ve only used OH1 as no managed to even get RFXCom to work in OH2 yet…)

Neil

Hey,

I’m having the same problem with Lighwave RF mood remotes not working due to Can't convert MOOD1 to SwitchItem. It looks like for some reason the mood channel link item is being treated as a SwitchItem instead of a NumberItem. I’ve not managed to get this to work neither when using PaperUI to discover the mood remote thing (and link the mood channel to an item) or defining both using config files (where the item is explicitly defined as a Number).

Hi,

Yes I’d thought the same. I’ve left the LightwaveRF mood controllers for the moment, I’m still on a beta release of OH2 so I was going to tackle it again when I swap over to the production release.

I’d tried binding to a string, IIRC this just generated errors when a command was received from the mood controller.

Regards, David

Hi, I have the same problem with mood controllers and also PIR motion detectors. I am using the snapshot build from 13 Mar 17.

I get the following error messages when hitting a mood button on the official lightwave remote control or mood controller switch:

12:00:21.855 [DEBUG] [g.rfxcom.handler.RFXComBridgeHandler] - Message received: Raw data = 0A140000F10F7E10030080, Packet type = LIGHTING5, Seq number = 0, Sub type = LIGHTWAVERF, Device Id = 15798142.16, Command = MOOD1, Dim level = 0, Signal level = 8
12:00:21.857 [TRACE] [scovery.RFXComDeviceDiscoveryService] - Received: bridge: rfxcom:bridge:usbrfx message: Raw data = 0A140000F10F7E10030080, Packet type = LIGHTING5, Seq number = 0, Sub type = LIGHTWAVERF, Device Id = 15798142.16, Command = MOOD1, Dim level = 0, Signal level = 8
12:00:21.859 [TRACE] [scovery.RFXComDeviceDiscoveryService] - Adding new RFXCOM rfxcom:lighting5:usbrfx:15798142_16 with id ‘15798142.16’ to smarthome inbox
12:00:21.873 [DEBUG] [binding.rfxcom.handler.RFXComHandler] - Received message from bridge: rfxcom:bridge:usbrfx message: Raw data = 0A140000F10F7E10030080, Packet type = LIGHTING5, Seq number = 0, Sub type = LIGHTWAVERF, Device Id = 15798142.16, Command = MOOD1, Dim level = 0, Signal level = 8
12:00:21.878 [ERROR] [binding.rfxcom.handler.RFXComHandler] - Error occured during message receiving
org.openhab.binding.rfxcom.internal.exceptions.RFXComException: Can’t convert MOOD1 to SwitchItem
at org.openhab.binding.rfxcom.internal.messages.RFXComLighting5Message.convertToState(RFXComLighting5Message.java:311)[188:org.openhab.binding.rfxcom:2.1.0.201703131855]
at org.openhab.binding.rfxcom.handler.RFXComHandler.onDeviceMessageReceived(RFXComHandler.java:182)[188:org.openhab.binding.rfxcom:2.1.0.201703131855]
at org.openhab.binding.rfxcom.handler.RFXComBridgeHandler$MessageListener.packetReceived(RFXComBridgeHandler.java:398)[188:org.openhab.binding.rfxcom:2.1.0.201703131855]
at org.openhab.binding.rfxcom.internal.connector.RFXComBaseConnector.sendMsgToListeners(RFXComBaseConnector.java:49)[188:org.openhab.binding.rfxcom:2.1.0.201703131855]
at org.openhab.binding.rfxcom.internal.connector.RFXComStreamReader.run(RFXComStreamReader.java:103)[188:org.openhab.binding.rfxcom:2.1.0.201703131855]

I have the following .things and .items defined:
Bridge rfxcom:bridge:usbrfx [ serialPort="/dev/USBrfxcom" ] {
Thing lighting5 Li_FF_Bed1_Right_Dim [deviceId=“15798142.4”, subType=“LIGHTWAVERF”]
Thing lighting5 Li_FF_Bed1_Left_Dim [deviceId=“15798142.1”, subType=“LIGHTWAVERF”]
Thing lighting5 Li_FF_Bed1_Mood [deviceId=“15798142.16”, subType=“LIGHTWAVERF”]
}

Dimmer Li_FF_Bed1_Right_Dim “Right [%d %%]” (FF_Bed1) [“Lighting”] { channel=“rfxcom:lighting5:usbrfx:Li_FF_Bed1_Right_Dim:dimmingLevel” }
Switch Li_FF_Bed1_Right_Off “Right [%s]” (FF_Bed1) [“Lighting”] { channel=“rfxcom:lighting5:usbrfx:Li_FF_Bed1_Right_Dim:command” }
Dimmer Li_FF_Bed1_Left_Dim “Left [%d %%]” (FF_Bed1) [“Lighting”] { channel=“rfxcom:lighting5:usbrfx:Li_FF_Bed1_Left_Dim:dimmingLevel” }
Switch Li_FF_Bed1_Left_Off “Left [%s]” (FF_Bed1) [“Lighting”] { channel=“rfxcom:lighting5:usbrfx:Li_FF_Bed1_Left_Dim:command” }
Number Li_FF_Bed1_Mood “Mood [%s]” (FF_Bed) [“Lighting”] { channel=“rfxcom:lighting5:usbrfx:Li_FF_Bed1_Mood:mood” }

I also get a similar message when trying the power button on the remote:
12:06:47.092 [DEBUG] [g.rfxcom.handler.RFXComBridgeHandler] - Message received: Raw data = 0A140001F10F7E01000070, Packet type = LIGHTING5, Seq number = 1, Sub type = LIGHTWAVERF, Device Id = 15798142.1, Command = OFF, Dim level = 0, Signal level = 7
12:06:47.095 [TRACE] [scovery.RFXComDeviceDiscoveryService] - Received: bridge: rfxcom:bridge:usbrfx message: Raw data = 0A140001F10F7E01000070, Packet type = LIGHTING5, Seq number = 1, Sub type = LIGHTWAVERF, Device Id = 15798142.1, Command = OFF, Dim level = 0, Signal level = 7
12:06:47.096 [TRACE] [scovery.RFXComDeviceDiscoveryService] - Adding new RFXCOM rfxcom:lighting5:usbrfx:15798142_1 with id ‘15798142.1’ to smarthome inbox
12:06:47.104 [DEBUG] [binding.rfxcom.handler.RFXComHandler] - Received message from bridge: rfxcom:bridge:usbrfx message: Raw data = 0A140001F10F7E01000070, Packet type = LIGHTING5, Seq number = 1, Sub type = LIGHTWAVERF, Device Id = 15798142.1, Command = OFF, Dim level = 0, Signal level = 7
12:06:47.120 [ERROR] [binding.rfxcom.handler.RFXComHandler] - Error occured during message receiving
org.openhab.binding.rfxcom.internal.exceptions.RFXComException: Unexpected mood: OFF
at org.openhab.binding.rfxcom.internal.messages.RFXComLighting5Message.convertToState(RFXComLighting5Message.java:278)[188:org.openhab.binding.rfxcom:2.1.0.201703131855]
at org.openhab.binding.rfxcom.handler.RFXComHandler.onDeviceMessageReceived(RFXComHandler.java:214)[188:org.openhab.binding.rfxcom:2.1.0.201703131855]
at org.openhab.binding.rfxcom.handler.RFXComBridgeHandler$MessageListener.packetReceived(RFXComBridgeHandler.java:398)[188:org.openhab.binding.rfxcom:2.1.0.201703131855]
at org.openhab.binding.rfxcom.internal.connector.RFXComBaseConnector.sendMsgToListeners(RFXComBaseConnector.java:49)[188:org.openhab.binding.rfxcom:2.1.0.201703131855]
at org.openhab.binding.rfxcom.internal.connector.RFXComStreamReader.run(RFXComStreamReader.java:103)[188:org.openhab.binding.rfxcom:2.1.0.201703131855]

I also have a couple of LightwaveRF PIR motion detectors set up and they also trigger an “Unexpected mood” message as above for both ON and OFF state changes.

I’m not a developer but it seems like the binding is not parsing the raw data of the command correctly for these inputs? If so would someone be able to investigate and correct this please?
Or maybe there is something wrong with my item definitions and their links?

The controllers all do their jobs, and Openhab can control all items correctly by sending commands, but cannot interpret and update state of items when intercepting the lightwave remote commands.

I had similar code and setup without similar issues under the 1.x binding but no longer have that system to test on, nor does RFXCOM show up as a legacy binding in Paper UI so I’m not sure how to selectively go back to this. My current RFXCOM bundle version is 2.1.0.201703131855.

Many thanks.

In case anyone is still watching this thread, there’s been some activity around it recently!


And the PR here: https://github.com/openhab/openhab2-addons/pull/2103
Fingers crossed it gets merged soon - as per the github issue, I’ve built the rfxcom binding myself with the changes from the PR and it’s working as expected!

Hi chopped_pork,

Thanks for the post - I’ll watch with interest. I’ve a number of mood controllers just waiting to be setup! I gave up with them at the time as I hadn’t the skills to resolve.

kind regards,
David

Hi @Phelzier
Do we still need to enable Lightwave using the RFXtrx software to get mood switchs and wire free switchs working?
thanks in advance :slight_smile:

James