GarbageCalendar (new version) lua scripts

Moderator: leecollings

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. Me again, sorry! :oops: :D

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!
rensbr
Posts: 61
Joined: Friday 27 July 2018 19:01
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: GarbageCalendar (new version) lua scripts

Post 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
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 »

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.
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
rensbr
Posts: 61
Joined: Friday 27 July 2018 19:01
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by rensbr »

jvdz wrote: Wednesday 22 December 2021 15:32 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.
Thank for the quick reply. After your message the light went 'on', I have added the correct text and now it works. Thanks!
User avatar
nl2rma
Posts: 5
Joined: Tuesday 09 February 2016 13:02
Target OS: -
Domoticz version:
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by nl2rma »

Thank you for the script, got it working and I'm lovin'it.
Merry x-mas
freijn
Posts: 536
Joined: Friday 23 December 2016 16:40
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Netherlands Purmerend
Contact:

Re: GarbageCalendar (new version) lua scripts

Post 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
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 »

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
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 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
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
freijn
Posts: 536
Joined: Friday 23 December 2016 16:40
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Netherlands Purmerend
Contact:

Re: GarbageCalendar (new version) lua scripts

Post 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
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 »

Please pm me your details from the config so I can test. :)
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
freijn
Posts: 536
Joined: Friday 23 December 2016 16:40
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Netherlands Purmerend
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by freijn »

Thanks for the quick help and solving my error !

It's working now for me as well :-)
gvandick
Posts: 30
Joined: Saturday 01 July 2017 12:48
Target OS: Windows
Domoticz version:
Contact:

Re: GarbageCalendar (new version) lua scripts

Post 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
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 »

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.
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
gvandick
Posts: 30
Joined: Saturday 01 July 2017 12:48
Target OS: Windows
Domoticz version:
Contact:

Re: GarbageCalendar (new version) lua scripts

Post 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
Schermafbeelding 2022-04-03 091820.png (139.5 KiB) Viewed 1885 times
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'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",
},
}
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 »

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. :)
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
gvandick
Posts: 30
Joined: Saturday 01 July 2017 12:48
Target OS: Windows
Domoticz version:
Contact:

Re: GarbageCalendar (new version) lua scripts

Post 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.
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 will have to reload the Web data as that by default only happens one time during the night. ;)
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
gvandick
Posts: 30
Joined: Saturday 01 July 2017 12:48
Target OS: Windows
Domoticz version:
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by gvandick »

Still the second garbage type date skip, as I mentioned in the first post.
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 »

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 ; 
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest