GarbageCalendar (new version) lua scripts

Moderator: leecollings

User avatar
Freakandel
Posts: 24
Joined: Tuesday 18 June 2019 14:23
Target OS: Linux
Domoticz version:
Location: Netherlands, Breda region
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by Freakandel »

Hi, my Garbagescript has worked for a long time, but since a couple of day's (a week, maybe) the Domoticz Device is empty and I see the following error in the log of Domoticz:
### Warning: No valid records found in the datafile: /var/tmp/garbagecalendar_m_mijnafvalwijzer.data
I haven't changed anything, and cannot see anything in the /var/tmp/ logfiles.

Is it a common error and easy to fix?
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 »

Freakandel wrote: Wednesday 30 December 2020 22:00 Is it a common error and easy to fix?
It is in case you are affected like others and didn't implement the fix available on github for mijnafvalwijzer not supplying the year for some, but ......
I really ( as always) need the logfiles to be sure of what is happening. ;)
Email them in a zip file to me when you like me to have a look or follow the Wiki for troubleshooting: https://github.com/jvanderzande/Garbage ... ki/Testing

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
wimbre
Posts: 11
Joined: Saturday 14 November 2020 11:07
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by wimbre »

Hi Jos,

I can't find any log files in the /var/tmp directory but I do have errors in the Domoticz logfile.

2021-01-08 19:23:00.325 Error: EventSystem: Lua script /home/pi/domoticz/scripts/lua/script_time_garbagecalendar.lua did not return a commandArray
2021-01-08 19:24:00.336 Error: LUA: !!! LUA Error: .../pi/domoticz/scripts/lua/script_time_garbagecalendar.lua:66: module 'garbagecalendarconfig' not found:
2021-01-08 19:24:00.336 no field package.preload['garbagecalendarconfig']
2021-01-08 19:24:00.336 no file '/home/pi/domoticz/scripts/lua/garbagecalendar/garbagecalendarconfig.lua'
2021-01-08 19:24:00.336 no file './garbagecalendar/garbagecalendarconfig.lua'
2021-01-08 19:24:00.336 no file '/usr/local/share/lua/5.3/garbagecalendarconfig.lua'
2021-01-08 19:24:00.336 no file '/usr/local/share/lua/5.3/garbagecalendarconfig/init.lua'
2021-01-08 19:24:00.336 no file '/usr/local/lib/lua/5.3/garbagecalendarconfig.lua'
2021-01-08 19:24:00.336 no file '/usr/local/lib/lua/5.3/garbagecalendarconfig/init.lua'
2021-01-08 19:24:00.336 no file '/usr/share/lua/5.3/garbagecalendarconfig.lua'
2021-01-08 19:24:00.336 no file '/usr/share/lua/5.3/garbagecalendarconfig/init.lua'
2021-01-08 19:24:00.336 no file './garbagecalendarconfig.lua'
2021-01-08 19:24:00.336 no file './garbagecalendarconfig/init.lua'
2021-01-08 19:24:00.336 no file '/usr/local/lib/lua/5.3/garbagecalendarconfig.so'
2021-01-08 19:24:00.336 no file '/usr/lib/arm-linux-gnueabihf/lua/5.3/garbagecalendarconfig.so'
2021-01-08 19:24:00.336 no file '/usr/lib/lua/5.3/garbagecalendarconfig.so'
2021-01-08 19:24:00.336 no file '/usr/local/lib/lua/5.3/loadall.so'
2021-01-08 19:24:00.336 no file './garbagecalendarconfig.so'
2021-01-08 19:24:00.336 Error: EventSystem: Lua script /home/pi/domoticz/scripts/lua/script_time_garbagecalendar.lua did not return a commandArray

Do you know why there are no logfiles in the / var / tmp directory?
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 »

Did you copy all the files to the correct place and follow the setup wiki as it seems the garbagecalendarconfig.lua file is missing?
https://github.com/jvanderzande/Garbage ... wiki/Setup

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
wimbre
Posts: 11
Joined: Saturday 14 November 2020 11:07
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by wimbre »

jvdz wrote: Friday 08 January 2021 20:28 Did you copy all the files to the correct place and follow the setup wiki as it seems the garbagecalendarconfig.lua file is missing?
https://github.com/jvanderzande/Garbage ... wiki/Setup

Jos
Removing and reinstalling did the job.
wimbre
Posts: 11
Joined: Saturday 14 November 2020 11:07
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by wimbre »

Hi Jos,

I'm trying to get the notifications (mail) up and running, but tbh I can't figure out the right format.

According to the setup:
NotificationEmailAdress = {' ',' '} -- Specify multiple Email Addresses for the notifications. Leave empty to skip email notification

Actual content of my file:
NotificationEmailAdress = {'.com'} -- Specify multiple Email Addresses for the notifications. Leave empty to skip email notification

Logfile:
/var/tmp/garbagecalendar_m_mijnafvalwijzer.data
2021-01-09 14:14:00.184 Status: LUA: 14:14:00 ==> GarbageDate:2021-1-14 GarbageType:gft; Notify: Active=on Time=13:10 DaysBefore=5 reminder=0 Calc Days Diff=5
2021-01-09 14:14:00.184 Status: LUA: 14:14:00 ----> Notification Email send for gft |GarbageCalendar: over 5 dagen de Groen aan de weg zetten!#Groen wordt over 5 dagen opgehaald! (herinnering)#.com|

However, I am not receiving an email.

Thanks in advance.

Wim Bre
Last edited by wimbre on Sunday 24 January 2021 20:09, edited 1 time in total.
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 »

Have you configured Domoticz EMail in Setup and is that working as that is what the script is using?

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
wimbre
Posts: 11
Joined: Saturday 14 November 2020 11:07
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by wimbre »

Have you configured Domoticz EMail in Setup and is that working as that is what the script is using?

:o Solved!
edezwaan82
Posts: 2
Joined: Sunday 24 December 2017 13:37
Target OS: -
Domoticz version:
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by edezwaan82 »

Hi all,

I`m trying to configure my situation but couldn`t find the companyCode for https://mijn.circulus-berkel.nl/afvalkalender/. Does anyone knows the code for Circules-berkel. I`m living in Apeldoorn.

Thanks.
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 »

That Garbage website isn't supported by any of the existing modules so will require a new module to be written.

Scratch that: Think you need to use module OPZET.

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
PatrickG
Posts: 2
Joined: Sunday 31 January 2021 21:50
Target OS: -
Domoticz version:
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by PatrickG »

Hi Jos,

Is it possible to include the following service in your code?

https://inzamelwijzer.suez.nl/

I think this will cover (at least) the Arnhem region.

BR
Patrick
User avatar
Thuis
Posts: 251
Joined: Tuesday 11 September 2018 11:36
Target OS: Linux
Domoticz version: Beta
Location: The Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by Thuis »

Hello, i have been using this great feature for a while now. I just took my domotica experience to the next level using google home and node red.
I would like to habe google tell me when to put the garbage out. I know in the garbagecalendarconfig.lua is a notification setting.
Now, i can do notification of a switch, i can select google_devices. Would it be possible to do this also inside the garbagecalendarconfig.lua ?

Now i have: Notificationsystem = 'telegram;kodi;' inside the garbagecalendarconfig.lua.
So i thought very simple, to add the same notification as the switches inside domoticz.
I put in the garbagecalendarconfig.lua: Notificationsystem = 'telegram;kodi;google_devices'

Perhaps it is too simple of me, but would that be possible? Or does anyone have an idea how to let the notification speak thru my nest mini?
Or it could be an idea to implement it in the script? The notification system: google_devices ? Just like the switches notification settings?

Image

It speaks what ever i put in the notification in dutch language :-) Would be awesome to have garbagecalendar speak to me too.
I Love Domoticz ! And the community around it :-)
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 »

PatrickG wrote: Sunday 31 January 2021 21:55 Hi Jos,

Is it possible to include the following service in your code?

https://inzamelwijzer.suez.nl/

I think this will cover (at least) the Arnhem region.

BR
Patrick
Patrick,
I believe the proper module is: m_opzet_api.
PM/Email me a valid zipcode/housenr combo to test in case it doesn't work, so I can see what it would take to make it work?

Cheers,
Jos
Last edited by jvdz on Monday 01 February 2021 10:40, edited 1 time in total.
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 »

Thuis wrote: Sunday 31 January 2021 23:21 It speaks what ever i put in the notification in dutch language :-) Would be awesome to have garbagecalendar speak to me too.
You can put in the config any supported Domoticz notification system, but I believe that Google notification is the Google Cloud notification, not casting to a Home device.
I am currently have a different approach to make Domoticz talk to me:
  • Created 2 Dummy text devices which will be updated with the text to be spoken by Google Home/Nest. I use 2 dummy devices to make the max lenght of the spoken text 2 * 63 characters.
  • Nodered process, which monitor's MQTT Domoticz/out for the dummy devices and cast the text to the home device using module "node-red-contrib-cast"
In this way I can send messages from any event to my Google Home.

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

Hi Jos!

According to "Gianni" the Belgian recycleapp changed once again... It stopped receiving data indeed and text is blanco since last week:

"Gianni" posted this:
recycleapp has changed the street names

Now it's get the name fron the id of https://data.vlaanderen.be/

https://data.vlaanderen.be/doc/straatnaam/xxxxxx in my case

https://recycleapp.be/api/app/v1/collec ... 3&size=100
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 indeed see it is failing now. So what exactly is the sequence of web calls now as the listed links doesn't contain all required info?
You can of course always make the update for yourself and make a pull request in GitHub with the changes. ;)

Jos
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: Monday 01 February 2021 10:54 I indeed see it is failing now. So what exactly is the sequence of web calls now as the listed links doesn't contain all required info?
You can of course always make the update for yourself and make a pull request in GitHub with the changes. ;)

Jos
Testing new code is no problem for me, but I don't have the knowledge to change the code myself :oops: :) .
In the dashticz garbage module (managed by Lokonli) I see they are looking for a solution too.
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 issue seems to be that they have moved away from an hardcoded secret but now put that into a mainxxxxxx.js file.
I have updated the script and added 2 extra steps to get the name of the mainxxxx.js file, retrieve that file and get the secret key from it.
After this the rest works again. The script now does 6 API calls to get the calendar info 8-)

Please give the development version a try and let me know it works for you too, so I can move it to Master.
https://raw.githubusercontent.com/jvand ... app-be.lua

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

Updated "m_recycleapp-be" with your updated version and set debug to true:
Log:

Code: Select all

2021-02-01 12:52:00.394 Status: LUA: @GarbageCal(m_recycleapp-be): #### Mon Feb 1 12:52:00 2021 ### Start garbagecalendar script v20200613-1800
2021-02-01 12:52:00.394 Status: LUA: @GarbageCal(m_recycleapp-be): #### Debuging with extra messages because "mydebug=true" in garbagecalendarconfig.lua
2021-02-01 12:52:00.394 Status: LUA: @GarbageCal(m_recycleapp-be): #### please change it back to "mydebug=false" when done testing to avoid growing a big domoticz log.
2021-02-01 12:52:00.394 Status: LUA: @GarbageCal(m_recycleapp-be): domoticzjsonpath: /home/pi/domoticz/scripts/lua/
2021-02-01 12:52:00.394 Status: LUA: @GarbageCal(m_recycleapp-be): datafilepath: /var/tmp/
2021-02-01 12:52:00.394 Status: LUA: @GarbageCal(m_recycleapp-be): scriptpath: /home/pi/domoticz/scripts/lua/
2021-02-01 12:52:00.394 Status: LUA: @GarbageCal(m_recycleapp-be): Loaded /home/pi/domoticz/scripts/lua/garbagecalendar/garbagecalendarconfig.lua.
2021-02-01 12:52:00.396 Status: LUA: @GarbageCal(m_recycleapp-be): Loaded /home/pi/domoticz/scripts/lua/garbagecalendar/generalfuncs.lua.
2021-02-01 12:52:00.397 Status: LUA: @GarbageCal(m_recycleapp-be): Start checking garbagetype_cfg table:
2021-02-01 12:52:00.397 Status: LUA: @GarbageCal(m_recycleapp-be): -> NotificationTime:19:2 Garbagetype:snoeiafval
2021-02-01 12:52:00.397 Status: LUA: @GarbageCal(m_recycleapp-be): -> NotificationTime:19:22 Garbagetype:pmd
2021-02-01 12:52:00.397 Status: LUA: @GarbageCal(m_recycleapp-be): -> NotificationTime:19:2 Garbagetype:p-k
2021-02-01 12:52:00.397 Status: LUA: @GarbageCal(m_recycleapp-be): -> NotificationTime:19:2 Garbagetype:papier-karton
2021-02-01 12:52:00.397 Status: LUA: @GarbageCal(m_recycleapp-be): -> NotificationTime:19:22 Garbagetype:gft
2021-02-01 12:52:00.397 Status: LUA: @GarbageCal(m_recycleapp-be): -> NotificationTime:19:2 Garbagetype:restafval
2021-02-01 12:52:00.397 Status: LUA: @GarbageCal(m_recycleapp-be): -> NotificationTime:2:30 Garbagetype:reloaddata
2021-02-01 12:52:00.397 Status: LUA: @GarbageCal(m_recycleapp-be): -> NotificationTime:2:31 Garbagetype:dummy1
2021-02-01 12:52:00.397 Status: LUA: @GarbageCal(m_recycleapp-be): -> NotificationTime:19:2 Garbagetype:glas
2021-02-01 12:52:00.397 Status: LUA: @GarbageCal(m_recycleapp-be): Start update for text device:
2021-02-01 12:52:00.398 Status: LUA: @GarbageCal(m_recycleapp-be): - Start looping through data from the website to find the first 3 event to show: /var/tmp/garbagecalendar_m_recycleapp-be.data
2021-02-01 12:52:00.398 Status: LUA: @GarbageCal(m_recycleapp-be): ### Warning: No valid records found in the datafile: /var/tmp/garbagecalendar_m_recycleapp-be.data
2021-02-01 12:52:00.398 Status: LUA: @GarbageCal(m_recycleapp-be): ### Please check the garbagecalendar log files for issues : /var/tmp/garbagecalendar_web_m_recycleapp-be.log and /var/tmp/garbagecalendar_run_m_recycleapp-be.log
2021-02-01 12:52:00.398 Status: LUA: @GarbageCal(m_recycleapp-be): - End -----------------
2021-02-01 12:52:00.398 Status: LUA: @GarbageCal(m_recycleapp-be): ==> found schedule:
2021-02-01 12:52:00.398 Status: LUA: @GarbageCal(m_recycleapp-be): Update device from:
2021-02-01 12:52:00.398 0
2021-02-01 12:52:00.398 replace with:
2021-02-01 12:52:00.398
2021-02-01 12:52:00.399 Status: LUA: @GarbageCal(m_recycleapp-be): #### 12:52:00 End garbagecalendar script v20200613-1800
2021-02-01 12:52:00.408 Status: EventSystem: Script event triggered: /home/pi/domoticz/scripts/lua/script_time_garbagecalendar.lua
garbagecalendar_web_m_recycleapp-be.log

Code: Select all

@m_ophaalkalender-be: #### Mon Feb  1 02:30:00 2021 ### Start garbagecalendar module m_ophaalkalender-be (v20200606-1300)
@m_ophaalkalender-be: Loaded JSON.lua.
@m_ophaalkalender-be: !!! perform background update to /var/tmp/garbagecalendar_m_recycleapp-be.data for Zipcode 9120 - 21  (optional) Hostname:
@m_ophaalkalender-be: ---- web update ----------------------------------------------------------------------------
@m_ophaalkalender-be: sQuery=curl -k  -H "x-secret: Qp4KmgmK2We1ydc9Hxso5D6K0frz3a9raj2tqLjWN5n53TnEijmmYz78pKlcma54sjKLKogt6f9WdnNUci6Gbujnz6b34hNbYo4DzyYRZL5yzdJyagFHS15PSi2kPUc4v2yMck81yFKhlk2aWCTe93" -H "x-consumer: recycleapp.be" https://recycleapp.be/api/app/v1/access-token 2>/var$
@m_ophaalkalender-be: ---- web data ----------------------------------------------------------------------------
@m_ophaalkalender-be: {"host":"http://api-http:8080","identifier":"9abae848-fa67-4fb7-bedc-4cb44a421570","timestamp":"2021-02-01T01:30:00.433Z","status":401,"name":"Unauthorized","message":"Missing authorization"}
@m_ophaalkalender-be: ---- web err ------------------------------------------------------------------------
@m_ophaalkalender-be: Web_Err=  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
^M  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0^M  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0^M100   191  100   191    0     0   1067      0 --:--:-- --:--:-- --:--:--  1067

@m_ophaalkalender-be: ---- end web data ------------------------------------------------------------------------
@m_ophaalkalender-be: ### Error: No accessToken retrieved...  stopping execution.
@m_ophaalkalender-be: => Write data to /var/tmp/garbagecalendar_m_recycleapp-be.data
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 haven't done a webupdate!
Delete the data file and run again or update this to force the update process:

Code: Select all

mydebug      = true  -- (true/false)
testdataload = true  -- (true/false)
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest