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
Logging to domoticz log from Python script.
Moderator: leecollings
-
- Posts: 27
- Joined: Saturday 12 January 2019 11:48
- Target OS: Windows
- Domoticz version: 4.9701
- Contact:
Re: Logging to domoticz log from Python script.
You can not run script that use Domoticz outside of Domoticz.
Press Settings -> Advanced -> Events. Choose Python, name it, edit it and test.
https://www.domoticz.com/wiki/Scripts#Python_scripts
Press Settings -> Advanced -> Events. Choose Python, name it, edit it and test.
https://www.domoticz.com/wiki/Scripts#Python_scripts
Who is online
Users browsing this forum: No registered users and 1 guest