Page 4 of 12

Re: Python Plugin: Broadlink RM2

Posted: Monday 03 April 2017 21:00
by jlites00
Can the plugin learn Broadlink TC2 switches? http://www.ibroadlink.com/tc2/

I tried a couple times to learn with the plugin but there was no success which led to a research. What I found is unlike any other 433mhz device out there where pairing is a breeze, the TC2 has got a proprietary RF code. @NightRang3r, found a way to decrypt the UDP packet data and dump the codes. I'm wondering if there is a way to manually enter the code into the plugin or even better to learn.


Some links worth to look at...
https://github.com/ericmagnuson/rmcontrol/issues/4
https://github.com/ericmagnuson/rmcontr ... -269480450
https://github.com/NightRang3r/Broadlin ... ol-db-dump
https://drive.google.com/file/d/0B2-DXe ... QyVG8/view
https://translate.google.com/translate? ... m/t/317266

Re: Python Plugin: Broadlink RM2

Posted: Wednesday 05 April 2017 18:23
by shoyboom
hi.
i installed it and it's working good for me and my RM PRO.
i have another device BroadLink SP mini-T1, it is a wifi switch. is there any way controlling it too?
thank you
yaron

Re: Python Plugin: Broadlink RM2

Posted: Thursday 06 April 2017 19:12
by zak45
Glad to see that work...
for other HW, sorry do not have it so not able to test.
The new version will include import data from e-Control application into Domoticz, so maybe this will open other possibility.

Re: RE: Re: Python Plugin: Broadlink RM2

Posted: Thursday 06 April 2017 20:01
by deennoo
zak45 wrote:Glad to see that work...
for other HW, sorry do not have it so not able to test.
The new version will include import data from e-Control application into Domoticz, so maybe this will open other possibility.
Yes !

Re: Python Plugin: Broadlink RM2

Posted: Thursday 06 April 2017 20:15
by farhanito
Should this run on Windows 10 32bit?
i can't run the setup.exe

Re: Python Plugin: Broadlink RM2

Posted: Friday 07 April 2017 10:21
by jlites00
Looking forward to the next update.

Re: Python Plugin: Broadlink RM2

Posted: Wednesday 19 April 2017 13:41
by claudioita
jlites00 wrote:Can the plugin learn Broadlink TC2 switches? http://www.ibroadlink.com/tc2/

I tried a couple times to learn with the plugin but there was no success which led to a research. What I found is unlike any other 433mhz device out there where pairing is a breeze, the TC2 has got a proprietary RF code. @NightRang3r, found a way to decrypt the UDP packet data and dump the codes. I'm wondering if there is a way to manually enter the code into the plugin or even better to learn.


Some links worth to look at...
https://github.com/ericmagnuson/rmcontrol/issues/4
https://github.com/ericmagnuson/rmcontr ... -269480450
https://github.com/NightRang3r/Broadlin ... ol-db-dump
https://drive.google.com/file/d/0B2-DXe ... QyVG8/view
https://translate.google.com/translate? ... m/t/317266

did you manage?

I also have TC2

Re: Python Plugin: Broadlink RM2

Posted: Wednesday 19 April 2017 14:14
by jlites00
claudioita - Yes, I was able to capture the TC2 codes and control using NightRang's python script. However, I've yet to get it to work with Domoticz. And also Zak mentioned the latest update will support importing data from e-control which in turn support TC2.

Re: Python Plugin: Broadlink RM2

Posted: Wednesday 19 April 2017 14:22
by claudioita
jlites00 wrote:claudioita - Yes, I was able to capture the TC2 codes and control using NightRang's python script. However, I've yet to get it to work with Domoticz. And also Zac mentioned the latest update will support importing data from e-control which in turn support TC2.
I am new to domoticz, but I have Home Assistant, which works well with TC2

Re: Python Plugin: Broadlink RM2

Posted: Wednesday 19 April 2017 14:26
by jlites00
same here new to Domoticz. I read somewhere that there's a way to import TC2 code to HA and it works great but I have never used it before.

Re: Python Plugin: Broadlink RM2

Posted: Wednesday 19 April 2017 14:34
by claudioita
jlites00 wrote:same here new to Domoticz. I read somewhere that there's a way to import TC2 code to HA and it works great but I have never used it before.
yes I used it.

Wondering to do the same with domoticz

Re: Python Plugin: Broadlink RM2

Posted: Thursday 20 April 2017 0:52
by markk
StanHD wrote:Hi,

After you have created the individual buttons, create a Selector Switch from the Dummy Hardware, then you can use the jason interface to define the sub-switches:-

Image

Image

You can find a comprehensive explanation of the Jason Interface in the Domoticz Wiki. ;)
Can you explain a bit more about the json interface please? Ive tried to do what you did by creating a custom selector for my aircon and using json to access the various settings via the dummy but nothing happens. this is the json: http://192.168.1.66:8080/json.htm?type= ... itchcmd=On. i get the attached in the log but the switch doesn't operate:

Code: Select all

2017-04-19 23:49:13.725 (IR/RF Broadlink) Calling message handler 'onCommand'.
2017-04-19 23:49:13.726 (IR/RF Broadlink) onCommand called for Unit 4: Parameter 'On', Level: 0 , Connected : True
2017-04-19 23:49:13.726 (IR/RF Broadlink) Generate on Command for learned code stored on unit :4
2017-04-19 23:49:13.730 (IR/RF Broadlink) Code loaded : 260076006c340e0d0e0c0f270e0c10270d0c0f0c0f0c0e290c280e0c0f0c100b0e280d290d0c0e0d0e0c0f0c0f0c0e0e0d0c0f0c0e0d0e0d0e0d0d0d0e0c0f270f0c0e0c0e0d0f0c0e0c0e0e0d0d0e27100b0e0c0f0c0e0e0d270e0d0e0c0f0c0f0d0d0d0e0d0e270f0b0e280e280d280e270e270e280e000d050000
2017-04-19 23:49:13.763 (IR/RF Broadlink) Connected to Broadlink device.
2017-04-19 23:49:13.763 (IR/RF Broadlink) b"&\x00v\x00l4\x0e\r\x0e\x0c\x0f'\x0e\x0c\x10'\r\x0c\x0f\x0c\x0f\x0c\x0e)\x0c(\x0e\x0c\x0f\x0c\x10\x0b\x0e(\r)\r\x0c\x0e\r\x0e\x0c\x0f\x0c\x0f\x0c\x0e\x0e\r\x0c\x0f\x0c\x0e\r\x0e\r\x0e\r\r\r\x0e\x0c\x0f'\x0f\x0c\x0e\x0c\x0e\r\x0f\x0c\x0e\x0c\x0e\x0e\r\r\x0e'\x10\x0b\x0e\x0c\x0f\x0c\x0e\x0e\r'\x0e\r\x0e\x0c\x0f\x0c\x0f\r\r\r\x0e\r\x0e'\x0f\x0b\x0e(\x0e(\r(\x0e'\x0e'\x0e(\x0e\x00\r\x05\x00\x00"
2017-04-19 23:49:13.952 (IR/RF Broadlink) Code Sent....
2017-04-19 23:49:13.953 (IR/RF Broadlink) Command line : "/home/pi/domoticz/plugins/Broadlink/plugin_send.py" C:\\BroadlinkRM2\BroadlinkRM2-24-4.ini
2017-04-19 23:49:13.953 (Aircon Downstairs off) Updating device from 1:'On-9' to have values 1:'On-10'.
2017-04-19 23:49:14.083 (IR/RF Broadlink) Update 1:'On-10' (Aircon Downstairs off)

Re: Python Plugin: Broadlink RM2

Posted: Thursday 20 April 2017 11:24
by StanHD
Can you explain a bit more about the json interface please? Ive tried to do what you did by creating a custom selector for my aircon and using json to access the various settings via the dummy but nothing happens. this is the json: http://192.168.1.66:8080/json.htm?type= ... itchcmd=On. i get the attached in the log but the switch doesn't operate:

Code: Select all

2017-04-19 23:49:13.725 (IR/RF Broadlink) Calling message handler 'onCommand'.
2017-04-19 23:49:13.726 (IR/RF Broadlink) onCommand called for Unit 4: Parameter 'On', Level: 0 , Connected : True
2017-04-19 23:49:13.726 (IR/RF Broadlink) Generate on Command for learned code stored on unit :4
2017-04-19 23:49:13.730 (IR/RF Broadlink) Code loaded : 260076006c340e0d0e0c0f270e0c10270d0c0f0c0f0c0e290c280e0c0f0c100b0e280d290d0c0e0d0e0c0f0c0f0c0e0e0d0c0f0c0e0d0e0d0e0d0d0d0e0c0f270f0c0e0c0e0d0f0c0e0c0e0e0d0d0e27100b0e0c0f0c0e0e0d270e0d0e0c0f0c0f0d0d0d0e0d0e270f0b0e280e280d280e270e270e280e000d050000
2017-04-19 23:49:13.763 (IR/RF Broadlink) Connected to Broadlink device.
2017-04-19 23:49:13.763 (IR/RF Broadlink) b"&\x00v\x00l4\x0e\r\x0e\x0c\x0f'\x0e\x0c\x10'\r\x0c\x0f\x0c\x0f\x0c\x0e)\x0c(\x0e\x0c\x0f\x0c\x10\x0b\x0e(\r)\r\x0c\x0e\r\x0e\x0c\x0f\x0c\x0f\x0c\x0e\x0e\r\x0c\x0f\x0c\x0e\r\x0e\r\x0e\r\r\r\x0e\x0c\x0f'\x0f\x0c\x0e\x0c\x0e\r\x0f\x0c\x0e\x0c\x0e\x0e\r\r\x0e'\x10\x0b\x0e\x0c\x0f\x0c\x0e\x0e\r'\x0e\r\x0e\x0c\x0f\x0c\x0f\r\r\r\x0e\r\x0e'\x0f\x0b\x0e(\x0e(\r(\x0e'\x0e'\x0e(\x0e\x00\r\x05\x00\x00"
2017-04-19 23:49:13.952 (IR/RF Broadlink) Code Sent....
2017-04-19 23:49:13.953 (IR/RF Broadlink) Command line : "/home/pi/domoticz/plugins/Broadlink/plugin_send.py" C:\\BroadlinkRM2\BroadlinkRM2-24-4.ini
2017-04-19 23:49:13.953 (Aircon Downstairs off) Updating device from 1:'On-9' to have values 1:'On-10'.
2017-04-19 23:49:14.083 (IR/RF Broadlink) Update 1:'On-10' (Aircon Downstairs off)
I don't really understand why it sin't working for you.
Have you checked that the "BroadlinkRM2-24-4.ini" is correctly named, and that the correct IDX is used in your JSON command?

