martinvw
(Martin van Wingerden)
March 2, 2017, 12:13pm
56
@Jamstah thank for your response, hereby an overview of what I already found out with some references.
There is only one Lighting4 subtype at this moment and none of the other RFXCom message types support a similar concept.
I think the pulse timing is just really technical detail of this message type which was observed to vary by the creators of rfxcom, but I sent them an e-mail
I think that is explained the best by kevin in the an issue he reported
opened 11:13PM - 03 May 16 UTC
closed 08:27PM - 01 Aug 19 UTC
## Current Behavior
Only ON and OFF Types are supported commands for sending ou… t in the LIGHTING 4 protocol of the RFXCOM Binding.
## Possible Solution
Add Number as an type to RFXComValueSelector.java
at or around line 72:
```
NUMBER("Number", NumberItem.class);
```
Add Number Type to RFXComLighting4Message.java at or around line 198
```
case NUMBER:
if (type instanceof DecimalType) {
commandId = ((DecimalType) type).intValue();
} else {
throw new RFXComException("Can't convert " + type + " to Command");
}
break;
```
Add to documentation:
Multi port relay item example
```
Number MultiportRelay { rfxcom=">123456.550:LIGHTING4.PT2262:Number" }
```
where 123456 is the 6 character address of the relay and 550 is the command length in milliseconds
To send to the item in a rule needs to read something like this:
```
when Item something changed then
{ MultiportRelay.sendCommand(15) }
end
```
The number in brackets represents the state you want the relays to be in. Each relay on the card is controlled by a binary bit with number "0" being all Off, number "15" being all On, number "1" being the first relay on, number "2" being the second relay on etc
## Context
It allows use the binding to be used with products such as this
http://www.aliexpress.com/item/High-Quality-12V-4CH-Wireless-Remote-Control-Relay-Switch-4-Transceiver-with-Receiver-Compatible-with-2262/32383896424.html
## Your Environment
This is tested and working with Openhab V1.8.0, Raspberry Pi3, RFXCOM binding and external 433MHz USB Transceiver.
Unfortunately I can't understand how to get Eclipse / Local GIT / Remote GIT to combine my branches / pulls into something usable so I have copy and pasted the changes into here.
##
… Each relay on the card is controlled by a binary bit with number “0” being all Off, number “15” being all On, number “1” being the first relay on, number “2” being the second relay on etc
The initial support for some of the s1/s24 commands is added in openHAB (1.x) by SpeederC:
opened 11:10PM - 20 Jan 16 UTC
closed 05:44AM - 12 Jan 17 UTC
enhancement
I bought some cheap [contact](https://github.com/openhab/openhab/blob/master/bun… dles/binding/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting4Message.java) and motion sensors based on the 1527 chipset. I tried to use them with the RFXCOM binding. Unfortunately the devices do not send an ON command on contact, but a UNKNOWN command. Domoticz treats these commands as ON, so they can be used in that platform without problem (if you set auto update to OFF after a few seconds). Unfortunately, openHAB throws exceptions. I think I tracked the problem down to [this file](https://github.com/openhab/openhab/blob/master/bundles/binding/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting4Message.java)
If i interpret the code correctly, all command types of the LIGHTING4 protocol are defined ([line 70](https://github.com/openhab/openhab/blob/master/bundles/binding/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting4Message.java#L70)), but only ON/OFF is handled correctly, the rest throw exceptions ([line 190](https://github.com/openhab/openhab/blob/master/bundles/binding/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting4Message.java#L190)). Additionally, the RawData type is allowed ([line 93](https://github.com/openhab/openhab/blob/master/bundles/binding/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting4Message.java#L93)) but not implemented ([line 232](https://github.com/openhab/openhab/blob/master/bundles/binding/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting4Message.java#L93)).
It would be perfect when:
1. The binding treats the UNDEFINED_0, UNDEFINED_2, UNDEFINED_3 and UNKNOWN commands as ON commands, so the motion and contact sensors can be assigned to Switch and Contact items. (Switch ContactSensor01 { rfxcom="<9287177:Command" })
2. The binding allows for using the RawMode to put the received command into a String (or Selection?) item. (String ContactSensor01 { rfxcom="<9287177:RawData" })
Thanks for looking into this!
##
There you can see that motion & contacts sensors send a different command with the s1-s24 bits.
These threads might also give some insight
I’ve just received a 4 port Aoke relay from Aliexpress which I’m trying to get working with openhab.
Following information I found at
I’ve managed to get two of the relays on the board to toggle when setup as a Switch item, but to work with the rest of them I need to be able to send more than a simple OFF and ON Command to the board.
Using RFXMGR on windows I’ve managed to find the address, and just taking the most significant 5 sets of 4 binary numbers I have a working Hex and also Decim…
To my knowledge the update didn’t make it into the main binding, and I no longer use the 4 port relay so haven’t persued it. I did document the changes, but I didn’t have time to learn how to submit them properly. Git & Pull requests by and large are a bit of a mystery to me.
My completed binding can be found here
Numerical PT2262 RFXCOM Binding
Instructions:
In Items:
Add something similar to
Number RFXTest { rfxcom=">123456.550:LIGHTING4.PT2262:Number" }
where 123456 is your item’s addr…
What I saw it that my motion sensor sends a specific on command each time, but the full S1-S24 seems only to be in use by the 4-port relays. And it would only be really correct if an item discovered for the remote button is correctly retransmitted by the binding if requested.
I would really like to implement that sending of a specific command as well, but if we have a common opinion about the rest that should be easy
1 Like