Page 1 of 1

Broadlink Mini 3 Script not working.

Posted: Tuesday 27 September 2022 9:57
by marcelv
Hi, finally able to control my Broadlink Mini 3 remotely ; using this input https://gist.github.com/jovimon/1c23681 ... 42347dabf7

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.

Re: Broadlink Mini 3 Script not working.

Posted: Tuesday 27 September 2022 11:29
by waltervl
Perhaps try something like adding the & sign

Code: Select all

#!/usr/bin/python3
python3 ~/python-broadlink/cli/./broadlink_cli --host 192.168.1.165 --mac 24dfa7dece41 --type 0x5f36 --send @futjiton.txt > /dev/null 2>&1 &
see also wiki https://www.domoticz.com/wiki/Scripting ... ua_Scripts and viewtopic.php?t=7465

and when running the script from within domoticz add the absolute path to python-broadlink eg home/pi/python-broadlink/cli/./broadlink_cli

Re: Broadlink Mini 3 Script not working.

Posted: Wednesday 28 September 2022 18:32
by marcelv
Wow, thanks Walter, it works on Domoticz. In the end this script worked based on your input.

- Added &
- Added path for broadlink_cli
- Added path for fujiofff.txt

Thanks a lot !

#!/bin/sh
python3 /home/pi/python-broadlink/cli/broadlink_cli --host 192.168.1.169 --mac 24dfa7dece41 --type 0x5f36 --send @/home/pi/domoticz/scripts/futjitoff.txt > /dev/null 2>&1 &
exit 0