I’m looking to improve the way Lighting4 messages are interpreted. The SDK says there are three bytes (24 bits) of “data”, and doesn’t explain what it is. Some specs I’ve seen for different chips that support the protocol imply that the first 20 bits are an identifier of a device, and the last 4 bits are the channel on the device, so that devices can have more than one button/socket/etc.
The code we have at the moment uses the first 20 bits as the identifier, and the last 4 bits as a generic “COMMAND” field, which merges the channel and the command in one, which means its harder to match a thing to a Switch for example. I’m thinking of ways to make that easier.
So, I’m calling on people with Lighting4 devices to help me by providing a description of the device, and some messages that are received when the buttons are pressed (turn on debug mode by adding
<Logger level="DEBUG" name="org.openhab.binding.rfxcom"/> to your
log4j2.xml. I’d also like to know how you translate that into your openhab things/items for use. Any information is better than no information so if you’re not confident on how to get data for me, I’m happy to help!
I have an Energenie extension lead with 4 sockets. It has a remote control that has 5 pairs of on/off buttons, one for each socket and an “all” pair.
The raw messages I get, the 4 “command bits” (from the raw message), and the command that openhab matches the code to, are:
|1||09130005F8805F00D660 - 1111 - ON_15||09130000F8805E00DA60 - 1110 - OFF_14|
|2||09130006F8805700D860 - 0111 - ON_7||09130001F8805600D960 - 0110 - ON_6|
|3||09130007F8805B00DB60 - 1011 - ON_11||09130002F8805A00DB60 - 1010 - ON_10|
|4||09130008F8805300DC60 - 0011 - ON_3||09130003F8805200DA60 - 0010 - OFF_2|
|all||09130009F8805D00D860 - 1101 - !13!||09130004F8805C00DC60 - 1100 - ON_12|
Looking at the command bits, for this device the first 3 bits are the socket in no particular order, and the last bit is 1 for on and 0 for off.
To translate into things/items, I think I would need to add 5 things, all with the same device id, but using the onCommandId=“x” and offCommandId=“y”. The auto discovery identifies it as 1 thing, and gets the on/off commands wrong, so I can’t use that. The ON/OFF identifiers in openhab are more confusing than helpful, at least for this device.
I could then set up 5 switches to match the things and control the sockets with openhab.