Hey Daniel. I’m using PT2262 a lot and they work pretty well.
I assume you grabbed the COMMAND of your outlets using the original remote and have the same house-code set in the remote and the outlet. I’ll just describe, how I set this up in OpenHAB 2:
You can see my naming scheme for the outlets are the DIP switches and the device char (A-E)
// Thing <CLASS> <HHHHH_D> [ deviceId="<DECIMAL_ID>.<PULSE>", subType="<SUBCLASS>" ]
// CLASS : Base protocol [lighting4, ...]
// HHHHH : DIP Switch: 1=HIGH, 0=LOW
// D : DIP Switch: Device: One of [A-E]
// DECIMAL_ID : ID shown by RFXCOM
// PULSE : Modulation pulse length
// SUBCLASS : Vendor-specific sub protocol
Link your item to a channel of the thing. For this, open the PaperUI, go to Things, select the thing you want to link and copy the channel name, for example the most intersting one, Command: rfxcom:lighting4:rfxtrx433e:10101_A:command
I learned that there might be some weird combinations of House-Code and Device-Code that just won’t work with my RFXCOM Transceiver. Then change to another house code and try again.
If you have any questions, ask me anytime! I’ve been through all of the problems that could ever happen with these. At least that’s how I feel like
@gersilex: thank you, now one of three switches works.
I bought 3 switches and one remote in a pack, so they are the same switches.
One of the three has an ID, and one bit 1/0 (on/off).
The others though have an ID, and the last two bits are on/off (10 on, 01 off). This seems to be very common with PT2262 switches, can Openhab handle that?
Maybe you hit that weird behaviour I found. [quote=“gersilex, post:4, topic:19660”]
I learned that there might be some weird combinations of House-Code and Device-Code that just won’t work with my RFXCOM Transceiver.
[/quote]
Honestly, I never dug into that problem really. I just changed the House Code, but that happened to my in OpenHAB1 times.
It looks like there are 4 bits used for the command, instead of 1 or 2 bits you encountered. Probably they are not all used, but at least reserved. There is some bit shifting and masking happening, but unfortunately I’m not able to understand or even read what’s happening there. But it looks quite promising and well laid out.
I recommend you to just try it and if it doesn’t work, report it as GitHub issue and/or change the house code and try again
I added a github issue, as I think this happens regularily, and the PT2262 is supposed to often have multi-bit on/off codes, and in implementations in other HA-systems it is handled correctly.
Great, thanks. Can you show us how the other Systems handle this? I already went to the Fhem source code to understand the Pioneer AVR protocol. Is the RFXCOM implementation handling the ON and OFFs or is one forced to give the command like you did in your post before?
to be completely hones, I have no idea how FHEM handles it from the programming perspective, but the configuration is the following:
define audioplayer TRX_LIGHT PT2262 1001011101 audio_bedroom 10:off,01:on
This is the definition, so here I define the ID and the on/off code, which can be different length.
The right source should be this, but I am unsure what to look for.