Logging to domoticz log from Python script.
Posted: Thursday 21 February 2019 16:44
Hello all,
I have a python script which sorts the pictures uploaded from the smartphones in a specific folder structure.
The script ran before on a Synology and now it runs on the same Raspi as the Domoticz.
Before on Synology when an error occurred the script would send me an email. I got this running on the Raspi using the Domoticz JSON Api.
I would like the script to log this error to the domoticz log as well, but I can not get it to work.
This example doesn't work, why?
1. Create test_log.py in the shell
import domoticz
domoticz.log('Hello World')
2. Run python 3 test_log.py brings "No object log in module".
What am I doing wrong?
Regards
Kemal
I have a python script which sorts the pictures uploaded from the smartphones in a specific folder structure.
The script ran before on a Synology and now it runs on the same Raspi as the Domoticz.
Before on Synology when an error occurred the script would send me an email. I got this running on the Raspi using the Domoticz JSON Api.
I would like the script to log this error to the domoticz log as well, but I can not get it to work.
This example doesn't work, why?
1. Create test_log.py in the shell
import domoticz
domoticz.log('Hello World')
2. Run python 3 test_log.py brings "No object log in module".
What am I doing wrong?
Regards
Kemal