Python Plugin: Broadlink RM2

Python and python framework
jlites00
Posts: 25
Joined: Friday 31 March 2017 19:47
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post by jlites00 » Monday 03 April 2017 21:00

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: 11
Joined: Saturday 25 March 2017 17:42
Target OS: -
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post by shoyboom » Wednesday 05 April 2017 18:23

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: 321
Joined: Sunday 22 January 2017 12:37
Target OS: Windows
Domoticz version: V3.8153
Contact:

Re: Python Plugin: Broadlink RM2

Post by zak45 » Thursday 06 April 2017 19:12

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: 914
Joined: Wednesday 10 December 2014 14:06
Target OS: Linux
Domoticz version: beta
Location: Bordeaux France
Contact:

Re: RE: Re: Python Plugin: Broadlink RM2

Post by deennoo » Thursday 06 April 2017 20:01

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 / ESP8266 / MQTT / BLE
http://domo-attitude.fr

farhanito
Posts: 32
Joined: Friday 19 August 2016 5:39
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post by farhanito » Thursday 06 April 2017 20:15

Should this run on Windows 10 32bit?
i can't run the setup.exe

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

Re: Python Plugin: Broadlink RM2

Post by jlites00 » Friday 07 April 2017 10:21

Looking forward to the next update.

claudioita
Posts: 10
Joined: Wednesday 19 April 2017 10:57
Target OS: -
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post by claudioita » Wednesday 19 April 2017 13:41

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: 25
Joined: Friday 31 March 2017 19:47
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post by jlites00 » Wednesday 19 April 2017 14:14

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

Re: Python Plugin: Broadlink RM2

Post by claudioita » Wednesday 19 April 2017 14:22

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: 25
Joined: Friday 31 March 2017 19:47
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post by jlites00 » Wednesday 19 April 2017 14:26

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

Re: Python Plugin: Broadlink RM2

Post by claudioita » Wednesday 19 April 2017 14:34

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: 407
Joined: Tuesday 14 January 2014 15:50
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post by markk » Thursday 20 April 2017 0:52

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: 541
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 » Thursday 20 April 2017 11:24

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 :(
Domotica - Intel nuc Celeron, Domoticz - Windows, RFXTRX433E. 1-Wire USB. Lan Relay Boards, Aeon Z-Stick Gen 5, Evohome HGI80, Milight WiFi, MySensors Ethernet Gateway, Harmony Hub, Broadlink RM2, HA-Bridge with Amazon Echo / Alexa.

markk
Posts: 407
Joined: Tuesday 14 January 2014 15:50
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post by markk » Thursday 20 April 2017 11:51

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: 541
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 » Thursday 20 April 2017 12:07

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.
Domotica - Intel nuc Celeron, Domoticz - Windows, RFXTRX433E. 1-Wire USB. Lan Relay Boards, Aeon Z-Stick Gen 5, Evohome HGI80, Milight WiFi, MySensors Ethernet Gateway, Harmony Hub, Broadlink RM2, HA-Bridge with Amazon Echo / Alexa.

zak45
Posts: 321
Joined: Sunday 22 January 2017 12:37
Target OS: Windows
Domoticz version: V3.8153
Contact:

Re: Python Plugin: Broadlink RM2

Post by zak45 » Thursday 20 April 2017 17:26

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 1:17
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post by maninblack30 » Friday 21 April 2017 11:12

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: 321
Joined: Sunday 22 January 2017 12:37
Target OS: Windows
Domoticz version: V3.8153
Contact:

Re: Python Plugin: Broadlink RM2

Post by zak45 » Friday 21 April 2017 13:04

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 1604 times

markk
Posts: 407
Joined: Tuesday 14 January 2014 15:50
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post by markk » Friday 21 April 2017 13:31

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 1:17
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post by maninblack30 » Friday 21 April 2017 14:47

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 2 guests