How to define ID for RFXCom’s component


i’m trying to do the same thing but with a lighting1 device of type COCO GDR2.
I have found this post:

explaining how the code is made.
I have looked at the source code:

at this moment i have following code
07 =package length
10 = lighting1
10 = subtype COCO GDR2
04 = seq nbr(don’t know if this is right)
41 = housecode A
04 = unitcode 4
but then i’m stuck


I try this way too …
For example with lighting 5, I find an update source code :

But it’s too hard for an EndUser to calculated an ID and finally not working without modifications (the rssi is 96 in the code and must be 00 in my case).

It will be an good ideas for rfxcom to make a tool to see/generate ID …


It should not be necessary to calculate an ID, since the auto add should handle it.
The only case where I see it is necessary to manually generate an ID is when you do not have an external remote.

A pull request to add functionality for generating IDs is welcome…


Normally it would no be necessary but in my case i have a remote but it’s not supported by rfxcom sending is supported but receiving not so i have to generate my own id


It’s same for LIVOLO’s protocol : rfxcom can’t read it (with external remote), just send.


Lighting5 packet id is described here:

Try something like:

event = Lighting5()
event.set_transmit(subtype, seqnbr, id_combined, unitcode, cmnd, level)
pkt_id = “”.join("{0:02x}".format(x) for x in

Rfxtrx433e and Elro switches (send raw command)

i’m making a python file which generate’s the id for HASS at this moment i only have the Lighting1 class and it’s all hardcoded.
When i have a good generator i will post it here

I’ve put the code to github:

this is the first time i’ve prgrammed in python so there will be better ways to write this :slight_smile:
@ouv27 can you try the code for your protocol because i can’t test that


Hi, I’m trying to use your script to generate ID’ for my Livolo switches, but I’m getting a syntax error. Could you post an example of the correct Syntax? Thanks.


for Livolo switches it would be: -t Lighting5 -s Livolo -p id,unit_code
where of course you replace id, unit_code with your id and unit_code
There’s a good chance that it won’t work if it doens’t work please post the generated id and i will test it at home


This may be my noobness causing this, but I’m still getting a syntax error.

Here’s what I’m getting:

[email protected]:~ $ python /home/pi/ -t Lighting5 -s Livolo -p id,unit_code
File “/home/pi/”, line 1

SyntaxError: invalid syntax


you have to change the word id and unit_code with your id and unit_code example: -t Lighting5 -s Livolo -p 1215,1

Normally you can find these with rfxmngr

edit the lighting5 is not working i’ve made a mistake i’m trying to fix it now


Sure, no prob. I’ve managed to control the light through rfxmngr (by assigning it a random ID and unit code, putting it in pairing mode, and then sending a button press through rfxmngr)

Just drop a line when it’s ready and I’d be happy to test it out. Thanks!


Great !!! I’ll test that when I will be at home.


If someone has a working Livolo ID in HASS and the ID and unit code from rfxcom can you please send it to me?
Would be a lot easier to make the calculations if I know how the ID looks like in HASS


@Danielhiversen I see your point but I think being able to calculate it forward and backwards would be very helpful in many situations.

For example I’m currently trying to switch from a pilight setup with “selfmade” hardware to RFXtrx, hoping its more robust and has a better range when it comes to receiving. From the pilight setup I have all IDs, Unitcodes and Protocolls available, which you also get when using the RFXtrx Manager Software and which are quiet common out there. So in my case, it would be way easier and faster(!) to now, how to calculate the devices ID and adding them to the config, instead of searching for each in the autodetect list, step by step by step… That’s how I landed in this thread :wink:

In addition, since I have some devices and automations running, after a view minutes and my family at home, the autodetect list is so long, I can’t tell what is what anymore. So I have to wait for a “maintenetce window”, when they are gone! :grinning:

So sum it up: I think there are many use cases out there, where this would be handy.


Hi Sennevds,

I have looked at your code, as I needed to create an ID for my devices (All lighting1: X10, Philips SBC, Impuls and ARC, yest I have quite a few). And I used all of these with Domoticz before, auto_add picking up the codes with my RFXTRX433 does not fly).

Very helpfull but I observed a few things:

  • The is no shebang in the first line (eg. #!/usr/bin/python)
  • Therefor it is also not clear to me to run python or python3?
  • Hardcoded seqnbr = 0x00 does not always work, X10 requires 0xff and for Impuls I don’t know yet (not 0x00 nor 0xff)


It’s far from complete and because there wasn’t much reaction I haven’t completed the code.
I’ve looked really fast at the code and looking at the print statements it’s written in python 2 (i’m going to rewrite it for python3)
If you want I will complete the code or if you want to complete you can always fork the repository.


Hi @Sennevds
Thanks for the generator. It works great but my rf outlets use Energenie5.Etekcity (Energenie5 protocol I think).

I can work it fine from within RFXMNGR and I understand how to generate it with your generator but it doesn’t support the Energenie5 protocol.

Do you have any plans on adding this? I have no idea how to but would love to be able to control these outlets.

Thank you


this adds ELEC5 (energy5) to pyRFXtrx. it should be part of the next HA release.

i only tested the energy5 protocol against my revolt SF-436 (NC-5461), but it should work with others as well.


hey @diplix these are energy monitors if i’m right?
How do you connect them with the rfxcom because I can generate an ID but does this device doesn’t have a static id or does it need to be set?