I wrote a simple Python plugin to control my Pioneer AVR. I can only control my AVR over Telnet commands so I've been searching how to send these commands in Python.
I'm running the latest stable Domoticz package on a Synology NAS.
This is the Python script named piomute.py:
Code: Select all
#!/usr/bin/python
import getpass
import sys
import telnetlib
tn = telnetlib.Telnet("192.168.1.46",8102)
tn.write("VU\n\r")
tn.close()
When I run the script in Terminal or using WinSCP (python piomute.py), it works, and it turns my volume 1 step up.
However, when I run it from a dummy switch, I keep getting
Code: Select all
2017-11-27 10:55:26.878 Executing script: /usr/local/domoticz/var/scripts/python/piomute.py
2017-11-27 10:55:26.887 Error: Error executing script command (/usr/local/domoticz/var/scripts/python/piomute.py). returned: 32256
The permissions are set to 755, the owner of piomute.py is set to domoticz.
Any idea please?