Sorry probably not much help :(

Re: Python Plugin: Broadlink RM2

Posted: Thursday 20 April 2017 11:51
by markk
StanHD wrote:
Can you explain a bit more about the json interface please? Ive tried to do what you did by creating a custom selector for my aircon and using json to access the various settings via the dummy but nothing happens. this is the json: http://192.168.1.66:8080/json.htm?type= ... itchcmd=On. i get the attached in the log but the switch doesn't operate:

Code: Select all

2017-04-19 23:49:13.725 (IR/RF Broadlink) Calling message handler 'onCommand'.
2017-04-19 23:49:13.726 (IR/RF Broadlink) onCommand called for Unit 4: Parameter 'On', Level: 0 , Connected : True
2017-04-19 23:49:13.726 (IR/RF Broadlink) Generate on Command for learned code stored on unit :4
2017-04-19 23:49:13.730 (IR/RF Broadlink) Code loaded : 260076006c340e0d0e0c0f270e0c10270d0c0f0c0f0c0e290c280e0c0f0c100b0e280d290d0c0e0d0e0c0f0c0f0c0e0e0d0c0f0c0e0d0e0d0e0d0d0d0e0c0f270f0c0e0c0e0d0f0c0e0c0e0e0d0d0e27100b0e0c0f0c0e0e0d270e0d0e0c0f0c0f0d0d0d0e0d0e270f0b0e280e280d280e270e270e280e000d050000
2017-04-19 23:49:13.763 (IR/RF Broadlink) Connected to Broadlink device.
2017-04-19 23:49:13.763 (IR/RF Broadlink) b"&\x00v\x00l4\x0e\r\x0e\x0c\x0f'\x0e\x0c\x10'\r\x0c\x0f\x0c\x0f\x0c\x0e)\x0c(\x0e\x0c\x0f\x0c\x10\x0b\x0e(\r)\r\x0c\x0e\r\x0e\x0c\x0f\x0c\x0f\x0c\x0e\x0e\r\x0c\x0f\x0c\x0e\r\x0e\r\x0e\r\r\r\x0e\x0c\x0f'\x0f\x0c\x0e\x0c\x0e\r\x0f\x0c\x0e\x0c\x0e\x0e\r\r\x0e'\x10\x0b\x0e\x0c\x0f\x0c\x0e\x0e\r'\x0e\r\x0e\x0c\x0f\x0c\x0f\r\r\r\x0e\r\x0e'\x0f\x0b\x0e(\x0e(\r(\x0e'\x0e'\x0e(\x0e\x00\r\x05\x00\x00"
2017-04-19 23:49:13.952 (IR/RF Broadlink) Code Sent....
2017-04-19 23:49:13.953 (IR/RF Broadlink) Command line : "/home/pi/domoticz/plugins/Broadlink/plugin_send.py" C:\\BroadlinkRM2\BroadlinkRM2-24-4.ini
2017-04-19 23:49:13.953 (Aircon Downstairs off) Updating device from 1:'On-9' to have values 1:'On-10'.
2017-04-19 23:49:14.083 (IR/RF Broadlink) Update 1:'On-10' (Aircon Downstairs off)
I don't really understand why it sin't working for you.
Have you checked that the "BroadlinkRM2-24-4.ini" is correctly named, and that the correct IDX is used in your JSON command?

Sorry probably not much help :(
Hmmmm, the IDX is correct but your mention of the ".ini" got me thinking. I just left it as the default C://blah.blah.blah. but I'm using a Rpi3 so don't have this path. Perhaps I need to create a .ini file elsewhere and change the hardware settings to point to this?!

Re: Python Plugin: Broadlink RM2

Posted: Thursday 20 April 2017 12:07
by StanHD
Hmmmm, the IDX is correct but your mention of the ".ini" got me thinking. I just left it as the default C://blah.blah.blah. but I'm using a Rpi3 so don't have this path. Perhaps I need to create a .ini file elsewhere and change the hardware settings to point to this?!
I think the .ini file is created when you click the "Save" button on the "Command" selector switch. Yes the path is specified in the "Hardware" options.

Re: Python Plugin: Broadlink RM2

Posted: Thursday 20 April 2017 17:26
by zak45
so.. hummm look like you have a .ini file, name is : C:\\BroadlinkRM2\BroadlinkRM2-24-4.ini... little bit strange for a Pi.
So, now, this is stored somewhere on your device. you can do a find to locate it.

Re: Python Plugin: Broadlink RM2

Posted: Friday 21 April 2017 11:12
by maninblack30
Hello all!
First I would like to say that I am really impressed with this plugin, and how quickly Domoticz is developed! It's fantastic!
So thanks everyone involved.

My question is (and it's probably a silly one), but what is the easiest way to make the switches that operate the RM's commands "momentary" as far as their status is? ie. "press on, command is transmitted, status returns to off"?

I know I could do a little script to be triggered everytime one is turned on to turn it off again, but I'm hoping there is a simple "once only" way to apply it to all RM2 commands.

Cheers,

Fraser

Re: Python Plugin: Broadlink RM2

Posted: Friday 21 April 2017 13:04
by zak45
Hi,
there is no way to do that in oneshot for all devices.
On the next release, you should be able to put device off by using Domoticz param:
Capture.JPG
Capture.JPG (57.66 KiB) Viewed 3886 times

Re: Python Plugin: Broadlink RM2

Posted: Friday 21 April 2017 13:31
by markk
zak45 wrote:so.. hummm look like you have a .ini file, name is : C:\\BroadlinkRM2\BroadlinkRM2-24-4.ini... little bit strange for a Pi.
So, now, this is stored somewhere on your device. you can do a find to locate it.
I removed the switches, changed the .ini file location at the Hardware tab to /home/pi/Documents then re-added the switches. All working good now. Thank you.

Re: Python Plugin: Broadlink RM2

Posted: Friday 21 April 2017 14:47
by maninblack30
zak45 wrote:Hi,
there is no way to do that in oneshot for all devices.
On the next release, you should be able to put device off by using Domoticz param:
Capture.JPG
Fantastic!!
Thanks for a quick response!
:-)