djassa1 wrote:Just to be clear, the broadlink python libraryby mjg59 is able to control the RM2 (pro) and the RM3 blackbean.
I suspect that this library also works for some other wifi broadlink devices like the SP and SP2 sockets.
For the installation of the library I just copied it in a PATH reachable python directory:
/usr/local/lib/python2.7/dist-packages/broadlink
No need to do any setup and works like a charm.
Ok, I make:
HOW TO (broadlink python library by mjg59)
Download:
Code: Select all
git clone https://github.com/mjg59/python-broadlink
Go to new folder python-broadlink
If You got any errors check Dependency file:
Code: Select all
/usr/local/lib/python2.7/dist-packages/broadlink-0.1-py2.7.egg/EGG-INFO/dependency_links.txt
Download learn.py and playcode.py
http://www.domoticz.com/forum/viewtopic ... 00#p103517
Make "Static Lease" Your RM on Your router.
Edit in learn.py this line:
Code: Select all
device = broadlink.device(host=("<your RM3 IP address>",80), mac=bytearray.fromhex("<your RM3 mac>"))
My example:
device = broadlink.
rm(host=("
192.168.1.110",80), mac=bytearray.fromhex("
B4430DEEE880"))
Copy learn.py and playcode.py to:
Type "python learn.py" to learn IR and RF codes
Make dummy switch in domoticz
On action example:
Code: Select all
script:///home/pi/domoticz/scripts/python/playcode.py /home/pi/domoticz/scripts/python/tvOn.txt
Or add to HA-Bridge script and control via Alexa or Google Home directly without domoticz:
Code: Select all
[{"item":"python /home/pi/domoticz/scripts/python/playcode.py /home/pi/domoticz/scripts/python/tvOn.txt"}]
Somehow like that if I everything well remember
Good luck
Ps sorry for my language.