GarbageCalendar (new version) lua scripts
Moderator: leecollings
- Thuis
- Posts: 273
- Joined: Tuesday 11 September 2018 11:36
- Target OS: Linux
- Domoticz version: Beta
- Location: The Netherlands
- Contact:
Re: GarbageCalendar (new version) lua scripts
I am sorry, it was late for me.
I will try to explain.
- The old data file when it would not refresh anything had all the rights 777 and the user and group onshuis. I must have chaged it to 777 some how in the past to get it to work, i can not remember,
- Then i changed the data file to data.old (to see if a new data file would be created, and it did.)
- I put the debug to true and it generated the new garbagecalendar_m_goeree-overflakkee.data file. This file is 644 with same user and group onshuis.
- I will now let it sit on 644 to see if the data will refresh in a few days.
In the logs, when the data.old file was still the data file, i could not see that it would get new dates, as you has showd me in previous post:
==> found schedule:restafval: maa 6 apr ; groente-, fruit- en tuinafval: zat 11 apr ; papier en karton: zat 18 apr ;
After changing the data to data.old and when the new data file was created i could see the new dates in the log, as you showed me in the previous post.
Well i do not understand either why the rights would have to do anything with it, 777 should always work? As it has all the rights. So there for maybe something else is different.
So the only thing to do is wait for a few days to see if it generates the new date in the log and the data file i think ?
I will try to explain.
- The old data file when it would not refresh anything had all the rights 777 and the user and group onshuis. I must have chaged it to 777 some how in the past to get it to work, i can not remember,
- Then i changed the data file to data.old (to see if a new data file would be created, and it did.)
- I put the debug to true and it generated the new garbagecalendar_m_goeree-overflakkee.data file. This file is 644 with same user and group onshuis.
- I will now let it sit on 644 to see if the data will refresh in a few days.
In the logs, when the data.old file was still the data file, i could not see that it would get new dates, as you has showd me in previous post:
==> found schedule:restafval: maa 6 apr ; groente-, fruit- en tuinafval: zat 11 apr ; papier en karton: zat 18 apr ;
After changing the data to data.old and when the new data file was created i could see the new dates in the log, as you showed me in the previous post.
Well i do not understand either why the rights would have to do anything with it, 777 should always work? As it has all the rights. So there for maybe something else is different.
So the only thing to do is wait for a few days to see if it generates the new date in the log and the data file i think ?
I Love Domoticz ! And the community around it :-)
- jvdz
- Posts: 2330
- 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
I did understood you (I think)!
The reason I said "I don't understand" is that when a file has 777 rights, it would mean that everybody can do everything to the file, so that doesn't explain why the batch-script didn't update it!
Can you check the Domoticz logs to see if you have an extra log entry like the first line in the second codeblock, this at the time the batchupdate is scheduled with this entry in your config:
No need to wait for a few days as it should be updated each day at that time in the config!!
Jos
The reason I said "I don't understand" is that when a file has 777 rights, it would mean that everybody can do everything to the file, so that doesn't explain why the batch-script didn't update it!

Can you check the Domoticz logs to see if you have an extra log entry like the first line in the second codeblock, this at the time the batchupdate is scheduled with this entry in your config:
Code: Select all
-- Add any missing records above this line
["reloaddata"] ={hour=02,min=30,daysbefore=0,reminder=0,text="trigger for reloading data from website into a file"},
Code: Select all
2020-04-01 02:30:00.072 LUA: @GarbageCal(m_westland): lua /home/pi/domoticz/scripts/lua/garbagecalendar/m_westland.lua "/home/pi/domoticz/scripts/lua/" "1234xx" "99" "" "/var/tmp/garbagecalendar_m_westland.data" "/var/tmp/garbagecalendar_web_m_westland.log" "" ""
2020-04-01 02:30:00.074 LUA: @GarbageCal(m_westland): Start update for text device:
2020-04-01 02:30:00.080 LUA: @GarbageCal(m_westland): ==> found schedule:Groene bak: vri 3 apr ; Grijze bak: vri 10 apr ; Blauwe bak: din 28 apr ;
Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
- Thuis
- Posts: 273
- Joined: Tuesday 11 September 2018 11:36
- Target OS: Linux
- Domoticz version: Beta
- Location: The Netherlands
- Contact:
Re: GarbageCalendar (new version) lua scripts
I see this in the config file±
LUA: @GarbageCal(m_westland): lua /home/pi/domoticz/scripts/lua/garbagecalendar/m_westland.lua "/home/pi/domoticz/scripts/lua/" "1234xx" "99" "" "/var/tmp/garbagecalendar_m_westland.data" "/var/tmp/garbagecalendar_web_m_westland.log" "" ""
but with my own parameters, like goeree-overflakkee and so on, but i do not see it in the log. What am i doing wrong ?
Aha i see 5 hours ago you changed the table_funcs.lua file, so i misread, now i have downloaded the new file and will try again .... wait here it comes .
- Spoiler: show
- Spoiler: show
LUA: @GarbageCal(m_westland): lua /home/pi/domoticz/scripts/lua/garbagecalendar/m_westland.lua "/home/pi/domoticz/scripts/lua/" "1234xx" "99" "" "/var/tmp/garbagecalendar_m_westland.data" "/var/tmp/garbagecalendar_web_m_westland.log" "" ""
but with my own parameters, like goeree-overflakkee and so on, but i do not see it in the log. What am i doing wrong ?
Aha i see 5 hours ago you changed the table_funcs.lua file, so i misread, now i have downloaded the new file and will try again .... wait here it comes .
I Love Domoticz ! And the community around it :-)
- Thuis
- Posts: 273
- Joined: Tuesday 11 September 2018 11:36
- Target OS: Linux
- Domoticz version: Beta
- Location: The Netherlands
- Contact:
Re: GarbageCalendar (new version) lua scripts
It seems to be the same, i downloaded the new file table_funcs.lua into the correct directory and restarted domoticz, but i do not see anything like LUA: @GarbageCal(m_goeree-overflakkee): lua /home/onshuis/ enzovoorts.....
- Spoiler: show
I Love Domoticz ! And the community around it :-)
- jvdz
- Posts: 2330
- 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
I start to believe you have removed a record from the original provided garbagecalendarconfig_model.lua:
Jos
... which really needs to be there to schedule the WebUpdate in the background as described in the WiKi:garbagetype_cfg = {
-- Add any missing records below this line
["pmd"] ={hour=19,min=22,daysbefore=1,reminder=0,text="pmd"},
["gft"] ={hour=19,min=22,daysbefore=1,reminder=0,text="gft"},
["papier"] ={hour=19,min=22,daysbefore=1,reminder=0,text="papier"},
-- Add any missing records above this line
["reloaddata"] ={hour=02,min=30,daysbefore=0,reminder=0,text="trigger for reloading data from website into garbagecalendar.data"},
["dummy1"] ={hour=02,min=30,daysbefore=0,reminder=0,text="dummy to trigger testing"}}
Could you check that please?-- The "reloaddata" entry is required to run the background process to update the data one time per day.
-- The "dummy" entry can be used to force reading the data, update the Domoticz text device and see if there are any errors or missing garbage types.
Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
- Thuis
- Posts: 273
- Joined: Tuesday 11 September 2018 11:36
- Target OS: Linux
- Domoticz version: Beta
- Location: The Netherlands
- Contact:
Re: GarbageCalendar (new version) lua scripts
I downloaded the file with wget from github to the directory and it downloaded but i see it put a .1 behind it, so it is still the same. As of i am still the linux noob i need to correct it. I also do not understand why the new file is much bigger, so i must be doing something wrong. Also i am noob with github, days ago i thought i would do a git pull and it updated my whole domoticz to some version and now i get dzvents warnings about a math.pow that is depreciated in version 5.3 or something. But that is something else. I wil try to get the new table file function again and see if i can get it right this time, sorry for all the wasted time.
I Love Domoticz ! And the community around it :-)
- Thuis
- Posts: 273
- Joined: Tuesday 11 September 2018 11:36
- Target OS: Linux
- Domoticz version: Beta
- Location: The Netherlands
- Contact:
Re: GarbageCalendar (new version) lua scripts
Yes i know it is just me, now i was in the thinking thaty if i would delete just a file in the directory:
onshuis@ubuntu-huis:~/Domotica/domoticz/scripts/lua/garbagecalendar$
and would do a git pull, then it would download the missing file, but it does not, it just says that it is up to date,
So i do wget https://github.com/jvanderzande/Garbage ... _funcs.lua
and there it is. But it is mega big in comparison to the old file look:
112 -rw-rw-r-- 1 onshuis onshuis 112674 Apr 1 16:41 table_funcs.lua
4 -rwxrwxrwx 1 onshuis onshuis 3676 Feb 24 10:39 table_funcs.lua.old
i will try to edit the old file and put this in i guess ?
["reloaddata"] ={hour=02,min=30,daysbefore=0,reminder=0,text="trigger for reloading data from website into garbagecalendar.data"},
oh man i got it all fragged up now ......
onshuis@ubuntu-huis:~/Domotica/domoticz/scripts/lua/garbagecalendar$
and would do a git pull, then it would download the missing file, but it does not, it just says that it is up to date,
So i do wget https://github.com/jvanderzande/Garbage ... _funcs.lua
and there it is. But it is mega big in comparison to the old file look:
112 -rw-rw-r-- 1 onshuis onshuis 112674 Apr 1 16:41 table_funcs.lua
4 -rwxrwxrwx 1 onshuis onshuis 3676 Feb 24 10:39 table_funcs.lua.old
i will try to edit the old file and put this in i guess ?
["reloaddata"] ={hour=02,min=30,daysbefore=0,reminder=0,text="trigger for reloading data from website into garbagecalendar.data"},
oh man i got it all fragged up now ......
I Love Domoticz ! And the community around it :-)
- Thuis
- Posts: 273
- Joined: Tuesday 11 September 2018 11:36
- Target OS: Linux
- Domoticz version: Beta
- Location: The Netherlands
- Contact:
Re: GarbageCalendar (new version) lua scripts
t least now this is in the log ... :
2020-04-01 16:48:00.260 Status: LUA: @GarbageCal(m_goeree-overflakkee): -> NotificationTime:2:30 Garbagetype:reloaddata
2020-04-01 16:48:00.260 Status: LUA: @GarbageCal(m_goeree-overflakkee): -> NotificationTime:2:30 Garbagetype:reloaddata
I Love Domoticz ! And the community around it :-)
- jvdz
- Posts: 2330
- 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
That is indeed required when it isn't there!
Just look at the provided model config how it should look !
I will make another change to the mainscript to test for this as well to ensure you are informed whenever this record is missing.

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
- jvdz
- Posts: 2330
- 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
No idea what you have done here but that file is "145 lines (131 sloc) 3.73 KB" according Github, so I guess you downloaded some HTML file in stead a raw text file.Thuis wrote: ↑Wednesday 01 April 2020 16:43 So i do wget https://github.com/jvanderzande/Garbage ... _funcs.lua
and there it is. But it is mega big in comparison to the old file look:
112 -rw-rw-r-- 1 onshuis onshuis 112674 Apr 1 16:41 table_funcs.lua
4 -rwxrwxrwx 1 onshuis onshuis 3676 Feb 24 10:39 table_funcs.lua.old
Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
- Thuis
- Posts: 273
- Joined: Tuesday 11 September 2018 11:36
- Target OS: Linux
- Domoticz version: Beta
- Location: The Netherlands
- Contact:
Re: GarbageCalendar (new version) lua scripts
I just deleted the whole thing. And then did a git clone, setup the config lua and now it seems toe be okay again.
- Spoiler: show
I Love Domoticz ! And the community around it :-)
- jvdz
- Posts: 2330
- 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
Looking good now. I've also learned something as I could have simply seen the issue in the very first logfile you posted, but it is always harder to find an issue when something is missing! The latest mainscript will simply trigger an error each minute, which should be clear now.

You're welcome

New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
- jvdz
- Posts: 2330
- 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
For any other takers:woempiej wrote: ↑Monday 30 March 2020 19:26 I try to figure out how to read the data from source http://www.montferland.afvalwijzer.net/ with the eventsystem script_time.lua
Is there a way to copy the data in the script from afval westland?
I'm no professional in scripting sorry![]()
I've made a new module for "montferland" GarbageCalendar, currently being tested by @woepiej.
It will soon be available on GitHub, when all is working, but let me know in case others like to test it as well.
Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
- Hesitated
- Posts: 42
- Joined: Monday 04 June 2018 21:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V4.11665
- Location: Ede
- Contact:
Re: GarbageCalendar (new version) lua scripts
I've try to run the script
My garbagecalendarconfig.lua
See Attachments for full configuration and logfiles.
Am i doing something wrong?
Code: Select all
sudo lua script_time_garbagecalendar.lua
Code: Select all
myGarbageDevice = 'Container' -- The Text devicename in Domoticz
ShowNextEvents = 3 -- indicate the next x events to show in the TEXT Sensor in Domoticz
Zipcode = '6711KM' -- Your zipcode
Housenr = '71' -- Your housnr
Housenrsuf = '' -- Your housnr suffix (Optional: a/b/c etc)
Street='' -- Street name Only needed for: m_ophaalkalender-be
Hostname = '' -- Specify the hostname of your website. Only needed for: m_opzet ; m_opzet_api ;
-- OR Specify the companycode for the m_ximmio.lua module. See m_ximmio.lua on how to find this code.
-- choose one of these modules
websitemodule = "m_ximmio"
-- Switch on mydebug in case of issues and initially and check the domoticz log for any issues or missing
mydebug = true -- (true/false)
testdataload = true -- (true/false)
Am i doing something wrong?
- Attachments
-
- garbagecalendarconfig.lua.txt
- (8.57 KiB) Downloaded 78 times
-
- garbagecalendar_web_m_ximmio.log
- (1.3 KiB) Downloaded 49 times
-
- garbagecalendar_run_m_ximmio.log
- (4.65 KiB) Downloaded 40 times
Domoticz 2020.2 - RPi3B+ - RFXtrx433XL - P1 - CC2531 - Somfy - Xiaomi - Hue - Omron - MQTT
- jvdz
- Posts: 2330
- 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
ximmio is a bit of a special and guess you missed this comment for m_ximmio in the config:
I would be happy to change this when anybody has any idea how to obtain this in a more generic way by script! suggestions or pullrequests are always welcome.
All clear?
Jos
EDIT:I will update m_ximmio.au3 with a check and better error message in case the companycode isn't provided.
This refers to this comment in m_ximmio.au3:Hostname = '' -- Specify the hostname of your website. Only needed for: m_opzet ; m_opzet_api ;
-- OR Specify the companycode for the m_ximmio.lua module. See m_ximmio.lua on how to find this code.
-- API WebSite: https://wasteapi.2go-mobile.com/api
--
--- Find your companycode by:
-- 1. goto your webpage calendar and display the garbage calendar
-- 2. go into Developer mode for your browser
-- 3. find source file controller.js
-- 4. find this section and copy the value for companyCode:
-- $api('GetConfigOption', {
-- companyCode: '53d8db94-7945-42fd-9742-9bbc71dbe4c1',
-- configName: 'ALL'
-- })
I would be happy to change this when anybody has any idea how to obtain this in a more generic way by script! suggestions or pullrequests are always welcome.

All clear?
Jos
EDIT:I will update m_ximmio.au3 with a check and better error message in case the companycode isn't provided.
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
- Hesitated
- Posts: 42
- Joined: Monday 04 June 2018 21:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V4.11665
- Location: Ede
- Contact:
Re: GarbageCalendar (new version) lua scripts
Of course I missed that...jvdz wrote: ↑Saturday 04 April 2020 19:02 ximmio is a bit of a special and guess you missed this comment for m_ximmio in the config:Hostname = '' -- Specify the hostname of your website. Only needed for: m_opzet ; m_opzet_api ;
-- OR Specify the companycode for the m_ximmio.lua module. See m_ximmio.lua on how to find this code.

I think ximmio has changed that:
Code: Select all
Referer: https://acv-groep.ximmio.com/modules/f8e2844a-095e-48f9-9f98-71fceb51d2c3/sitekalender/calendar.html?297193&van%20Heutszlaan---71%20%20%20---6711KM---EDE%20GLD---EDE
Yep, thnxs!
Domoticz 2020.2 - RPi3B+ - RFXtrx433XL - P1 - CC2531 - Somfy - Xiaomi - Hue - Omron - MQTT
- jvdz
- Posts: 2330
- 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
Not really... in your case for EDE it is also visual in the index file, but you will find there is also a controller.js file that has on line 116:Hesitated wrote: ↑Saturday 04 April 2020 21:09 I think ximmio has changed that:I've used the guid f8e2844a-095e-48f9-9f98-71fceb51d2c3 from that url and it worked.Code: Select all
Referer: https://acv-groep.ximmio.com/modules/f8e2844a-095e-48f9-9f98-71fceb51d2c3/sitekalender/calendar.html?297193&van%20Heutszlaan---71%20%20%20---6711KM---EDE%20GLD---EDE
Code: Select all
$api('GetConfigOption', {
companyCode: 'f8e2844a-095e-48f9-9f98-71fceb51d2c3',
configName: 'ALL'
})
https://afvalportaal.2go-mobile.com/mod ... /kalender/
So it is a little hard to make a description that will work for everybody with sites like these.

... but nice things are working now for you.

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
-
- Posts: 29
- Joined: Friday 29 November 2019 18:01
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Stable
- Location: Gent
- Contact:
Re: GarbageCalendar (new version) lua scripts
I get an error when I use 'm_opaalkalender'
https://www.ophaalkalender.be/Calendar/ ... /?query=De Pintelaan&zipcode=9000" 2>nul
I get next
Code: Select all
myGarbageDevice = 'Container' -- The Text devicename in Domoticz
ShowNextEvents = 3 -- indicate the next x events to show in the TEXT Sensor in Domoticz
Zipcode = '9000' -- Your zipcode
Housenr = '59' -- Your housnr
Housenrsuf = 'm_ophaalkalender' -- Your housnr suffix (Optional: a/b/c etc)
Street='De Pintelaan' -- Street name Only needed for: m_ophaalkalender-be
Hostname = '' -- Specify the hostname of your website. Only needed for: m_opzet ; m_opzet_api ;
-- OR Specify the companycode for the m_ximmio.lua module. See m_ximmio.lua on how to find this code.
When I go to2020-04-05 15:50:00.208 Status: LUA: @OphaalKalender:Loaded JSON.lua.
2020-04-05 15:50:00.208 Status: LUA: OphaalKalender module start check
2020-04-05 15:50:00.208 Status: LUA: @OphaalKalender:afvaltype_cfg :dummy1;2;2
2020-04-05 15:50:00.208 Status: LUA: @OphaalKalender:afvaltype_cfg :GFT;19;22
2020-04-05 15:50:00.208 Status: LUA: @OphaalKalender:afvaltype_cfg :PMD;19;22
2020-04-05 15:50:00.209 Status: LUA: @OphaalKalender:afvaltype_cfg :Restafval;19;22
2020-04-05 15:50:00.209 Status: LUA: @OphaalKalender:afvaltype_cfg :Glas;19;22
2020-04-05 15:50:00.209 Status: LUA: @OphaalKalender:afvaltype_cfg :Kerstboom;19;22
2020-04-05 15:50:00.209 Status: LUA: @OphaalKalender:afvaltype_cfg :dummy2;16;25
2020-04-05 15:50:00.209 Status: LUA: @OphaalKalender:afvaltype_cfg :Snoeiafval;19;22
2020-04-05 15:50:00.209 Status: LUA: @OphaalKalender:afvaltype_cfg-K;19;22
2020-04-05 15:50:00.209 Status: LUA: OphaalKalender module start update (v20200121-1630)
2020-04-05 15:50:00.209 Status: LUA: @OphaalKalender:=== web update ================================
2020-04-05 15:50:00.209 Status: LUA: @OphaalKalender:sQuery=curl "https://www.ophaalkalender.be/Calendar/ ... /?query=De Pintelaan&zipcode=9000" 2>nul
2020-04-05 15:50:00.358 Status: LUA: @OphaalKalender:adressid:
2020-04-05 15:50:00.358 Error: LUA: @OphaalKalender Error: Empty result from curl command
2020-04-05 15:50:00.358 Error: EventSystem: in /home/pi/domoticz/scripts/lua/script_time_huisvuil-ophaalkalender-be.lua: ...z/scripts/lua/script_time_huisvuil-ophaalkalender-be.lua:252: attempt to index a nil value (global 'adressdata')
https://www.ophaalkalender.be/Calendar/ ... /?query=De Pintelaan&zipcode=9000" 2>nul
I get next
[{"Value":"De Pintelaan","Id":34152,"Brussels":false}]
-
- Posts: 369
- Joined: Tuesday 31 March 2015 22:06
- Target OS: Linux
- Domoticz version: 2024.3
- Location: east netherlands
- Contact:
Re: GarbageCalendar (new version) lua scripts
I think you have to use the ical url:
https://www.ophaalkalender.be/Calendar/ ... pcode=9000
https://www.ophaalkalender.be/Calendar/ ... pcode=9000
- jvdz
- Posts: 2330
- 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
I do not get the error when I test with your information and module "m_ophaalkalender-be"!
Is that also what you are using as you state a different modulename?
Please provide the 3 GarbageCalender logfiles to me in a ZIP file so I can have a look why it doesn't work for you.
just send them to my GitHub Email address.
PS: Why is this line there:
Housenrsuf = 'm_ophaalkalender'
Nah ... he is using the provide scripts.

Jos
Last edited by jvdz on Sunday 05 April 2020 16:54, edited 2 times in total.
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
Who is online
Users browsing this forum: No registered users and 1 guest