Page 1 of 2

RFXCom RAW transmit in Domoticz

Posted: Thursday 07 March 2019 13:19
by Vic3198
Hi,
My gate remote is not recognized by the RFXtrx433XL and Domoticz. However, with undec_on in RFXMngr on Windows, I managed to capture the message sent by the remote, to put it in a .txt and to repeat it with the RFXCom, using RAW transmit in RFXMngr, what successfully opened my gate.

Now my question is: how to make Domoticz transmit the data contained in the .txt through the RFXCom? I didn't see any option in Domoticz (it runs on a Raspberry Pi) to transmit RAW data...
If this is not possible, is there a workaround to transmit RAW data in Linux? I could thus make a script and trigger it in Domoticz.

Thanks,
Vic

Re: RFXCom RAW transmit in Domoticz

Posted: Thursday 25 April 2019 16:19
by Vic3198
I finally found a (tricky) solution! It uses RFXcmd.

I first used Windows and RFXMngr (available on the RFXCOM official webiste), to receive, decode and clean the raw packets sent by my remote. I created a clean .txt file as explained in the user guide (page 50) and then used RFXMngr to transmit this packet. That way, RFXMngr displays the clean raw code that correspond to the message you want to send, with the correct repeat count etc.

After getting the interesting raw code, I installed RFXcmd.
Once installed (by following the how-to on the Github page), what you just have to do to transmit is:

Code: Select all

./rfxcmd.py -d /dev/ttyUSB<YOUR DEVICE> -s <THE RAW CODE YOU GOT IN RFXMNGR>
Now all you have to do is creating a dummy switch in Domoticz that triggers a script containing the above line. 😉


Hope that can help someone!

Re: RFXCom RAW transmit in Domoticz

Posted: Sunday 19 July 2020 15:38
by sorinpopa
Hi. I have the same problem with my gate.
Have you managed to control that from Domoticz?

I'm surprized this is not supported in Domoticz, this type o gate is quite popular in France... (or maybe that's why?)

regards

Re: RFXCom RAW transmit in Domoticz

Posted: Sunday 14 February 2021 19:16
by Didi
Vic3198 wrote: ↑Thursday 25 April 2019 16:19 I finally found a (tricky) solution! It uses RFXcmd.

I first used Windows and RFXMngr (available on the RFXCOM official webiste), to receive, decode and clean the raw packets sent by my remote. I created a clean .txt file as explained in the user guide (page 50) and then used RFXMngr to transmit this packet. That way, RFXMngr displays the clean raw code that correspond to the message you want to send, with the correct repeat count etc.

After getting the interesting raw code, I installed RFXcmd.
Once installed (by following the how-to on the Github page), what you just have to do to transmit is:

Code: Select all

./rfxcmd.py -d /dev/ttyUSB<YOUR DEVICE> -s <THE RAW CODE YOU GOT IN RFXMNGR>
Now all you have to do is creating a dummy switch in Domoticz that triggers a script containing the above line. 😉


Hope that can help someone!
Is it possible to get this working with RFLink also?

Re: RFXCom RAW transmit in Domoticz

Posted: Saturday 17 July 2021 23:24
by solarboy
This looks excellent, I'm going to try to control my Lucci DC fan with this. It's able to be controlled in rfxmgr but not Domoticz. Thanks for the heads up !

Re: RFXCom RAW transmit in Domoticz

Posted: Sunday 18 July 2021 10:21
by EdwinK
When trying, I get an error 'not in HEX format'.

Re: RFXCom RAW transmit in Domoticz

Posted: Monday 19 July 2021 16:02
by solarboy
I also couldn't get it to work in rfxmgr. I was able to capture the code (19 packets) but each time I pressed the button, the packets were different, maybe some kind of rolling code ? . I tried anyway, I added all the packets together, changing spaces for new-lines, adding 0, and 1, at the start of each packet and "10000" at the end cleaning up the raw codes as described in the article but I got an "array error". I have messaged the RFXCOM guys, hopefully they can help.

Re: RFXCom RAW transmit in Domoticz

Posted: Monday 19 July 2021 16:22
by EdwinK
I had to add a 0 and 6 in the beginning and and 9000 at the end of each code.

Re: RFXCom RAW transmit in Domoticz

Posted: Monday 19 July 2021 18:49
by solarboy
Yep, managed to send now with rfxmgr but still unable to with rfxcmd. I converted each number to hex from the RAW code that works with rfxmgr;

0
25
194
404
571
731
242
733
239
733
240
734
240
413
560
739
235
737
238
734
241
732
242
411
561
736
239
10000

Which I converted to

00 19 C2 194 23B 2DB F2 2DD EF 2DD F0 2DE F0 19D 230N


and then tried the following command ;

"./rfxcmd.py -d /dev/ttyUSB0 -f -v 00 19 C2 194 23B 2DB F2 2DD EF 2DD F0 2DE F0 19D 230N"

which results in ;

Error: invalid rawcmd, first byte is zero



I shall keep trying..

Re: RFXCom RAW transmit in Domoticz

Posted: Monday 19 July 2021 22:49
by EdwinK
Yes, please do ;)

How did you convert to hex? I'm thinking this is way above my level of knowledge

I tried with:

Code: Select all

$ python rfxcmd.py -d /dev/ttyUSB0 -f -v 300a360a3231370a3833320a3330320a3833320a3330330a3833310a3330340a
3833330a3330310a3833330a3330310a3434300a3639360a3433390a3639340a3434330a3639350a3434320a3639320a3833370a3330330a3833320a3330300a3
833330a3330340a3433390a3639340a3434350a3639310a3434330a3639330a3434310a3639340a39303030
RFXCMD Version 0.3 (739)
------------------------------------------------
Send                    = 0D 00 00 00 02 00 00 00 00 00 00 00 00 00
Date/Time               = 2021-07-19 22:50:57
Packet Length           = 0D
Packettype              = Interface Control
------------------------------------------------
Received                = 01 03
Date/Time               = 2021-07-19 22:50:58
Packet Length           = 01
Packettype              = Undecoded RF Message
Traceback (most recent call last):
  File "rfxcmd.py", line 4838, in <module>
    main()
  File "rfxcmd.py", line 4806, in main
    option_send()
  File "rfxcmd.py", line 4224, in option_send
    read_rfx()
  File "rfxcmd.py", line 3830, in read_rfx
    decodePacket( message )
  File "rfxcmd.py", line 1108, in decodePacket
    print "Subtype\t\t\t= " + rfx.rfx_subtype_03[subtype]
UnboundLocalError: local variable 'subtype' referenced before assignment
The long line of numbers I got when converting to hex on https://www.online-toolz.com/tools/text ... vertor.php

Re: RFXCom RAW transmit in Domoticz

Posted: Monday 19 July 2021 23:03
by solarboy
OK, I have it working as a script.

You need to run the command in rfxmgr and note the actual RAW code it generates in the yellow window.

Then paste this IN QUOTES into the command.

For example:

sudo ./rfxcmd/rfxcmd.py -d /dev/ttyUSB0 -s "38 7F 00 07 19 00 C3 01 92 02 3D 02 D1 00 FC 02 D8 00 F5 02 D5 00 F9 02 DF 00 EF 01 92 02 3C 02 D6 00 F8 02 D7 00 F6 01 93 02 3A 02 D9 00 F6 02 D6 00 F8 02 DA 00 F3 27 10"

I can execute this "sh" script without issue but if I try to call it from within Domoticz, it fails with "Error: Error executing script command (/home/pi/domoticz/scripts/luccion1.sh). returned: 256" which is leading me down a complete other rabbit hole....

Re: RFXCom RAW transmit in Domoticz

Posted: Monday 19 July 2021 23:05
by solarboy
Forget converting to hex, the yellow window output of rfxmgr already does this for you. Now to fix the 256 error...

Re: RFXCom RAW transmit in Domoticz

Posted: Monday 19 July 2021 23:08
by EdwinK
I'll try this later tomorrow. don't feel like removing the RFXcom transciever from my pi now. It's getting late for this old person.:)

Re: RFXCom RAW transmit in Domoticz

Posted: Tuesday 20 July 2021 0:45
by solarboy
Finally got this working, needed to use absolute paths in the scripts..
So for example...

To turn my fan onto level 1, the script is

sudo /home/pi/domoticz/scripts/rfxcmd/rfxcmd.py -d /dev/ttyUSB0 -s "38 7F 00 07 19 00 C3 01 92 02 3D 02 D1 00 FC 02 D8 00 F5 02 D5 00 F9 02 DF 00 EF 01 92 02 3C 02 D6 00 F8 02 D7 00 F6 01 93 02 3A 02 D9 00 F6 02 D6 00 F8 02 DA 00 F3 27 10"

Where rfxcmd.py is installed in DIR "rfxcmd"

All working now thanks to Bert at RFXCOM, Walter in the scripting forum and Edwin and of course the original poster Vic3198.

Re: RFXCom RAW transmit in Domoticz

Posted: Tuesday 20 July 2021 10:55
by EdwinK
This line works now :)

sudo /home/pi/domoticz/scripts/rfxcmd/rfxcmd.py -d /dev/ttyUSB0 -s "48 7F 00 0F 06 01 03 03 40 01 2E 03 3F 01 30 03 3F 01 2E 03 45 01 2C 01 B6 02 B6 01 BB 02 B5 03 44 01 2C 01 BA 02 B5 01 B8 02 B7 03 45 01 2C 03 43 01 28 03 44 01 2E 03 43 01 2C 03 40 01 2D 03 45 01 2C 03 40 01 2D 23 28"

Re: RFXCom RAW transmit in Domoticz

Posted: Tuesday 20 July 2021 11:24
by EdwinK
From this screen, what code do I need. The line between the '=====' or the line beneed the Nbr of pulses?
rfxmanager.png
rfxmanager.png (26.24 KiB) Viewed 11933 times

Re: RFXCom RAW transmit in Domoticz

Posted: Tuesday 20 July 2021 11:54
by solarboy
The bit between the double lines after "command"..it needs to be in quotes to work in the script.

"48........28"

Your 1st example today should work.., well it would have worked on my system, certainly looks like hex to me.

Re: RFXCom RAW transmit in Domoticz

Posted: Tuesday 20 July 2021 12:01
by EdwinK
Going to try it later. Thanks

Re: RFXCom RAW transmit in Domoticz

Posted: Tuesday 20 July 2021 12:02
by solarboy
As we both have rfxcmd.py installed in the same location you could try copying my example and seeing if you still get that error.

Re: RFXCom RAW transmit in Domoticz

Posted: Tuesday 20 July 2021 12:09
by EdwinK
Nothing seems to happen, but at least it doesn't give an error.

Your line is much shorter then what I'm having. Maybe that's the problem.