domo newbie, simple python script failing
Posted: Sunday 30 October 2016 17:04
hi there, i'm looking for a bit of guidance. i'm new to domo, but not to python, and i'm trying to get a simple python script connected so that i can start building proper logic with the JSON APIs and such...
i'm in ubuntu, latest version of domo. simple dummy hardware, simple dummy switch. in the scripts/python directory i've made test.py:
doesn't get more simple than that. on the switch i have on/off wired:
script://home/dave/domoticz/scripts/python/test.py
script is set to executable:
-rwxrwxrwx 1 dave dave 225 Oct 29 22:10 test.py
"which python" shows py 2.7 installed appropriately at /usr/bin/python
python --version shows 2.7.12
i get *nothing* when i click the switch in the UI. i see it's clicking, because there are log entries, but i get no indication my script is being run.
i changed the URL of the script to have three slashes, and that throws a script error 32512 which i believe means it's not finding the script appropriately, so back to double slashes. the log shows:
2016-10-30 12:01:43.025 User: dz initiated a switch command (1/test switch/Off)
2016-10-30 12:01:43.025 (test) Light/Switch (test switch)
2016-10-30 12:01:47.510 User: dz initiated a switch command (1/test switch/On)
2016-10-30 12:01:47.510 (test) Light/Switch (test switch)
this is the most simple of the simple. yet, i'm stuck.
i'd appreciate some guidance, apologies for such a dumb one.
--- dz
i'm in ubuntu, latest version of domo. simple dummy hardware, simple dummy switch. in the scripts/python directory i've made test.py:
Code: Select all
#!usr/bin/python
import domoticz
domoticz.log("script")
domoticz.error("error")
script://home/dave/domoticz/scripts/python/test.py
script is set to executable:
-rwxrwxrwx 1 dave dave 225 Oct 29 22:10 test.py
"which python" shows py 2.7 installed appropriately at /usr/bin/python
python --version shows 2.7.12
i get *nothing* when i click the switch in the UI. i see it's clicking, because there are log entries, but i get no indication my script is being run.
i changed the URL of the script to have three slashes, and that throws a script error 32512 which i believe means it's not finding the script appropriately, so back to double slashes. the log shows:
2016-10-30 12:01:43.025 User: dz initiated a switch command (1/test switch/Off)
2016-10-30 12:01:43.025 (test) Light/Switch (test switch)
2016-10-30 12:01:47.510 User: dz initiated a switch command (1/test switch/On)
2016-10-30 12:01:47.510 (test) Light/Switch (test switch)
this is the most simple of the simple. yet, i'm stuck.
i'd appreciate some guidance, apologies for such a dumb one.
--- dz