I've been working hours on a python script outside of domoticz, which now gives me satisfaction.
Now is the time to put it in domoticz, so I copy/paste my script in the embedded Python Events editor.
And I always get the same error: (CRC being one of the subroutines I defined)
Code: Select all
2023-04-29 20:46:01.416 Error: NameError: name 'CRC' is not defined
I tried to move my script to the scripts/python folder of domoticz and I get the same issue by the way.
On the same machine, if I call from cmdline
Code: Select all
python3 script_time_myscript.py
So I did a simple test:
Code: Select all
import DomoticzEvents as DE
DE.Log("tadaaaaa")
Code: Select all
2023-04-29 20:48:28.344 tadaaaaa
Code: Select all
import DomoticzEvents as DE
def message(text):
DE.Log(text)
message("tadaaaaa")
Code: Select all
2023-04-29 20:49:40.817 Error: Traceback (most recent call last):
2023-04-29 20:49:40.817 Error: File "Script #1", line 6, in <module>
2023-04-29 20:49:40.817 Error: File "Script #1", line 4, in message
2023-04-29 20:49:40.817 Error: NameError: name 'DE' is not defined
I couldn't find any topic about this anywhere on this forum or on the net.
Anyone with ideas ?
Thank a lot guys !