GarbageCalendar (new version) lua scripts

Moderator: leecollings

dimple64
Posts: 2
Joined: Saturday 08 April 2017 3:50
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by dimple64 »

Garbagecalendar has worked flawless for more than a year. Suddenly, a few weeks ago (don’t know exactly) the data now contains back slashes and new lines where they don’t belong

The myGarbageDevice in domoticz looks like this:

plastic-\, fruit- en tuinafval
: 10 5 2022
groente-\, fruit- en tuinafval
:13 5 2022
oud papier & karton
: 14 5 2022


I am using afvalkalender.cyclusnv.nl with websitemodule = "m_opzet" I’ve checked the website with webbrowser and everything seems normal.
garbagecalendar_run_m_opzet.log says the sript can't find can't interpret the website data. I have created additonal lines in the garbagetype_cfg table reflecting the changed data, like this:

["plastic\\, metaal en drankenkartons"] ={hour=07,min=02,daysbefore=1,reminder=0,text="plastic and metalwaste"},
["groente-\\, fruit- en tuinafval"] ={hour=07,min=02,daysbefore=1,reminder=0,text="vegetable fruit and gardenwaste"},
["oud papier & karton"] ={hour=07,min=02,daysbefore=1,reminder=0,text="old paper and karton"},


Unfortunately that didn't help. Does anybody else have/had this same issue?? Is there a way to solve this??

thanks in advance!
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 »

dimple64 wrote: Monday 02 May 2022 21:48 Garbagecalendar has worked flawless for more than a year. Suddenly, a few weeks ago (don’t know exactly) the data now contains back slashes and new lines where they don’t belong

The myGarbageDevice in domoticz looks like this:

plastic-\, fruit- en tuinafval
: 10 5 2022
groente-\, fruit- en tuinafval
:13 5 2022
oud papier & karton
: 14 5 2022


I am using afvalkalender.cyclusnv.nl with websitemodule = "m_opzet" I’ve checked the website with webbrowser and everything seems normal.
garbagecalendar_run_m_opzet.log says the sript can't find can't interpret the website data. I have created additonal lines in the garbagetype_cfg table reflecting the changed data, like this:

["plastic\\, metaal en drankenkartons"] ={hour=07,min=02,daysbefore=1,reminder=0,text="plastic and metalwaste"},
["groente-\\, fruit- en tuinafval"] ={hour=07,min=02,daysbefore=1,reminder=0,text="vegetable fruit and gardenwaste"},
["oud papier & karton"] ={hour=07,min=02,daysbefore=1,reminder=0,text="old paper and karton"},


Unfortunately that didn't help. Does anybody else have/had this same issue?? Is there a way to solve this??

thanks in advance!
Did you try to update GarbageCalendar with the latest files? There are a few files updated so maybe the problem is solved after this.
User avatar
jvdz
Posts: 2266
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 »

dimple64 wrote: Monday 02 May 2022 21:48 Is there a way to solve this??
I would have to test with this to see what is happening. Could you PM me your garbagecalendarconfig.lua so I can use that to test?

Thanks,
Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
dimple64
Posts: 2
Joined: Saturday 08 April 2017 3:50
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by dimple64 »

mikeoo wrote: Tuesday 03 May 2022 6:55
dimple64 wrote: Monday 02 May 2022 21:48 Garbagecalendar has worked flawless for more than a year. Suddenly, a few weeks ago (don’t know exactly) the data now contains back slashes and new lines where they don’t belong

The myGarbageDevice in domoticz looks like this:

plastic-\, fruit- en tuinafval
: 10 5 2022
groente-\, fruit- en tuinafval
:13 5 2022
oud papier & karton
: 14 5 2022


I am using afvalkalender.cyclusnv.nl with websitemodule = "m_opzet" I’ve checked the website with webbrowser and everything seems normal.
garbagecalendar_run_m_opzet.log says the sript can't find can't interpret the website data. I have created additonal lines in the garbagetype_cfg table reflecting the changed data, like this:

["plastic\\, metaal en drankenkartons"] ={hour=07,min=02,daysbefore=1,reminder=0,text="plastic and metalwaste"},
["groente-\\, fruit- en tuinafval"] ={hour=07,min=02,daysbefore=1,reminder=0,text="vegetable fruit and gardenwaste"},
["oud papier & karton"] ={hour=07,min=02,daysbefore=1,reminder=0,text="old paper and karton"},


Unfortunately that didn't help. Does anybody else have/had this same issue?? Is there a way to solve this??

thanks in advance!
Did you try to update GarbageCalendar with the latest files? There are a few files updated so maybe the problem is solved after this.
Yes I did, upgraded after the issue occured. No solution:(
User avatar
jvdz
Posts: 2266
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 »

Correct.. in this case the m_opzet_api module works fine, but the m_opzet module get's a backslash character in the garbagetype back from the website, which is an issue to handle.
There is now a Develeopment version available which simply removes any \ characters from the garbagetype, as those really shouldn't be in there to begin with. :)
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
Drees
Posts: 8
Joined: Monday 06 June 2022 16:00
Target OS: Windows
Domoticz version:
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by Drees »

:idea: Or you read the manual :oops:

Sorry it is working, i didnt read the manual in github wiki



Sorry, but I'm a Noob about this.
I was trying to use this feature, but i can't figure out what mi doing wrong.

i did go to the jvanderzande / GarbageCalendar

First i had a virtual text object with the name: 'Afval Kalender' and idx 31
i go to Setup\more Options\events

i create a new 'Lua' "all commented' script and called 'garbagecalendarconfig.lua'
i fill in the next 3 lines:

Code: Select all

myGarbageDevice = 'Afval Kalender'             -- The Text devicename in Domoticz. eg 'Container'
Zipcode = '2513BN'          -- Your zipcode  eg '1234AB'	--
Housenr = '8'          -- Your housnr. eg '99'

i create a new 'Lua' "all commented' script and called 'script_time_garbagewijzer.lua'
without any changes

i create a new 'Lua' "all commented' script and called 'm_mijnafvalwijzer.lua'
without any changes


I understand the name of the scripts are important, but I'm not sure if i also have to add '.lua' or not to the script name.

error from logs

Code: Select all

 2022-06-06 16:39:27.142 Error: EventSystem: Lua script script_time_garbagewijzer.lua did not return a commandArray
2022-06-06 16:39:27.149 Error: EventSystem: Lua script garbagecalendarconfig.lua did not return a commandArray 
TeamKleijn
Posts: 14
Joined: Sunday 05 January 2020 13:03
Target OS: -
Domoticz version:
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by TeamKleijn »

Hello Jos,

I've implemented the latest version of your garbageCollector scripts. I'm wondering about the fact the script runs every minute. The information the script grabbes isn't far away for updating once every minute. And running the script slow downs my PI because it's very
I think once an hour is good enough.

Do you have possibilities to run the script once an hour ?
Wich changes do applie into your scripts ?

Thanks for responding Jan

Rob
User avatar
jvdz
Posts: 2266
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 script runs each minute as it's purpose id to send you the Notification at the requested time so needs to run every minute, but it will hardly take any time to process as the real heavy lifting, the collection of the WebData, is done once a day and done in the background not burdening the Domoticz single threaded event system.

.. so I am wondering what you are seeing that is worrying you? :)
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 »

i get this error

2022-08-13 20:43:00.725 Error: LUA: 20:43:00 MainScript: #### Error: 0 data records, updated at Sat Aug 13 20:43:00 2022 from datafile:/var/tmp/garbagecalendar_m_mijnafvalwijzer.data

can someone help me to sloved this error
User avatar
jvdz
Posts: 2266
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 »

smaus wrote: Saturday 13 August 2022 20:45 can someone help me to sloved this error
Sure .... did you check out the steps in the Wiki? https://github.com/jvanderzande/Garbage ... ki/Testing
The Webmodule hasn't been able to retrieve the data so that's the log to check first!
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 »

jvdz wrote: Sunday 14 August 2022 9:39
smaus wrote: Saturday 13 August 2022 20:45 can someone help me to sloved this error
Sure .... did you check out the steps in the Wiki? https://github.com/jvanderzande/Garbage ... ki/Testing
The Webmodule hasn't been able to retrieve the data so that's the log to check first!
Whre can i find garbage.data?
User avatar
jvdz
Posts: 2266
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 »

smaus wrote: Monday 15 August 2022 17:30 Whre can i find garbage.data?
5th line in the Wiki? :roll:
In case you have issues with your setup you can do the following steps described below. When you still can't figure out the issue you have, you can also zip up the below defined log & data files and your garbagecalendarconfig.lua file and Email them to my GitHub Email address so I can check what is happening. :)

Check first your logfiles.
Check these files exist in the directory your defined in garbagecalendarconfig.lua in variable datafilepath whether they exist and/or contain errors:

garbage.data => the file containing the result of the webupdate process by the module.
garbage_run_modulename.log => log of the last time the script was ran
garbage_run_update_modulename.log => log of the last time the script ran the update process
garbage_web_modulename.log => log of the backgroung webupdate process.
So as indicated you probably need to check the last log file in that list as that should contain the nightly update information.
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
Dr8072
Posts: 25
Joined: Wednesday 14 December 2016 12:35
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10xxx
Location: THe Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by Dr8072 »

Hi jvdz,

Thanks for the hard work...
Just leaving a note for other people in heiloo, uitgeest or castricum when they realise the gemeent has moved away from mijnafvalwijzer to mijnafvalzaken.nl in case they search for these terms

they can use the script m_opzet and use mijafvalzaken.nl as hostname
User avatar
jvdz
Posts: 2266
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 am busy making a few changes to garbagecalendar to:
  • Allow the script to run in both LUA Time event as well as DzVents
  • Added standard notification script that can do Event action in Domoticz when a notification is happening. Eg switch on a light in a particular color for a period. This again supports both commandArray[] as DzVents commands like domoticz.devices(lamp).setLevel(100)
    This script can be modified to your needs for easy integration.
  • scriptpath variable is removed from the config an determined by the script itself.
Any takers that like to test a development version to ensure things are working in the different environments?
I will make the code available in the Github Development branch somewhere in the next few days.

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

jvdz wrote: Wednesday 04 January 2023 16:52 I am busy making a few changes to garbagecalendar to:
  • Allow the script to run in both LUA Time event as well as DzVents
  • Added standard notification script that can do Event action in Domoticz when a notification is happening. Eg switch on a light in a particular color for a period. This again supports both commandArray[] as DzVents commands like domoticz.devices(lamp).setLevel(100)
    This script can be modified to your needs for easy integration.
  • scriptpath variable is removed from the config an determined by the script itself.
Any takers that like to test a development version to ensure things are working in the different environments?
I will make the code available in the Github Development branch somewhere in the next few days.

Jos
Little late, but I can do some testing if you like, but just for the classic setup (no dzvents)

At the moment my scripts isn't working, so I'm fine with some alterations if needed.
Custodes Septentrionum
riko
Posts: 90
Joined: Saturday 22 August 2020 13:36
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by riko »

Same here, RMN chenged their app, now de API isn't accessible anymore. The data is somewhere out there, does somebody have a solution?
User avatar
jvdz
Posts: 2266
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 »

Rolandet wrote: Sunday 05 March 2023 12:28 [Little late, but I can do some testing if you like, but just for the classic setup (no dzvents)
At the moment my scripts isn't working, so I'm fine with some alterations if needed.
What exactly isn't working with the current GarbageCalendar (Master)?
The Development version of the new version is currently available in the Development branch on github.
riko wrote: Sunday 05 March 2023 12:37 Same here, RMN changed their app, now de API isn't accessible anymore. The data is somewhere out there, does somebody have a solution?
There is no module for RMN as yet in my GarbageCalendar setup and a quick search tell me they moved and there is no information available yet of which API to use to get the data. When it is know it should be possible to make that module.

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

jvdz wrote: Sunday 05 March 2023 14:42
Rolandet wrote: Sunday 05 March 2023 12:28 [Little late, but I can do some testing if you like, but just for the classic setup (no dzvents)
At the moment my scripts isn't working, so I'm fine with some alterations if needed.
What exactly isn't working with the current GarbageCalendar (Master)?
The Development version of the new version is currently available in the Development branch on github.
riko wrote: Sunday 05 March 2023 12:37 Same here, RMN changed their app, now de API isn't accessible anymore. The data is somewhere out there, does somebody have a solution?
There is no module for RMN as yet in my GarbageCalendar setup and a quick search tell me they moved and there is no information available yet of which API to use to get the data. When it is know it should be possible to make that module.

Jos
Hi Jos.

For Omrin, the data just isn't coming in anymore.

garbagecalender_m_omrin.data:

Code: Select all

return {
-- Table: {1}
{
},

What's the best way to install the dev branche?
Custodes Septentrionum
User avatar
jvdz
Posts: 2266
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 »

Maybe first start with updating your setup to the latest version as I did commit an update for OMRIN:

Code: Select all

garbagecalendar -    fixed omrin since their website is changed. it now uses an API like HA      2 weeks ago
Jos ;)
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
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 »

jvdz wrote: Sunday 05 March 2023 15:31 Maybe first start with updating your setup to the latest version as I did commit an update for OMRIN:

Code: Select all

garbagecalendar -    fixed omrin since their website is changed. it now uses an API like HA      2 weeks ago
Jos ;)
Ha ! I thought that may be a part of your new branch :lol:

it's been quite a while. Just follow the initial setup instructions ? (copy files e.a. and save my garbagecalendarconfig.lua)
Custodes Septentrionum
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest