GarbageCalendar (new version) lua scripts

Moderator: leecollings

User avatar
jvdz
Posts: 2189
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post 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
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
mikeoo
Posts: 110
Joined: Sunday 22 March 2015 7:35
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Holland
Contact:

Re: GarbageCalendar (new version) lua scripts

Post 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
Pantagruel
Posts: 7
Joined: Wednesday 24 April 2019 20:15
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10659
Location: Nieuw Vennep
Contact:

Re: GarbageCalendar (new version) lua scripts

Post 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.
sammyke007
Posts: 204
Joined: Monday 08 May 2017 20:48
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: Belgium
Contact:

Re: GarbageCalendar (new version) lua scripts

Post 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
User avatar
jvdz
Posts: 2189
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post 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
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
User avatar
jvdz
Posts: 2189
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post 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
Last edited by jvdz on Monday 24 May 2021 16:14, edited 1 time in total.
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
sammyke007
Posts: 204
Joined: Monday 08 May 2017 20:48
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: Belgium
Contact:

Re: GarbageCalendar (new version) lua scripts

Post 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!
sammyke007
Posts: 204
Joined: Monday 08 May 2017 20:48
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: Belgium
Contact:

Re: GarbageCalendar (new version) lua scripts

Post 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!
woempiej
Posts: 9
Joined: Saturday 19 October 2019 18:47
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post 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;
Attachments
Afval.zip
(11.41 KiB) Downloaded 67 times
AllesVanZelf
Posts: 265
Joined: Monday 05 February 2018 8:42
Target OS: Raspberry Pi / ODroid
Domoticz version: 12467
Location: Netherlands, near Haarlem
Contact:

Re: GarbageCalendar (new version) lua scripts

Post 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.
Domoticz 2020.1 (12230) on Raspberry Pi 3B with Raspian Buster. Besides Domoticz, Rpi is running Pi-Hole.
mikeoo
Posts: 110
Joined: Sunday 22 March 2015 7:35
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Holland
Contact:

Re: GarbageCalendar (new version) lua scripts

Post 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??)
arnaudarduino
Posts: 21
Joined: Wednesday 06 July 2016 22:31
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: GarbageCalendar (new version) lua scripts

Post 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
User avatar
jvdz
Posts: 2189
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post 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
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
jbdomo
Posts: 2
Joined: Friday 13 January 2017 14:40
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by jbdomo »

Anybody already made a websitemodule for 'afvalkalender.alphenaandenrijn.nl' ?
User avatar
jvdz
Posts: 2189
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post 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 :)
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
User avatar
jvdz
Posts: 2189
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by jvdz »

The module "m_mijnafvalwijzer_api" is working again thanks to @gizmocuz his latest pull-request on Github. Thanks!

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
jbdomo
Posts: 2
Joined: Friday 13 January 2017 14:40
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Contact:

Re: GarbageCalendar (new version) lua scripts

Post 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!
User avatar
Rolandet
Posts: 95
Joined: Thursday 31 January 2019 21:11
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: The Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post 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?
Custodes Septentrionum
User avatar
jvdz
Posts: 2189
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post 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
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
smaus
Posts: 84
Joined: Sunday 18 February 2018 9:32
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by smaus »

Does somebody have te garbagecalendar by jvanderzande running in a synology docker?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest