I found many tutorials to install and configure python-broadlink, but all of them are for python 2, and the script has been ported to python3, so I decided to write this little howto.
Tested on a freshly installed Debian Buster container.
Run all commands with root privileges:
apt update
apt upgrade
apt install python3-dev python3-pip git
git clone https://github.com/mjg59/python-broadlink.git
cd python-broadlink/
pip3 install -r requirements.txt
pip3 install broadlink
Now you can test everything is working by going to the cli folder and choosing to learn a new command or send any of the commands you already have detected.
cd cli/
./broadlink_cli -h
./broadlink_cli --host 192.168.2.XX --mac 780f77XXXXXX --type 0x2712 --learnfile patata.txt
./broadlink_cli --host 192.168.2.XX --mac 780f77XXXXXX --type 0x2712 --send @patata.txt
./broadlink_cli --host 192.168.2.XX --mac 780f77XXXXXX --type 0x2712 --send 26004800000125941113103810141038103810131137111310381014103810131113103811121137113810381013111310131137111310131113101311131038101410131014103811000d05
If you already use the Broadlink e-Control app, you can use this tool to extract all the devices' codes to be used as above: https://github.com/NightRang3r/Broadlink-e-control-db-dump
Hi, finally able to control my Mini 3 remotely. Great work !
Asking for help I am not an expert ; but while the script work on the commandline on my raspberry; I can't get it to work in Domoticz running it as a script on a virtual switch. It results in error ;
On the command line this works:
python3 ~/python-broadlink/cli/./broadlink_cli --host 192.168.1.165 --mac 24dfa7dece41 --type 0x5f36 --send @futjiton.txt > /dev/null 2>&1
**This script
#!/usr/bin/env python3
python3 ~/python-broadlink/cli/./broadlink_cli --host 192.168.1.165 --mac 24dfa7dece41 --type 0x5f36 --send @futjiton.txt > /dev/null 2>&1
exit 0
Saved as aircoon.sh does not work, nor on the command line nor in Domoticz ; it gives a syntax error on command prompt and in Domoticz; "Error: Error executing script command (/home/pi/domoticz/scripts/aircoon.sh). returned: 256"
Any idea what I am doing wrong ? Thks.