Page 16 of 23

Re: GarbageCalendar (new version) lua scripts

Posted: Tuesday 27 April 2021 18:26
by jvdz
Ha... sorry, I was looking at the wrong version number.
In my test, when testing after making the change to the module, I did what is stated in the WebData from the website :

Code: Select all

<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="https://www.stadswerk072.nl/rest/adressen/1486MK-55">here<
so changed

Code: Select all

Hostname=inzamelkalender.stadswerk072.nl
to

Code: Select all

Hostname=www.stadswerk072.nl
and that gave the result I shown earlier.

Jos

Re: GarbageCalendar (new version) lua scripts

Posted: Wednesday 28 April 2021 7:42
by mikeoo
jvdz wrote: Tuesday 27 April 2021 18:26 Ha... sorry, I was looking at the wrong version number.
In my test, when testing after making the change to the module, I did what is stated in the WebData from the website :

Code: Select all

<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="https://www.stadswerk072.nl/rest/adressen/1486MK-55">here<
so changed

Code: Select all

Hostname=inzamelkalender.stadswerk072.nl
to

Code: Select all

Hostname=www.stadswerk072.nl
and that gave the result I shown earlier.

Jos
Tnx, problem solved :D

Re: GarbageCalendar (new version) lua scripts

Posted: Wednesday 12 May 2021 20:36
by Pantagruel
Hi Jos,

Thanks for the update and getting 'Meerlanden' to work again.

Sometimes you just want to smack yourself in the face because of the simplicity of the solution, arghhhh :o :o :o :o .

Late to the game of updating because of other stuff, but downloaded the latest and greatest, thanks to the rename an easy unzip, cp to the target and a service restart to get things back to normal again... erhmm NOT.

Yes, the lua script worked but refused to update the data present in the file:

Code: Select all

/var/tmp/garbagecalendar_m_ximmio.data
2021-05-12 19:55:00.508 Status: LUA: ==> skipping because active="skip" for GarbageType:green GarbageDate:2021-2-23
2021-05-12 19:55:00.508 Status: LUA: @GarbageCal(m_ximmio): - End -----------------
mm no 'active = "skip"' was added as option

Code: Select all

2021-05-12 19:55:00.508 Status: LUA: @GarbageCal(m_ximmio): ==> found schedule: Rest Afval bak: vri 5 feb ; GFT bak: din 9 feb ; Rest Afval bak: vri 19 feb
2021-05-12 19:55:00.508 Status: LUA: @GarbageCal(m_ximmio): No updated text for TxtDevice.
Darn no update

After elaborate soul searching, config pruning/checking (did the f^&-ers chance the hostname perhaps?), the answer was simple.

mv garbagecalendar_m_ximmio.data garbagecalendar_m_ximmio.data_old

Code: Select all

2021-05-12 19:55:00.509 Status: LUA: @GarbageCal(m_ximmio): #### 19:55:00 End garbagecalendar script v20200415-1630
2021-05-12 19:55:00.517 Status: EventSystem: Script event triggered: /home/pi/domoticz/scripts/lua/script_time_garbagecalendar.lua
2021-05-12 19:56:00.510 Status: LUA: @GarbageCal(m_ximmio): #### Wed May 12 19:56:00 2021 ### Start garbagecalendar script v20200415-1630
2021-05-12 19:56:00.510 Status: LUA: @GarbageCal(m_ximmio): #### Debuging with extra messages because "mydebug=true" in garbagecalendarconfig.lua
2021-05-12 19:56:00.510 Status: LUA: @GarbageCal(m_ximmio): #### please change it back to "mydebug=false" when done testing to avoid growing a big domoticz log.
2021-05-12 19:56:00.510 Status: LUA: @GarbageCal(m_ximmio): domoticzjsonpath: /home/pi/domoticz/scripts/lua/
2021-05-12 19:56:00.511 Status: LUA: @GarbageCal(m_ximmio): datafilepath: /var/tmp/
2021-05-12 19:56:00.511 Status: LUA: @GarbageCal(m_ximmio): scriptpath: /home/pi/domoticz/scripts/lua/
2021-05-12 19:56:00.511 Status: LUA: @GarbageCal(m_ximmio): Loaded /home/pi/domoticz/scripts/lua/garbagecalendar/garbagecalendarconfig.lua.
2021-05-12 19:56:00.514 Status: LUA: @GarbageCal(m_ximmio): Loaded /home/pi/domoticz/scripts/lua/garbagecalendar/generalfuncs.lua.
2021-05-12 19:56:00.514 Status: LUA: @GarbageCal(m_ximmio): Start checking garbagetype_cfg table:
2021-05-12 19:56:00.514 Status: LUA: @GarbageCal(m_ximmio): -> NotificationTime:19:22 Garbagetype:green
2021-05-12 19:56:00.514 Status: LUA: @GarbageCal(m_ximmio): -> NotificationTime:19:22 Garbagetype:papier
2021-05-12 19:56:00.514 Status: LUA: @GarbageCal(m_ximmio): -> NotificationTime:2:31 Garbagetype:dummy1
2021-05-12 19:56:00.515 Status: LUA: @GarbageCal(m_ximmio): -> NotificationTime:19:22 Garbagetype:grey
2021-05-12 19:56:00.515 Status: LUA: @GarbageCal(m_ximmio): -> NotificationTime:19:22 Garbagetype:tree
2021-05-12 19:56:00.515 Status: LUA: @GarbageCal(m_ximmio): -> NotificationTime:2:30 Garbagetype:reloaddata
2021-05-12 19:56:00.515 Status: LUA: @GarbageCal(m_ximmio): -> NotificationTime:19:22 Garbagetype:branches
2021-05-12 19:56:00.515 Status: LUA: @GarbageCal(m_ximmio): Start update for text device:
2021-05-12 19:56:00.515 Status: LUA: !!! table.load error:cannot open /var/tmp/garbagecalendar_m_ximmio.data: No such file or directory
2021-05-12 19:56:00.515 Status: LUA: !!! unable to read Data from /var/tmp/garbagecalendar_m_ximmio.data
2021-05-12 19:56:00.515 Status: LUA: @GarbageCal(m_ximmio): ### Warning: Datafile not found:/var/tmp/garbagecalendar_m_ximmio.data . Start webupdate now
and Presto!, new precious dates for our waste retrieval are retrieved, written to the file and are present on our panel.

No silly excuses for the kids to ignore the pick-up roster!

So memo to self: get the latest version and mv the /var/temp/garbagecalendar_X.data file to force new data to be present.

Re: GarbageCalendar (new version) lua scripts

Posted: Sunday 16 May 2021 15:17
by sammyke007
Hi Jos

I have to debug / testload the script once in a month to get new data. Otherwise it won't update.
I receiver the following error in garbagecalendar_web_m_recycleapp-be.log:

Code: Select all

02:30:00 _runmodule: #1 scriptpath /home/pi/domoticz/scripts/lua/garbagecalendar/
02:30:00 _runmodule: --> Start -- foreground _runmodule.lua (v20210330-1836) for garbage module m_recycleapp-be
02:30:00 _runmodule: !! Module m_recycleapp-be had hard error. check log:/var/tmp/garbagecalendar_web_m_recycleapp-be.log
cannot open /home/pi/domoticz/scripts/lua/garbagecalendar/garbagecalendar/m_recycleapp-be.lua: No such file or directory
stack traceback:
	.../domoticz/scripts/lua/garbagecalendar/_runmodule.lua:10: in function <.../domoticz/scripts/lua/garbagecalendar/_runmodule.lua:9>
	[C]: in function 'dofile'
	.../domoticz/scripts/lua/garbagecalendar/_runmodule.lua:78: in function <.../domoticz/scripts/lua/garbagecalendar/_runmodule.lua:29>
	[C]: in function 'xpcall'
	.../domoticz/scripts/lua/garbagecalendar/_runmodule.lua:96: in main chunk
	[C]: ?
02:30:00 _runmodule: /var/tmp/garbagecalendar_web_m_recycleapp-be.log
02:30:00 _runmodule: 
%%%%% LUA Hardcrash log %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02:30:00 _runmodule: nil
02:30:00 _runmodule: stack traceback:
	.../domoticz/scripts/lua/garbagecalendar/_runmodule.lua:105: in main chunk
	[C]: ?
02:30:00 _runmodule: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02:30:00 _runmodule: --< End module m_recycleapp-be.lua (v??)
"cannot open /home/pi/domoticz/scripts/lua/garbagecalendar/garbagecalendar/m_recycleapp-be.lua" is indeed true as the garbagecalendar folder is named twice in the error?

Setting debug and testload to true, updates the data file however... If I do this, I have a new data file that's valid for one more month each time...

My latest debug + testload was on 26/04 and gave the following data:

Code: Select all

return {
-- Table: {1}
{
   {2},
   {3},
   {4},
   {5},
   {6},
   {7},
   {8},
   {9},
   ["Garbage_LastUpdate"]="Mon Apr 26 10:08:03 2021",
},
-- Table: {2}
{
   ["garbagedate"]="2021-4-30",
   ["garbagetype"]="PMD",
},
-- Table: {3}
{
   ["garbagedate"]="2021-4-30",
   ["garbagetype"]="Gft",
},
-- Table: {4}
{
   ["garbagedate"]="2021-5-7",
   ["garbagetype"]="Restafval",
},
-- Table: {5}
{
   ["garbagedate"]="2021-5-7",
   ["garbagetype"]="Glas",
},
-- Table: {6}
{
   ["garbagedate"]="2021-5-14",
   ["garbagetype"]="PMD",
},
-- Table: {7}
{
   ["garbagedate"]="2021-5-14",
   ["garbagetype"]="Gft",
},
-- Table: {8}
{
   ["garbagedate"]="2021-5-19",
   ["garbagetype"]="Papier-karton",
},
-- Table: {9}
{
   ["garbagedate"]="2021-5-21",
   ["garbagetype"]="Restafval",
},
}
I have to debug + testload again to make it get new data.
Debug true and testload false gives:

Code: Select all

2021-05-16 15:28:00.504 Status: LUA: 15:28:00 MainScript: ### Start garbagecalendar script v20210516-1114 Sun May 16 15:28:00 2021
2021-05-16 15:28:00.504 Status: LUA: 15:28:00 MainScript: ---> Debuging with extra messages because "mydebug=true" in garbagecalendarconfig.lua
2021-05-16 15:28:00.504 Status: LUA: 15:28:00 MainScript: ---> please change it back to "mydebug=false" when done testing to avoid growing a big domoticz log.
2021-05-16 15:28:00.504 Status: LUA: 15:28:00 MainScript: domoticzjsonpath: /home/pi/domoticz/scripts/lua/
2021-05-16 15:28:00.504 Status: LUA: 15:28:00 MainScript: datafilepath: /var/tmp/
2021-05-16 15:28:00.504 Status: LUA: 15:28:00 MainScript: scriptpath: /home/pi/domoticz/scripts/lua/
2021-05-16 15:28:00.504 Status: LUA: 15:28:00 MainScript: Loaded /home/pi/domoticz/scripts/lua/garbagecalendar/garbagecalendarconfig.lua.
2021-05-16 15:28:00.507 Status: LUA: 15:28:00 MainScript: Loaded /home/pi/domoticz/scripts/lua/garbagecalendar/generalfuncs.lua (v20210516-1114)
2021-05-16 15:28:00.507 Status: LUA: 15:28:00 MainScript: => Start checking garbagetype_cfg table whether an action is needed:
2021-05-16 15:28:00.507 Status: LUA: 15:28:00 MainScript: > NotificationTime=19:02 Garbagetype=papier-karton
2021-05-16 15:28:00.507 Status: LUA: 15:28:00 MainScript: > NotificationTime=19:02 Garbagetype=glas
2021-05-16 15:28:00.507 Status: LUA: 15:28:00 MainScript: > NotificationTime=19:02 Garbagetype=snoeiafval
2021-05-16 15:28:00.507 Status: LUA: 15:28:00 MainScript: > NotificationTime=19:02 Garbagetype=restafval
2021-05-16 15:28:00.508 Status: LUA: 15:28:00 MainScript: > NotificationTime=19:22 Garbagetype=gft
2021-05-16 15:28:00.508 Status: LUA: 15:28:00 MainScript: > NotificationTime=19:22 Garbagetype=pmd
2021-05-16 15:28:00.508 Status: LUA: 15:28:00 MainScript: > NotificationTime=02:30 Garbagetype=reloaddata
2021-05-16 15:28:00.508 Status: LUA: 15:28:00 MainScript: > NotificationTime=02:31 Garbagetype=dummy1
2021-05-16 15:28:00.508 Status: LUA: 15:28:00 MainScript: > NotificationTime=19:02 Garbagetype=p-k
2021-05-16 15:28:00.508 Status: LUA: 15:28:00 MainScript: #> Perform update because mydebug=true.
2021-05-16 15:28:00.508 Status: LUA: 15:28:00 MainScript: => Action starting, First check access to required files:
2021-05-16 15:28:00.508 Status: LUA: 15:28:00 MainScript: Run command:
2021-05-16 15:28:00.508 ls -l /var/tmp/garbagecal*m_recycleapp-be*:
2021-05-16 15:28:00.541 Status: LUA: -rwxrwxrwx 1 root root 784 apr 26 10:08 /var/tmp/garbagecalendar_m_recycleapp-be.data
2021-05-16 15:28:00.541 -rwxrwxrwx 1 root root 1646 mei 16 15:28 /var/tmp/garbagecalendar_run_m_recycleapp-be.log
2021-05-16 15:28:00.541 -rwxrwxrwx 1 root root 2235 mei 16 02:31 /var/tmp/garbagecalendar_run_update_m_recycleapp-be.log
2021-05-16 15:28:00.541 -rwxrwxrwx 1 root root 1361 mei 16 02:30 /var/tmp/garbagecalendar_web_m_recycleapp-be.log
2021-05-16 15:28:00.542 Status: LUA: 15:28:00 MainScript: Access OK: /var/tmp/garbagecalendar_m_recycleapp-be.data
2021-05-16 15:28:00.542 Status: LUA: 15:28:00 MainScript: Access OK: /var/tmp/garbagecalendar_run_m_recycleapp-be.log
2021-05-16 15:28:00.542 Status: LUA: 15:28:00 MainScript: Access OK: /var/tmp/garbagecalendar_web_m_recycleapp-be.log
2021-05-16 15:28:00.542 Status: LUA: 15:28:00 MainScript: => Start update for text device:
2021-05-16 15:28:00.543 Status: LUA: 15:28:00 MainScript: 8 data records loaded, updated at Mon Apr 26 10:08:03 2021 from datafile:/var/tmp/garbagecalendar_m_recycleapp-be.data
2021-05-16 15:28:00.543 Status: LUA: 15:28:00 MainScript: -> Start looping through data to find the first 3 events to show:
2021-05-16 15:28:00.545 Status: LUA: ==> GarbageDate:2021-5-19 GarbageType:papier-karton; Notify: Active=on Time=19:2 DaysBefore=1 reminder=0 Calc Days Diff=3
2021-05-16 15:28:00.545 Status: LUA: ==> GarbageDate:2021-5-21 GarbageType:restafval; Notify: Active=on Time=19:2 DaysBefore=1 reminder=0 Calc Days Diff=5
2021-05-16 15:28:00.545 Status: LUA: 15:28:00 MainScript: -< End data loop
2021-05-16 15:28:00.545 Status: LUA: 15:28:00 MainScript: ==> found schedule:Papier-karton: woe 19 mei ; Restafval: vri 21 mei ;
2021-05-16 15:28:00.546 Status: LUA: 15:28:00 MainScript: No updated text for TxtDevice.
2021-05-16 15:28:00.546 Status: LUA: 15:28:00 MainScript: ==< End garbagecalendar script v20210516-1114
2021-05-16 15:28:00.560 Status: EventSystem: Script event triggered: /home/pi/domoticz/scripts/lua/script_time_garbagecalendar.lua

Re: GarbageCalendar (new version) lua scripts

Posted: Sunday 16 May 2021 16:34
by jvdz
You are the third person reporting this issue, but I haven't received enough information till now to find the root cause of this issue and can't replicate it in my setup till now. It seems to fail only when running at night in the background.
For some reason it thinks it is running in the foreground and due to that uses the wrong base directory:
02:30:00 _runmodule: --> Start -- foreground _runmodule.lua (v20210330-1836) for garbage module m_recycleapp-be
There is a newer version available on GitHub that does some extra checks and creates a extra run log file copy of the run that starts the background process that fails to hopefully clarify why things are going wrong. Both previous reporters have yet to respond with the logfiles so I am still in the dark, but believe this latest version does solve it.
I would appreciate when you give the current MASTER version a try and send me the total set of 4 logfiles after a normal nighty batch run, so I can hopefully see what the issue is. Just zip them and send them to my email address please.

Jos

Re: GarbageCalendar (new version) lua scripts

Posted: Sunday 16 May 2021 17:36
by jvdz
I just a look again and think I did find an issue with the check whether LUA is installed or not, so have update that to another way of checking that and updated the GITHUB again.
Please use/try that version (20210516-1732).
Thanks,
Jos

Re: GarbageCalendar (new version) lua scripts

Posted: Sunday 16 May 2021 17:42
by sammyke007
jvdz wrote: Sunday 16 May 2021 17:36 I just a look again and think I did find an issue with the check whether LUA is installed or not, so have update that to another way of checking that and updated the GITHUB again.
Please sue/try that version (20210516-1732).
Thanks,
Jos
Changing the hour to 15h30 instead of 2h31 worked indeed for reloaddata. Very strange! I will pull the latest version in a moment, and I'll report back later!

Re: GarbageCalendar (new version) lua scripts

Posted: Monday 24 May 2021 12:09
by sammyke007
sammyke007 wrote: Sunday 16 May 2021 17:42
jvdz wrote: Sunday 16 May 2021 17:36 I just a look again and think I did find an issue with the check whether LUA is installed or not, so have update that to another way of checking that and updated the GITHUB again.
Please sue/try that version (20210516-1732).
Thanks,
Jos
Changing the hour to 15h30 instead of 2h31 worked indeed for reloaddata. Very strange! I will pull the latest version in a moment, and I'll report back later!
Jos, it seems to keep working now. Updating @ 2u31. Will keep track of it and report in case of failure. tnx!

Re: GarbageCalendar (new version) lua scripts

Posted: Monday 24 May 2021 15:37
by woempiej
Nice work Jos,thank you for your effort and "standbyness"

Since textdevice icons can be modified, I thought someone maybe likes this icon;

Re: GarbageCalendar (new version) lua scripts

Posted: Monday 24 May 2021 20:03
by AllesVanZelf
woempiej wrote: Monday 24 May 2021 15:37 Since textdevice icons can be modified, I thought someone maybe likes this icon;
Nice! Thanks woempiej.

Re: GarbageCalendar (new version) lua scripts

Posted: Wednesday 26 May 2021 9:43
by mikeoo
Update: Fixt with updating the new script_time_garbagecalendar.lua file :D

Again missing GFT item while it is active in the calendar so need your help again. It shows Papier en Karton and Restaval fine but GFT is missing that is collected today. :)

Nothing changed on my side as far as i know.

https://www.stadswerk072.nl/wanneer
Postcode: 1486 MK nr:"55

garbagecalendar_run_m_opzet_api.log

Code: Select all

09:35:00 MainScript: ### Start garbagecalendar script v20210330-1836   Wed May 26 09:35:00 2021
09:35:00 MainScript: ---> Debuging with extra messages because "mydebug=true" in garbagecalendarconfig.lua
09:35:00 MainScript: --->    please change it back to "mydebug=false" when done testing to avoid growing a big domoticz log.
09:35:00 MainScript: domoticzjsonpath: /home/pi/domoticz/scripts/lua/
09:35:00 MainScript: datafilepath: /var/tmp/
09:35:00 MainScript: scriptpath: /home/pi/domoticz/scripts/lua/
09:35:00 MainScript: Loaded /home/pi/domoticz/scripts/lua/garbagecalendar/garbagecalendarconfig.lua.
09:35:00 MainScript: Loaded /home/pi/domoticz/scripts/lua/garbagecalendar/generalfuncs.lua (v20210330-1836)
09:35:00 MainScript: => Start checking garbagetype_cfg table whether an action is needed:
09:35:00 MainScript: >   NotificationTime=09:31  Garbagetype=gft
09:35:00 MainScript: >   NotificationTime=09:31  Garbagetype=dummy1
09:35:00 MainScript: >   NotificationTime=09:31  Garbagetype=papier
09:35:00 MainScript: >   NotificationTime=09:31  Garbagetype=reloaddata
09:35:00 MainScript: >   NotificationTime=09:31  Garbagetype=pmd
09:35:00 MainScript: #> Perform update because mydebug=true.
09:35:00 MainScript: => Action starting, First check access to required files:
09:35:00 MainScript:    Run command:
ls -l /var/tmp/garbagecal*m_opzet_api*:
-rw-r----- 1 root root 4101 May 12 07:07 /var/tmp/garbagecalendar_m_opzet_api.data
-rw-r----- 1 root root 1361 May 26 09:35 /var/tmp/garbagecalendar_run_m_opzet_api.log
-rw-r----- 1 root root 6403 Apr 27 17:15 /var/tmp/garbagecalendar_run_m_opzet_api.log.save
-rw-r----- 1 root root 3532 May 26 09:34 /var/tmp/garbagecalendar_run_update_m_opzet_api.log
-rw-r----- 1 root root 1337 May 26 09:31 /var/tmp/garbagecalendar_web_m_opzet_api.log
09:35:00 MainScript: Access OK: /var/tmp/garbagecalendar_m_opzet_api.data
09:35:00 MainScript: Access OK: /var/tmp/garbagecalendar_run_m_opzet_api.log
09:35:00 MainScript: Access OK: /var/tmp/garbagecalendar_web_m_opzet_api.log
09:35:00 MainScript: => Start update for text device:
09:35:00 MainScript:    22 data records loaded, updated at Wed May 12 07:07:01 2021 from datafile:/var/tmp/garbagecalendar_m_opzet_api.data
09:35:00 MainScript: -> Start looping through data to find the first 3 events to show:
==> GarbageDate:2021-6-4 GarbageType:papier en karton; Calc Days Diff=9; *** Notify skipped because there is no record in garbagetype_cfg[]!
==> GarbageDate:2021-6-8 GarbageType:restafval; Calc Days Diff=13; *** Notify skipped because there is no record in garbagetype_cfg[]!
09:35:00 MainScript: -< End data loop
09:35:00 MainScript: #!# Warning: These records are missing in your garbagecalendarconfig.lua file, so no notifications will be send!
09:35:00 MainScript: #!# -- start -- Add these records into the garbagetype_cfg table and adapt the schedule and text info to your needs :
   ["gft & etensresten"]                ={hour=19,min=02,daysbefore=1,reminder=0,text="gft & etensresten"},
   ["plastic, blik & drinkpakken"]      ={hour=19,min=02,daysbefore=1,reminder=0,text="plastic, blik & drinkpakken"},
   ["papier en karton"]                 ={hour=19,min=02,daysbefore=1,reminder=0,text="papier en karton"},
   ["restafval"]                        ={hour=19,min=02,daysbefore=1,reminder=0,text="restafval"},

09:35:00 MainScript: #!# -- end ----------------------------
09:35:00 MainScript: ==> found schedule:papier en karton: 4-6-21 ; restafval: 8-6-21 ;
09:35:00 MainScript: No updated text for TxtDevice.
09:35:00 MainScript: ==< End garbagecalendar script v20210330-1836
garbagecalendar_run_update_m_opzet_api.log

Code: Select all

09:36:00 MainScript: ### Start garbagecalendar script v20210330-1836   Wed May 26 09:36:00 2021
09:36:00 MainScript: ---> Debuging with extra messages because "mydebug=true" in garbagecalendarconfig.lua
09:36:00 MainScript: --->    please change it back to "mydebug=false" when done testing to avoid growing a big domoticz log.
09:36:00 MainScript: domoticzjsonpath: /home/pi/domoticz/scripts/lua/
09:36:00 MainScript: datafilepath: /var/tmp/
09:36:00 MainScript: scriptpath: /home/pi/domoticz/scripts/lua/
09:36:00 MainScript: Loaded /home/pi/domoticz/scripts/lua/garbagecalendar/garbagecalendarconfig.lua.
09:36:00 MainScript: Loaded /home/pi/domoticz/scripts/lua/garbagecalendar/generalfuncs.lua (v20210330-1836)
09:36:00 MainScript: => Start checking garbagetype_cfg table whether an action is needed:
09:36:00 MainScript: >   NotificationTime=09:31  Garbagetype=reloaddata
09:36:00 MainScript: >   NotificationTime=09:31  Garbagetype=dummy1
09:36:00 MainScript: >   NotificationTime=09:31  Garbagetype=pmd
09:36:00 MainScript: >   NotificationTime=09:31  Garbagetype=gft
09:36:00 MainScript: >   NotificationTime=09:31  Garbagetype=papier
09:36:00 MainScript: #> Perform update because mydebug=true.
09:36:00 MainScript: => Action starting, First check access to required files:
09:36:00 MainScript:    Run command:
ls -l /var/tmp/garbagecal*m_opzet_api*:
-rw-r----- 1 root root 4101 May 12 07:07 /var/tmp/garbagecalendar_m_opzet_api.data
-rw-r----- 1 root root 1361 May 26 09:36 /var/tmp/garbagecalendar_run_m_opzet_api.log
-rw-r----- 1 root root 6403 Apr 27 17:15 /var/tmp/garbagecalendar_run_m_opzet_api.log.save
-rw-r----- 1 root root 3532 May 26 09:35 /var/tmp/garbagecalendar_run_update_m_opzet_api.log
-rw-r----- 1 root root 1337 May 26 09:31 /var/tmp/garbagecalendar_web_m_opzet_api.log
09:36:00 MainScript: Access OK: /var/tmp/garbagecalendar_m_opzet_api.data
09:36:00 MainScript: Access OK: /var/tmp/garbagecalendar_run_m_opzet_api.log
09:36:00 MainScript: Access OK: /var/tmp/garbagecalendar_web_m_opzet_api.log
09:36:00 MainScript: => Start update for text device:
09:36:00 MainScript:    22 data records loaded, updated at Wed May 12 07:07:01 2021 from datafile:/var/tmp/garbagecalendar_m_opzet_api.data
09:36:00 MainScript: -> Start looping through data to find the first 3 events to show:
==> GarbageDate:2021-6-4 GarbageType:papier en karton; Calc Days Diff=9; *** Notify skipped because there is no record in garbagetype_cfg[]!
==> GarbageDate:2021-6-8 GarbageType:restafval; Calc Days Diff=13; *** Notify skipped because there is no record in garbagetype_cfg[]!
09:36:00 MainScript: -< End data loop
09:36:00 MainScript: #!# Warning: These records are missing in your garbagecalendarconfig.lua file, so no notifications will be send!
09:36:00 MainScript: #!# -- start -- Add these records into the garbagetype_cfg table and adapt the schedule and text info to your needs :
   ["gft & etensresten"]                ={hour=19,min=02,daysbefore=1,reminder=0,text="gft & etensresten"},
   ["plastic, blik & drinkpakken"]      ={hour=19,min=02,daysbefore=1,reminder=0,text="plastic, blik & drinkpakken"},
   ["papier en karton"]                 ={hour=19,min=02,daysbefore=1,reminder=0,text="papier en karton"},
   ["restafval"]                        ={hour=19,min=02,daysbefore=1,reminder=0,text="restafval"},

09:36:00 MainScript: #!# -- end ----------------------------
09:36:00 MainScript: ==> found schedule:papier en karton: 4-6-21 ; restafval: 8-6-21 ;
09:36:00 MainScript: No updated text for TxtDevice.
garbagecalendar_web_m_opzet_api.log

Code: Select all

09:31:00 _runmodule: #1 scriptpath /home/pi/domoticz/scripts/lua/garbagecalendar/
09:31:00 _runmodule: --> Start -- foreground _runmodule.lua (v20210330-1836) for garbage module m_opzet_api
09:31:00 _runmodule: !! Module m_opzet_api had hard error. check log:/var/tmp/garbagecalendar_web_m_opzet_api.log
cannot open /home/pi/domoticz/scripts/lua/garbagecalendar/garbagecalendar/m_opzet_api.lua: No such file or directory
stack traceback:
        .../domoticz/scripts/lua/garbagecalendar/_runmodule.lua:10: in function <.../domoticz/scripts/lua/garbagecalendar/_runmodule.lua:9>
        [C]: in function 'dofile'
        .../domoticz/scripts/lua/garbagecalendar/_runmodule.lua:78: in function <.../domoticz/scripts/lua/garbagecalendar/_runmodule.lua:29>
        [C]: in function 'xpcall'
        .../domoticz/scripts/lua/garbagecalendar/_runmodule.lua:96: in main chunk
        [C]: ?
09:31:00 _runmodule: /var/tmp/garbagecalendar_web_m_opzet_api.log
09:31:00 _runmodule:
%%%%% LUA Hardcrash log %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09:31:00 _runmodule: nil
09:31:00 _runmodule: stack traceback:
        .../domoticz/scripts/lua/garbagecalendar/_runmodule.lua:105: in main chunk
        [C]: ?
09:31:00 _runmodule: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
09:31:00 _runmodule: --< End module m_opzet_api.lua (v??)

Re: GarbageCalendar (new version) lua scripts

Posted: Sunday 15 August 2021 21:50
by arnaudarduino
Now is the script not working.
For 4 weeks ago it did work

21:45:00 MainScript: ### Start garbagecalendar script v20210330-1836 Sun Aug 15 21:45:00 2021
21:45:00 MainScript: ---> Debuging with extra messages because "mydebug=true" in garbagecalendarconfig.lua
21:45:00 MainScript: ---> please change it back to "mydebug=false" when done testing to avoid growing a big domoticz log.
21:45:00 MainScript: domoticzjsonpath: /home/pi/domoticz/scripts/lua/
21:45:00 MainScript: datafilepath: /var/tmp/
21:45:00 MainScript: scriptpath: /home/pi/domoticz/scripts/lua/
21:45:00 MainScript: Loaded /home/pi/domoticz/scripts/lua/garbagecalendar/garbagecalendarconfig.lua.
21:45:00 MainScript: Loaded /home/pi/domoticz/scripts/lua/garbagecalendar/generalfuncs.lua (v20210330-1836)
21:45:00 MainScript: => Start checking garbagetype_cfg table whether an action is needed:
21:45:00 MainScript: > NotificationTime=16:30 Garbagetype=plastic, blik & drinkpakken
21:45:00 MainScript: > NotificationTime=15:31 Garbagetype=dummy1
21:45:00 MainScript: > NotificationTime=16:30 Garbagetype=papier en karton
21:45:00 MainScript: > NotificationTime=16:30 Garbagetype=gft & etensresten
21:45:00 MainScript: > NotificationTime=15:30 Garbagetype=reloaddata
21:45:00 MainScript: #> Perform update because mydebug=true.
21:45:00 MainScript: => Action starting, First check access to required files:
21:45:00 MainScript: Run command:
ls -l /var/tmp/garbagecal*m_opzet_api*:
-rw-r----- 1 root root 133472 jul 30 16:53 /var/tmp/garbagecalendar_m_opzet_api.data
-rw-r----- 1 root root 1409 aug 15 21:45 /var/tmp/garbagecalendar_run_m_opzet_api.log
-rw-r----- 1 root root 1881 aug 15 21:06 /var/tmp/garbagecalendar_run_update_m_opzet_api.log
-rw-r----- 1 root root 1337 aug 15 02:30 /var/tmp/garbagecalendar_web_m_opzet_api.log
21:45:00 MainScript: Access OK: /var/tmp/garbagecalendar_m_opzet_api.data
21:45:00 MainScript: Access OK: /var/tmp/garbagecalendar_run_m_opzet_api.log
21:45:00 MainScript: Access OK: /var/tmp/garbagecalendar_web_m_opzet_api.log
21:45:00 MainScript: => Start update for text device:
21:45:00 MainScript: 24 data records loaded, updated at Fri Jul 30 16:53:01 2021 from datafile:/var/tmp/garbagecalendar_m_opzet_api.data
21:45:00 MainScript: -> Start looping through data to find the first 3 events to show:
==> GarbageDate:2021-8-18 GarbageType:papier en karton; Notify: Active=on Time=16:30 DaysBefore=2 reminder=0 Calc Days Diff=3
21:45:00 MainScript: -< End data loop
21:45:00 MainScript: ==> found schedule:Papier: woe 18 aug ;
21:45:00 MainScript: ### Error: Couldn't get the current data from Domoticz text device Container
21:45:00 MainScript: ==< End garbagecalendar script v20210330-1836

Re: GarbageCalendar (new version) lua scripts

Posted: Sunday 15 August 2021 23:12
by jvdz
18 aug ;
21:45:00 MainScript: ### Error: Couldn't get the current data from Domoticz text device Container
this means the script can't connect to the domoticz device. Did anything change with the setup?

Jos

Re: GarbageCalendar (new version) lua scripts

Posted: Wednesday 25 August 2021 16:15
by jbdomo
Anybody already made a websitemodule for 'afvalkalender.alphenaandenrijn.nl' ?

Re: GarbageCalendar (new version) lua scripts

Posted: Wednesday 25 August 2021 16:37
by jvdz
jbdomo wrote: Wednesday 25 August 2021 16:15 Anybody already made a websitemodule for 'afvalkalender.alphenaandenrijn.nl' ?
Module m_opzet_api is working for me with this config:

Code: Select all

websitemodule="m_opzet_api"
Hostname="afvalkalender.alphenaandenrijn.nl"
Zipcode="2404??"
Housenr="??"
Housenrsuf= ""
Street=""
Jos :)

Re: GarbageCalendar (new version) lua scripts

Posted: Thursday 26 August 2021 20:05
by jvdz
The module "m_mijnafvalwijzer_api" is working again thanks to @gizmocuz his latest pull-request on Github. Thanks!

Jos

Re: GarbageCalendar (new version) lua scripts

Posted: Friday 27 August 2021 11:13
by jbdomo
jvdz wrote: Wednesday 25 August 2021 16:37
jbdomo wrote: Wednesday 25 August 2021 16:15 Anybody already made a websitemodule for 'afvalkalender.alphenaandenrijn.nl' ?
Module m_opzet_api is working for me with this config:

Code: Select all

websitemodule="m_opzet_api"
Hostname="afvalkalender.alphenaandenrijn.nl"
Zipcode="2404??"
Housenr="??"
Housenrsuf= ""
Street=""
Jos :)
Thx Jos, that did the trick!

Re: GarbageCalendar (new version) lua scripts

Posted: Thursday 07 October 2021 21:47
by Rolandet
He all

I haven't gotten any updates from my garbage collector (omrin) since Sept 28th. Is there any way to trigger the script manual?

Re: GarbageCalendar (new version) lua scripts

Posted: Thursday 07 October 2021 22:03
by jvdz
Just look at the logfiles to see what is going wrong as described in the github wiki. :)
Send me the details/logfiles in case you want me to test or have a look what is going wrong. (use my github email address)

Jos

Re: GarbageCalendar (new version) lua scripts

Posted: Tuesday 12 October 2021 10:00
by smaus
Does somebody have te garbagecalendar by jvanderzande running in a synology docker?