Python template script error
Posted: Sunday 27 September 2020 12:18
Hi,
Using Domoticz Version 2020.2 (April 26th 2020), I have an error when trying to use the template script in Setup > More > Events > + > Python.
Reducing the script to its simplest expression:
myPythonScript :
I still have the same error:
2020-09-27 11:50:00.159 Error: Pyhton Event System: Failed to parse parameters: string expected.
2020-09-27 11:50:00.159 Error: EventSystem: Failed to execute python event script "myPythonScript"
2020-09-27 11:50:00.159 Error: EventSystem: TypeError: function takes exactly 1 argument (2 given)
2020-09-27 11:50:00.159 Error: EventSystem:
2020-09-27 11:50:00.159 Error: EventSystem: The above exception was the direct cause of the following exception:
2020-09-27 11:50:00.159 Error: EventSystem:
2020-09-27 11:50:00.159 Error: EventSystem: Traceback (most recent call last):
2020-09-27 11:50:00.159 Error: EventSystem: File "<string>", line 3, in <module>
2020-09-27 11:50:00.159 Error: EventSystem: File "/home/domoticz/domoticz/scripts/python/domoticz.py", line 42, in log
2020-09-27 11:50:00.159 Error: EventSystem: domoticz_.Log(0, " ".join([str(k) for k in args]))
2020-09-27 11:50:00.159 Error: EventSystem: SystemError: <built-in function Log> returned a result with an error set
2020-09-27 11:50:00.161 Error: Pyhton Event System: Failed to parse parameters: string expected.
Python is correctly installed:
$ python --version
Python 3.7.3
domoticz.py line 42 is doing a domoticz_.Log(...), where domoticz_ is the import DomoticzEvents.
Seems an initialization issue, any idea ?
Thanks
Using Domoticz Version 2020.2 (April 26th 2020), I have an error when trying to use the template script in Setup > More > Events > + > Python.
Reducing the script to its simplest expression:
myPythonScript :
Code: Select all
import domoticz
domoticz.log("Hi Domoticz!")
2020-09-27 11:50:00.159 Error: Pyhton Event System: Failed to parse parameters: string expected.
2020-09-27 11:50:00.159 Error: EventSystem: Failed to execute python event script "myPythonScript"
2020-09-27 11:50:00.159 Error: EventSystem: TypeError: function takes exactly 1 argument (2 given)
2020-09-27 11:50:00.159 Error: EventSystem:
2020-09-27 11:50:00.159 Error: EventSystem: The above exception was the direct cause of the following exception:
2020-09-27 11:50:00.159 Error: EventSystem:
2020-09-27 11:50:00.159 Error: EventSystem: Traceback (most recent call last):
2020-09-27 11:50:00.159 Error: EventSystem: File "<string>", line 3, in <module>
2020-09-27 11:50:00.159 Error: EventSystem: File "/home/domoticz/domoticz/scripts/python/domoticz.py", line 42, in log
2020-09-27 11:50:00.159 Error: EventSystem: domoticz_.Log(0, " ".join([str(k) for k in args]))
2020-09-27 11:50:00.159 Error: EventSystem: SystemError: <built-in function Log> returned a result with an error set
2020-09-27 11:50:00.161 Error: Pyhton Event System: Failed to parse parameters: string expected.
Python is correctly installed:
$ python --version
Python 3.7.3
domoticz.py line 42 is doing a domoticz_.Log(...), where domoticz_ is the import DomoticzEvents.
Seems an initialization issue, any idea ?
Thanks