Python Plugin: Broadlink RM2

Python and python framework

Moderator: leecollings

jlites00
Posts: 22
Joined: Friday 31 March 2017 19:47
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post 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
shoyboom
Posts: 12
Joined: Saturday 25 March 2017 16:42
Target OS: -
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post 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
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin: Broadlink RM2

Post 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.
deennoo
Posts: 784
Joined: Wednesday 10 December 2014 13:06
Target OS: Linux
Domoticz version: beta
Location: Bordeaux France
Contact:

Re: RE: Re: Python Plugin: Broadlink RM2

Post 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 !
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
farhanito
Posts: 34
Joined: Friday 19 August 2016 5:39
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post by farhanito »

Should this run on Windows 10 32bit?
i can't run the setup.exe
jlites00
Posts: 22
Joined: Friday 31 March 2017 19:47
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post by jlites00 »

Looking forward to the next update.
claudioita
Posts: 7
Joined: Wednesday 19 April 2017 10:57
Target OS: -
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post 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
jlites00
Posts: 22
Joined: Friday 31 March 2017 19:47
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post 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.
Last edited by jlites00 on Wednesday 19 April 2017 14:27, edited 1 time in total.
claudioita
Posts: 7
Joined: Wednesday 19 April 2017 10:57
Target OS: -
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post 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
jlites00
Posts: 22
Joined: Friday 31 March 2017 19:47
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post 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.
claudioita
Posts: 7
Joined: Wednesday 19 April 2017 10:57
Target OS: -
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post 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
markk
Posts: 267
Joined: Tuesday 14 January 2014 14:50
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post 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)
Running Domoticz on Pi3 with RFXtrx433e. LWRF power sockets and dimmer switches. Integrated my existing wirefree alarm PIRs and door contacts with domoticz. Geofencing with Pilot. Harmony Hub. Tado for Heating. Now playing with mysensors.
User avatar
StanHD
Posts: 347
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Re: Python Plugin: Broadlink RM2

Post 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 :(
Domoticz Main - Intel nuc, Windows, RFXTRX433E. Lan Relay Boards, Aeon Z-Stick Gen 5, Evohome HGI80, Milight WiFi, MySensors Ethernet Gateway, Harmony Hub
Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa
markk
Posts: 267
Joined: Tuesday 14 January 2014 14:50
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post 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?!
Running Domoticz on Pi3 with RFXtrx433e. LWRF power sockets and dimmer switches. Integrated my existing wirefree alarm PIRs and door contacts with domoticz. Geofencing with Pilot. Harmony Hub. Tado for Heating. Now playing with mysensors.
User avatar
StanHD
Posts: 347
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Re: Python Plugin: Broadlink RM2

Post 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.
Domoticz Main - Intel nuc, Windows, RFXTRX433E. Lan Relay Boards, Aeon Z-Stick Gen 5, Evohome HGI80, Milight WiFi, MySensors Ethernet Gateway, Harmony Hub
Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin: Broadlink RM2

Post 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.
maninblack30
Posts: 17
Joined: Thursday 10 November 2016 0:17
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post 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
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin: Broadlink RM2

Post 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 3885 times
markk
Posts: 267
Joined: Tuesday 14 January 2014 14:50
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post 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.
Running Domoticz on Pi3 with RFXtrx433e. LWRF power sockets and dimmer switches. Integrated my existing wirefree alarm PIRs and door contacts with domoticz. Geofencing with Pilot. Harmony Hub. Tado for Heating. Now playing with mysensors.
maninblack30
Posts: 17
Joined: Thursday 10 November 2016 0:17
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post 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!
:-)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest