Page 17 of 24
Re: GarbageCalendar (new version) lua scripts
Posted: Monday 08 November 2021 11:54
by sammyke007
Hi Jos. Me again, sorry!
Since last week my .dat won't get updated anymore. The only thing I see while setting testdataload and mydebug to true is:
Code: Select all
EventSystem: Warning!, lua script /home/pi/domoticz/scripts/lua/script_time_garbagecalendar.lua has been running for more than 10 seconds
in the logs. Did they change their API again

?
EDIT:
Updated to the latest module script: m_recycleapp-be and working again, tnx!
Re: GarbageCalendar (new version) lua scripts
Posted: Wednesday 22 December 2021 13:10
by rensbr
I want to use this Script with Blink. I have followed the guide and copied the whole directory (garbagecalendar) into '/home/pi/domoticz/scripts/lua'. I have copied the script 'garbagecalendarconfig.lua' to '/home/pi/domoticz/scripts/lua' and added the postcode, notifcations settings, etc.
But the script seems to don't do anything. I don't get any errors in the logs, notifications or messages. Is there something I have to enable?
Edit: I totally forgot to add the time script to the folder now it works. But the text is very ugly.
Is it possible to give change the text that is displayed, the same as for the notification. Now it says:
plastic, metaal en drankkartons: DATE
gft - Place: DATE
I like to change that to:
PMD: DATE
GFT: DATE
Re: GarbageCalendar (new version) lua scripts
Posted: Wednesday 22 December 2021 15:32
by jvdz
Yes you can modify it to the way you like it as described in the Wiki:
https://github.com/jvanderzande/Garbage ... devicetext
Show me your config in case you have made the modifications and things aren't working the way you want.
Re: GarbageCalendar (new version) lua scripts
Posted: Wednesday 22 December 2021 15:37
by rensbr
Thank for the quick reply. After your message the light went 'on', I have added the correct text and now it works. Thanks!
Re: GarbageCalendar (new version) lua scripts
Posted: Saturday 25 December 2021 10:35
by nl2rma
Thank you for the script, got it working and I'm lovin'it.
Merry x-mas
Re: GarbageCalendar (new version) lua scripts
Posted: Tuesday 08 March 2022 21:23
by freijn
Hi Jos
Was running the old script for years now, but suddenly stopped ( i believe for 2 weeks now).
https://afvalkalender.purmerend.nl/
Is my calendar url. Couldn't find it in this topic.
Trying to get the new script to work..
Can you please advise me what module I have to enable to get it to work?
Many thanks for your great work!!!
Frank
Re: GarbageCalendar (new version) lua scripts
Posted: Wednesday 09 March 2022 8:51
by jvdz
Hi Frank,
Do you have some details for me? The API version of OPZET still seems to run fine, so guess it is the Screen Scraper version module "m_opzet" that is giving the issue? Did you try the API version "m_opzet_api" ?
Cheers,
Jos
Re: GarbageCalendar (new version) lua scripts
Posted: Wednesday 09 March 2022 10:09
by jvdz
I have made a fix (Thanks to @Lokonli for the basics of the fix) in the m_opzet.lua module to support the regular website as well but my advice would be to use the m_opzet_api module when that is working as that way less likely to change than an screenscrape of a website.
This is the updated file you would need:
https://github.com/jvanderzande/Garbage ... _opzet.lua
Jos
Re: GarbageCalendar (new version) lua scripts
Posted: Wednesday 09 March 2022 22:26
by freijn
Jos,
unfortunately both does not work. I have tried M_opzet and M_opzet_api.
The website returns with an error.
I can get the data with the following url returned a json
https://afvalkalender.purmerend.nl/rest ... ender/2022
Re: GarbageCalendar (new version) lua scripts
Posted: Wednesday 09 March 2022 22:57
by jvdz
Please pm me your details from the config so I can test.

Re: GarbageCalendar (new version) lua scripts
Posted: Thursday 10 March 2022 20:18
by freijn
Thanks for the quick help and solving my error !
It's working now for me as well

Re: GarbageCalendar (new version) lua scripts
Posted: Saturday 02 April 2022 11:16
by gvandick
module m_montferland
I have a issue with the list garbage. If there are two of the same type of garbage plannend in the list (I use 4) only one showed up.
I tried several times debug also cleared every time cache but no result.
Example
GFT: 1 apr
PMD: 5 apr
Rest: 15 apr
(GFT: 18 apr) doesn't show
Papier: 30 apr
If there is a GFT on 18 apr, this is not in the list, but afther 1 apr it shows up
the list is as follow
PMD: 5 apr
Rest: 15 apr
GFT: 18 apr
Papier: 30 apr
Re: GarbageCalendar (new version) lua scripts
Posted: Saturday 02 April 2022 11:35
by jvdz
What is the setting for this config variable?
ShowSinglePerType = false
Guess you set that to true which means only the first next date per garbage type is shown.
Re: GarbageCalendar (new version) lua scripts
Posted: Sunday 03 April 2022 9:19
by gvandick
No the setting is : false
ShowSinglePerType = false
ShowNextEvents = 4
Combine_Garbage_perDay = false
I have change this to try but no effect. I try several combinations for these settings.
Also I change ShowNextEvents to 6 but also no effect still 4 events show up in domoticz dummy, but in the domoticz log shows searching for 6
I check every changing In the domoticz log. still the same 4 items, missing the second date for GFT

- Schermafbeelding 2022-04-03 091820.png (139.5 KiB) Viewed 2253 times
Re: GarbageCalendar (new version) lua scripts
Posted: Sunday 03 April 2022 10:50
by jvdz
I've just tested with an test address I have for the m_montferland module and it simply returns the next 4 dates, one for each garbage type, so guess that is the way it works for montferland:
Code: Select all
=== garbagecalendar_m_montferland.data ====================================================================
return {
-- Table: {1}
{
{2},
{3},
{4},
{5},
["Garbage_LastUpdate"]="04/03/22 10:44:02",
},
-- Table: {2}
{
["garbagedate"]="2022-4-4",
["garbagetype"]="GFT afval",
},
-- Table: {3}
{
["garbagedate"]="2022-4-6",
["garbagetype"]="PMD",
},
-- Table: {4}
{
["garbagedate"]="2022-4-9",
["garbagetype"]="Papier",
},
-- Table: {5}
{
["garbagedate"]="2022-4-25",
["garbagetype"]="Rest afval",
},
}
Re: GarbageCalendar (new version) lua scripts
Posted: Sunday 03 April 2022 11:14
by jvdz
With some trial and error I figured out how to get all dates till the end of the year. In November/December it will retrieve also the next year data as it was doing already before:
Code: Select all
Schedule: maa 4 apr: gft afval ; woe 6 apr: pmd ; zat 9 apr: Blauwe bak ; zat 16 apr: gft afval ;
The change is available in github, please give it a try and see if it also works for you.

Re: GarbageCalendar (new version) lua scripts
Posted: Monday 04 April 2022 9:43
by gvandick
I tried, but the same results. I will look tomorow again afther the collection of today.
Last december there wasn't a problem retrieving next year. But then the settings for number collection was 3. I change it recent to 4 because I wanted see the next collection of the same type.
Re: GarbageCalendar (new version) lua scripts
Posted: Monday 04 April 2022 12:26
by jvdz
You will have to reload the Web data as that by default only happens one time during the night.

Re: GarbageCalendar (new version) lua scripts
Posted: Tuesday 05 April 2022 8:32
by gvandick
Still the second garbage type date skip, as I mentioned in the first post.
Re: GarbageCalendar (new version) lua scripts
Posted: Tuesday 05 April 2022 8:54
by jvdz
Please email me your logfiles in a zip to my github email address so I can have a look what is happening.
EDIT: I just ran another test on the test address I have and had to change the number to 5 because the first 4 were all difference garbage types:
Code: Select all
Schedule:
zat 14 mei: Blauwe bak ;
maa 16 mei: gft afval ;
woe 18 mei: pmd ;
maa 23 mei: rest afval ;
maa 30 mei: gft afval ;