-
Notifications
You must be signed in to change notification settings - Fork 2
Process
Jos van der Zande edited this page Jun 20, 2023
·
7 revisions
The main script "script_time_garbagecalendar.lua" needs to be stored in the "domoticz/scripts/lua" or "domoticz/scripts/dzvents/scripts" directory which will cause it to be triggered each minute.
The main script will load your personal configuration from "garbagecalendar/garbagecalendarconfig.lua", where you have defined all required information as explained in the Setup Wiki page.
It will read the information from the variable "garbagetype_cfg" table to check for the specified update/notification times defined, and when one of these times is equal to the current time, the following things will happen:
- When the garbagetype field contains "reloaddata", a background batchjob will be submitted to update the data without holding up the event system. The retrieved data will be stored in file "garbagecalendar_*modulename*.data" and the retrieval process information in "garbagecalendar_*modulename*_run_webupdate_backgound.log". They will both be located in the directory you specified for "datafilepath". This process will be ran in the foreground immediately in case the "garbagecalendar_*modulename*.data" doesn't exist yet and one of the check times is valid, to ensure the data is there to work with.
- The next number of events, as defined with ShowNextEvents, will be merged into a text field, with the format as defined with textformat.
- Update the defined Domoticz Text Dummy Device with this formatted text.
- When it contains a valid Garbage type and the hour & min are equal to the current time, a notification will be send as specified in the garbagecalendarconfig.lua file.
More information can be found or questions can asked here: https://www.domoticz.com/forum/viewtopic.php?f=61&t=31295