Using BROADLINK RM2 on DOMOTICZ
Moderator: leecollings
-
- Posts: 25
- Joined: Tuesday 07 October 2014 17:43
- Target OS: Linux
- Domoticz version: 3.8275
- Location: Genoa Italy
- Contact:
Re: Using BROADLINK RM2 on DOMOTICZ
Hi @forumfab, try now https://github.com/mjg59/python-broadlink
Server Domoticz 3.7243 (usually the last beta) on Debian Linux (Jessie) - Hw homemade with Atom CPU/4 GB RAM
RFXCom and ZWave Stick (Aeon)
RFXCom and ZWave Stick (Aeon)
-
- Posts: 68
- Joined: Monday 25 August 2014 21:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Using BROADLINK RM2 on DOMOTICZ
Hi aldodemi,aldodemi wrote:Hi @forumfab, try now https://github.com/mjg59/python-broadlink
Now it's ok, i'll try
Bests regards
Forumfab
-
- Posts: 68
- Joined: Monday 25 August 2014 21:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Using BROADLINK RM2 on DOMOTICZ
Hi aldodemi,
May i suggest to take a look about the protection of the Broadlink codes, full or parts for the BROADLINK API, in therm of laws .
Any part of code couldn't be use without BROADLINK agreement
Reverse engineering, is fully forbiden ..
Idem for the RM-BRIDGE , full or parts
May i suggest to take a look about the protection of the Broadlink codes, full or parts for the BROADLINK API, in therm of laws .
Any part of code couldn't be use without BROADLINK agreement
Reverse engineering, is fully forbiden ..
Idem for the RM-BRIDGE , full or parts
-
- Posts: 2
- Joined: Friday 03 July 2015 6:17
- Target OS: Linux
- Domoticz version:
- Contact:
Re: Using BROADLINK RM2 on DOMOTICZ
aldodemi wrote:Found another way to drive RM2 directly from Domoticz (I'm trying at least to do that ):
https://github.com/mjg59/python-broadlink
From python it works, now try to integrate in Domoticz.
I've created two different python command file:
- one to record code
- one to send code
As I have two device from Broadlink (RM2 and A1) I need to search for the correct one before learn code or send code via RM2.....
hI Aldo
please share your record command file.
i am not familiar with python.
thanks
diego
- sisaenkov
- Posts: 50
- Joined: Friday 27 May 2016 7:21
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.8
- Location: Moscow, Russia
- Contact:
Re: Using BROADLINK RM2 on DOMOTICZ
Broadlink RM Tasker supports RM3 mini since v1.3.0.
I use this app with domoticz and RM-Pro.
I use this app with domoticz and RM-Pro.
-
- Posts: 228
- Joined: Thursday 21 May 2015 9:08
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Contact:
Re: RE: Re: Using BROADLINK RM2 on DOMOTICZ
So you can write a tutorial in the wiki? As i understand it only works with Domoticz in combination with Windows?sisaenkov wrote:Broadlink RM Tasker supports RM3 mini since v1.3.0.
I use this app with domoticz and RM-Pro.
Hmzz read the rm Tasker. But it says it's a battery drainer.
- sisaenkov
- Posts: 50
- Joined: Friday 27 May 2016 7:21
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.8
- Location: Moscow, Russia
- Contact:
Re: RE: Re: Using BROADLINK RM2 on DOMOTICZ
I use Android wall tablet with this plugin and Raspberry with Domoticz.Justintime wrote:So you can write a tutorial in the wiki? As i understand it only works with Domoticz in combination with Windows?
There is no promblems to make it works.
You can get HTTP-command for IR/RF action from RM Plugin's Web API and put it in the On/Off-field of any Dummy-switch.
P.S.
Here is my little example of using RM-Pro with wireless roller blinds: https://www.youtube.com/watch?v=opL8yxLomHI
Yes, it is.Hmzz read the rm Tasker. But it says it's a battery drainer.
I'm waiting for Orange Pi to setup Android on it. Then will transfer RM Tasker from tablet to OPi.
-
- Posts: 228
- Joined: Thursday 21 May 2015 9:08
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Contact:
Re: RE: Re: RE: Re: Using BROADLINK RM2 on DOMOTICZ
Yes i understand if you have a wall tablet for Domoticz there is no problem with battery drain.sisaenkov wrote:I use Android wall tablet with this plugin and Raspberry with Domoticz.Justintime wrote:So you can write a tutorial in the wiki? As i understand it only works with Domoticz in combination with Windows?
There is no promblems to make it works.
You can get HTTP-command for IR/RF action from RM Plugin's Web API and put it in the On/Off-field of any Dummy-switch.
P.S.
Here is my little example of using RM-Pro with wireless roller blinds: https://www.youtube.com/watch?v=opL8yxLomHI
Yes, it is.Hmzz read the rm Tasker. But it says it's a battery drainer.
I'm waiting for Orange Pi to setup Android on it. Then will transfer RM Tasker from tablet to OPi.
And this is another way to get it work in Domoticz. Not the one I need.
But thanks for sharing though. Looks nice.
-
- Posts: 12
- Joined: Sunday 19 July 2015 14:27
- Target OS: Linux
- Domoticz version: 3.5837
- Location: Norfolk, UK
- Contact:
Re: Using BROADLINK RM2 on DOMOTICZ
Firstly Domoticz is a great piece of software
Using the python library from Matthew Garrett:-https://github.com/mjg59/python-broadlink I have created a some python scripts. One that locates the devices and reveals the required Host and MAC addresses, one that writes a learned code to a text file and another that reads it back and plays it through my blackbean RM3 mini IR. Banggood.com are selling these for £11 with free shipping: http://www.banggood.com/Broadlink-Black ... s=category
After a battle I now have a dummy Domoticz switch that turns my TV on and off! This only needs python and the library created by Matthew- no need for RM Bridge... It is simple to use as the script does not need changing per remote code only a text file (which is passed as a parameter) creating for each code.
I am running Domoticz on an Ubuntu Server, Domoticz v3.5837, Python 2.7
Python script for locating your Broadlink devices
Python script for learning a remote code and saving to a text file - runs from command line (learn.py)
Python script to play back from text file (playcode.py). Test this from the command line first and then comment out the print and time.sleep lines so it runs faster from within Domoticz.
The path to put in your dummy switch on & off action is something like:
Important: After the path to the script, you need a space and the full path to the text file containing the learned code.
Using the python library from Matthew Garrett:-https://github.com/mjg59/python-broadlink I have created a some python scripts. One that locates the devices and reveals the required Host and MAC addresses, one that writes a learned code to a text file and another that reads it back and plays it through my blackbean RM3 mini IR. Banggood.com are selling these for £11 with free shipping: http://www.banggood.com/Broadlink-Black ... s=category
After a battle I now have a dummy Domoticz switch that turns my TV on and off! This only needs python and the library created by Matthew- no need for RM Bridge... It is simple to use as the script does not need changing per remote code only a text file (which is passed as a parameter) creating for each code.
I am running Domoticz on an Ubuntu Server, Domoticz v3.5837, Python 2.7
Python script for locating your Broadlink devices
Code: Select all
#!/usr/bin/python
#Script to locate Broadlink devices on local network by Graeme Brown Dec 23 2016
#These must be set up using the Broadlink app first!
import broadlink
import time
print "************************************************"
print "Using python library created by Matthew Garrett"
print "https://github.com/mjg59/python-broadlink"
print "************************************************"
print "Scanning network for Broadlink devices...."
mydevices = broadlink.discover(timeout=5)
print "Found " + str(len(mydevices )) + " broadlink devices"
time.sleep(1)
print "..............."
for index, item in enumerate(mydevices):
mydevices[index].auth()
ipadd = mydevices[index].host
ipadd = str(ipadd)
print "Device " + str(index + 1) +" Host address = " + ipadd[1:19]
macadd = ''.join(format(x, '02x') for x in mydevices[index].mac[::-1])
macadd = str(macadd)
mymacadd = macadd[:2] + " " + macadd[2:4] + " " + macadd[4:6] + " " + macadd[6:8] + " " + macadd[8:10] + " " + macadd[10:12]
print "Device " + str(index + 1) +" MAC address = " + mymacadd
print "..............."
Code: Select all
#!/usr/bin/python
import broadlink
import time
import sys
device = broadlink.rm(host=("<your RM3 IP address>",80), mac=bytearray.fromhex("<your RM3 mac>"))
print "Connecting to Broadlink device...."
device.auth()
time.sleep(1)
print "Connected...."
codeName = raw_input("Please Enter Code Name e.g. tvOff ")
time.sleep(1)
print "When Broadlink white led is lit press the button on your remote within 5 seconds"
device.host
device.enter_learning()
time.sleep(5)
ir_packet = device.check_data()
#convert code to hex
myhex = str(ir_packet).encode('hex');
if ir_packet == None:
print "No button press read - quitting"
sys.exit()
else:
# record learned hex code to file
f = open(codeName +".txt",'w')
f.write(myhex)
f.close()
print "Hex code written to file named " + codeName + ".txt"
Code: Select all
#!/usr/bin/python
import broadlink
import time
import sys
try:
fileName = sys.argv[1]
except IndexError:
fileName = 'null'
if fileName == 'null':
print "Error - no file name parameter suffixed"
sys.exit()
else:
device = broadlink.rm(host=("<your RM3 IP address>",80), mac=bytearray.fromhex("<your RM3 mac>"))
print "Connecting to Broadlink device...."
device.auth()
time.sleep(1)
print "Connected...."
time.sleep(1)
device.host
file = open(fileName, 'r')
myhex = file.read()
device.send_data(myhex.decode('hex'))
print "Code Sent...."
Code: Select all
script:///home/domoticz/scripts/python/playcode.py /home/domoticz/scripts/python/tvOff.txt
Last edited by noddy119 on Friday 23 December 2016 20:08, edited 4 times in total.
- sisaenkov
- Posts: 50
- Joined: Friday 27 May 2016 7:21
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.8
- Location: Moscow, Russia
- Contact:
Re: Using BROADLINK RM2 on DOMOTICZ
Nice way. Seems to be easier, but not so fast as Android plugin.
Re: Using BROADLINK RM2 on DOMOTICZ
This is normal that actually this script is slower than rm-bridge, it does not stay connected to the broadlink like the later. In fact it needs to connect each time you send a command which takes several seconds.
If someone can build a script that runs like a daemon and waiting for commands to send to the braoadlink, it will become much faster that the rm-bridge because all commands will be sent locally with no handshake directly to the device.
Thanks to have built this script already, a very good thing in the right direction to control these really cheap ir and rf blasters.
If someone can build a script that runs like a daemon and waiting for commands to send to the braoadlink, it will become much faster that the rm-bridge because all commands will be sent locally with no handshake directly to the device.
Thanks to have built this script already, a very good thing in the right direction to control these really cheap ir and rf blasters.
Re: Using BROADLINK RM2 on DOMOTICZ
Finally, just without all the sleep instructions in the playback code, make it as fast as the Android bridge or even faster. May be these sleep instruction are in case the device does not respond promptly but in my case with an RM2 I have no problems at all without the sleep instructions.
-
- Posts: 12
- Joined: Sunday 19 July 2015 14:27
- Target OS: Linux
- Domoticz version: 3.5837
- Location: Norfolk, UK
- Contact:
Re: Using BROADLINK RM2 on DOMOTICZ
Thanks djassa1.
I changed my original post to advise to comment out the sleep and print lines as once you have it working via the command line they are not needed and do slow the execution down. I have a dummy switch linked to a mute code and there is no lag at all.
I changed my original post to advise to comment out the sleep and print lines as once you have it working via the command line they are not needed and do slow the execution down. I have a dummy switch linked to a mute code and there is no lag at all.
Re: Using BROADLINK RM2 on DOMOTICZ
Thanks to you noddy119 and to the library developer to bring us finally a non dependent app to a tier application to control the broadlink. Now, no reason to have an Android device with a pretty instable gateway app that make the broadlink unusable some times.
Yes the playback is really fast and react as expected.
Yes the playback is really fast and react as expected.
-
- Posts: 68
- Joined: Monday 25 August 2014 21:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Using BROADLINK RM2 on DOMOTICZ
Hi all,
I did send some mails to BROADLINK's Team about this new project ( Python project)
For the moment there is no negativ reaction
In my point of view, it's a good new !
Of course the RM BRIDGE and RM WINDOWS TOOLS are still protected
But i think that it could be a great solution to have a full Python solution too.
In my point of view, this solution will be a full alternativ if :
- This solution could be a full package that could be simply install under linux ( wheezy, and Jessie )
- This package could integrated the librairies and the applications .PY and all other tools
- This project could arrive with the integration of an API ( like on the RM BRIDGE)
Bests regards
I did send some mails to BROADLINK's Team about this new project ( Python project)
For the moment there is no negativ reaction
In my point of view, it's a good new !
Of course the RM BRIDGE and RM WINDOWS TOOLS are still protected
But i think that it could be a great solution to have a full Python solution too.
In my point of view, this solution will be a full alternativ if :
- This solution could be a full package that could be simply install under linux ( wheezy, and Jessie )
- This package could integrated the librairies and the applications .PY and all other tools
- This project could arrive with the integration of an API ( like on the RM BRIDGE)
Bests regards
-
- Posts: 228
- Joined: Thursday 21 May 2015 9:08
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Contact:
Re: Using BROADLINK RM2 on DOMOTICZ
I think they will benefit also. If there is a "noob" way for implenting this in Domoticz. They will sell more..... as i speak for myself. I will order one.forumfab wrote:Hi all,
I did send some mails to BROADLINK's Team about this new project ( Python project)
For the moment there is no negativ reaction
In my point of view, it's a good new !
Of course the RM BRIDGE and RM WINDOWS TOOLS are still protected
But i think that it could be a great solution to have a full Python solution too.
In my point of view, this solution will be a full alternativ if :
- This solution could be a full package that could be simply install under linux ( wheezy, and Jessie )
- This package could integrated the librairies and the applications .PY and all other tools
- This project could arrive with the integration of an API ( like on the RM BRIDGE)
Bests regards
Programming is not my cup of tea. Not with a proper manual.
-
- Posts: 7
- Joined: Friday 04 March 2016 14:04
- Target OS: NAS (Synology & others)
- Domoticz version:
- Contact:
Re: Using BROADLINK RM2 on DOMOTICZ
Hello everybody.
Could someone explain the steps to use the python script ?.
I have copied the setup.py file and the Broadlink folder from the GitHub project, into a Raspberry Pi but I do not know how to make it work.
Could someone explain the steps to use the python script ?.
I have copied the setup.py file and the Broadlink folder from the GitHub project, into a Raspberry Pi but I do not know how to make it work.
-
- Posts: 7
- Joined: Friday 04 March 2016 14:04
- Target OS: NAS (Synology & others)
- Domoticz version:
- Contact:
Re: Using BROADLINK RM2 on DOMOTICZ
Hi,
I created a file called learn.py with the Noddy119 code.
But this gives the following error:
I created a file called learn.py with the Noddy119 code.
But this gives the following error:
Code: Select all
pi@raspberrypi:~$ python learn.py
File "learn.py", line 3
import broadlink
^
IndentationError: unexpected inden
t
pi@raspberrypi:~$
- Keptenkurk
- Posts: 103
- Joined: Wednesday 21 August 2013 17:24
- Target OS: -
- Domoticz version:
- Location: Waalre, The Netherlands
- Contact:
Re: Using BROADLINK RM2 on DOMOTICZ
@getafe83. I sent you a PM
/paul
/paul
Re: Using BROADLINK RM2 on DOMOTICZ
Thanks @siklosi I will give it a try and let you know if it's faster than doing the whole handshake every time.
Who is online
Users browsing this forum: Google [Bot] and 1 guest