GarbageCalendar (new version) lua scripts

Moderator: leecollings

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 »

@iTDB, I think I found the issue you have: I tested with a streetname that contains a space and was able to replicate your issue.
( believe this the info for your zipcode/housnr/street: restafval: vri 9 okt ; pmd: vri 9 okt ; gft: vri 16 okt ; ?)
This is fixed in the current version on GitHub, so could you test that and let me know?
When you still have issues, please Email your logfiles as indicated so I can check the details.

Jos
Last edited by jvdz on Thursday 08 October 2020 21:19, edited 1 time in total.
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
iTDB
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

Post by iTDB »

jvdz wrote: Wednesday 07 October 2020 17:31 @iTDB, I think I found the issue you have: I tested with a streetname that contains a space and was able to replicate your issue.
( believe this the info for your zipcode/housnr/street: restafval: vri 9 okt ; pmd: vri 9 okt ; gft: vri 16 okt ; ?)
This is fixed in the current version on GitHub, so could you test that and let me know?
When you still have issues, please Email your logfiles as indicated so I can can the details.

Jos
It works. Thx
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.
I'm trying to get the notifications up and running, but tbh I can't figure out what to do with this line:

Notificationsystem = '' -- Specify notification system eg "telegram/pushover/gcm/http/kodi/lms/nma/prowl/pushalot/pushbullet/pushsafer" leave empty to skip

--

I could enter 'mail' , but is that enough? Or should it be smtp or something?
?

tnx
Custodes Septentrionum
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 »

Mail is not an option in that list. ;)
It is basically pretty strait forward: You have these 3 options which you can define:

Code: Select all

NotificationEmailAdress = {'',''}  -- Specify multiple Email Addresses for the notifications. Leave empty to skip email notification
Notificationsystem = ''            -- Specify notification system eg "telegram/pushover/gcm/http/kodi/lms/nma/prowl/pushalot/pushbullet/pushsafer" leave empty to skip
Notificationscript = ''            -- Specify personal notification script/command eg:  lua sendmessage.lua "@TEXT@"  (where @TEXT@ will be replaced by the notification text.)
So:
- When you want to receive Email notifications you use the first line and define 1 or more Email addresses.
- When you want to use any of the other Domoticz internal Notification systems you specify that option in the second line.
- When you want to run a script to handle the notifications you use the third line.

All clear?
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 »

aaah :lol: quite clear

I have entered an emailaddress, but haven't received any notifications sofar. :|
Custodes Septentrionum
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 did specify the appropriate information in the garbagetype_cfg table?
Should you have received one already?
If so ... check the logs when it should have been send so you can see whether there is an error.
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: Thursday 08 October 2020 21:54 You did specify the appropriate information in the garbagetype_cfg table?
Should you have received one already?
If so ... check the logs when it should have been send so you can see whether there is an error.
Jos
Yeah, this is my _cfg table:

Code: Select all

garbagetype_cfg = {
-- Add any missing records below this line
   ["pmd"]                              ={hour=19,min=22,daysbefore=1,reminder=1,text="pmd"},
   ["gft"]                              ={hour=19,min=22,daysbefore=1,reminder=1,text="gft"},
   ["papier"]                           ={hour=19,min=22,daysbefore=1,reminder=1,text="papier"},
   ["biobak1"]                          ={hour=19,min=22,daysbefore=1,reminder=1,text="Groene Container"},
   ["sortibak0"]                        ={hour=19,min=22,daysbefore=1,reminder=1,text="Grijze Container"},
   ["oud papier en karton3"]            ={hour=19,min=22,daysbefore=1,reminder=1,text="Papiercontainer"},
   ["grofvuil (3 keer gratis)5"]        ={hour=19,min=22,daysbefore=1,reminder=1,text="Grofvuil"},
   ["chemisch afval4"]                  ={hour=19,min=22,daysbefore=1,reminder=1,text="KCA"},
Weird thing is, the log files seem to get overwritten continuously ? (see timestamps in file)

This is the entire garbagecalendar_run_m_omrin.log

Code: Select all

@GarbageCal(m_omrin): #### Fri Oct  9 16:20:00 2020 ### Start garbagecalendar script v20200906-1400
@GarbageCal(m_omrin): #### Debuging dataload each cycle in the foreground because "testdataload=true" in garbagecalendarconfig.lua
@GarbageCal(m_omrin): ####    please change it back to "testdataload=false" when done testing to avoid growing a big domoticz log and slowing down the event system.
@GarbageCal(m_omrin): #### Debuging with extra messages because "mydebug=true" in garbagecalendarconfig.lua
@GarbageCal(m_omrin): ####    please change it back to "mydebug=false" when done testing to avoid growing a big domoticz log.
@GarbageCal(m_omrin): domoticzjsonpath: /home/pi/domoticz/scripts/lua/
@GarbageCal(m_omrin): datafilepath: /var/tmp/
@GarbageCal(m_omrin): scriptpath: /home/pi/domoticz/scripts/lua/
@GarbageCal(m_omrin): Loaded /home/pi/domoticz/scripts/lua/garbagecalendar/garbagecalendarconfig.lua.
@GarbageCal(m_omrin): Loaded /home/pi/domoticz/scripts/lua/garbagecalendar/generalfuncs.lua.
@GarbageCal(m_omrin): 16:20:00 start new foreground webupdate for module m_omrin of file /var/tmp/garbagecalendar_m_omrin.data
@GarbageCal(m_omrin_api): 16:20:00 webupdate done.
@GarbageCal(m_omrin_api): Start checking garbagetype_cfg table:
@GarbageCal(m_omrin_api): -> NotificationTime=19:22  Garbagetype=gft
@GarbageCal(m_omrin_api): -> NotificationTime=19:22  Garbagetype=chemisch afval4
@GarbageCal(m_omrin_api): -> NotificationTime=19:22  Garbagetype=sortibak0
@GarbageCal(m_omrin_api): -> NotificationTime=02:30  Garbagetype=reloaddata
@GarbageCal(m_omrin_api): -> NotificationTime=19:22  Garbagetype=papier
@GarbageCal(m_omrin_api): -> NotificationTime=19:22  Garbagetype=biobak1
@GarbageCal(m_omrin_api): -> NotificationTime=19:22  Garbagetype=pmd
@GarbageCal(m_omrin_api): -> NotificationTime=19:22  Garbagetype=oud papier en karton3
@GarbageCal(m_omrin_api): -> NotificationTime=02:31  Garbagetype=dummy1
@GarbageCal(m_omrin_api): -> NotificationTime=19:22  Garbagetype=grofvuil (3 keer gratis)5
@GarbageCal(m_omrin_api): Start update for text device:
@GarbageCal(m_omrin_api): - Start looping through data from the website to find the first 4 event to show: /var/tmp/garbagecalendar_m_omrin.data
==> GarbageDate:2020-10-9 GarbageType:sortibak0;  Notify: Active=on  Time=19:22   DaysBefore=1   reminder=1   Calc Days Diff=0
==> GarbageDate:2020-10-15 GarbageType:oud papier en karton3;  Notify: Active=on  Time=19:22   DaysBefore=1   reminder=1   Calc Days Diff=6
==> GarbageDate:2020-10-16 GarbageType:chemisch afval4;  Notify: Active=on  Time=19:22   DaysBefore=1   reminder=1   Calc Days Diff=7
==> GarbageDate:2020-10-16 GarbageType:biobak1;  Notify: Active=on  Time=19:22   DaysBefore=1   reminder=1   Calc Days Diff=7
@GarbageCal(m_omrin_api): - End  -----------------
@GarbageCal(m_omrin_api): ==> found schedule:Grijze Container: Vr 9 Okt ; Papiercontainer: Do 15 Okt ; KCA: Vr 16 Okt ; Groene Container: Vr 16 Okt ;
@GarbageCal(m_omrin_api): Update device from:
Grijze Container: Vr 9 Okt
Papiercontainer: Do 15 Okt
Groene Container: Vr 16 Okt
KCA: Vr 16 Okt

 replace with:
Grijze Container: Vr 9 Okt
Papiercontainer: Do 15 Okt
KCA: Vr 16 Okt
Groene Container: Vr 16 Okt

@GarbageCal(m_omrin_api): #### 16:20:00 End garbagecalendar script v20200919-1600

Custodes Septentrionum
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 »

Yea as in you did define, but not Yea as in you should have receive a message. ;)
These lines tell you why:
#### Fri Oct 9 16:20:00 2020 ### Start garbagecalendar script v20200906-1400
--snip--
==> GarbageDate:2020-10-9 GarbageType:sortibak0; Notify: Active=on Time=19:22 DaysBefore=1 reminder=1 Calc Days Diff=0
==> GarbageDate:2020-10-15 GarbageType:oud papier en karton3; Notify: Active=on Time=19:22 DaysBefore=1 reminder=1 Calc Days Diff=6
==> GarbageDate:2020-10-16 GarbageType:chemisch afval4; Notify: Active=on Time=19:22 DaysBefore=1 reminder=1 Calc Days Diff=7
==> GarbageDate:2020-10-16 GarbageType:biobak1; Notify: Active=on Time=19:22 DaysBefore=1 reminder=1 Calc Days Diff=7
This script ran at 16:20 and the notification times are set at 19:22 on 1 day before.
When you want to test this, just change the settings temporarily in de ConFIg so it should send a notification and then check the log when it did't work.

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: Friday 09 October 2020 16:32 Yea as in you did define, but not Yea as in you should have receive a message. ;)
These lines tell you why:
#### Fri Oct 9 16:20:00 2020 ### Start garbagecalendar script v20200906-1400
--snip--
==> GarbageDate:2020-10-9 GarbageType:sortibak0; Notify: Active=on Time=19:22 DaysBefore=1 reminder=1 Calc Days Diff=0
==> GarbageDate:2020-10-15 GarbageType:oud papier en karton3; Notify: Active=on Time=19:22 DaysBefore=1 reminder=1 Calc Days Diff=6
==> GarbageDate:2020-10-16 GarbageType:chemisch afval4; Notify: Active=on Time=19:22 DaysBefore=1 reminder=1 Calc Days Diff=7
==> GarbageDate:2020-10-16 GarbageType:biobak1; Notify: Active=on Time=19:22 DaysBefore=1 reminder=1 Calc Days Diff=7
This script ran at 16:20 and the notification times are set at 19:22 on 1 day before.
Jos
If I understand this correctly (and I may not, it's been known to happen :mrgreen: ) it should have sent me a notification last night? Cause it hasn't :?
Custodes Septentrionum
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 »

btw, problem with checking the logs right after when it should've sent a notification, is that the logfiles seem to update every minute (and overwrite the old entries)
Custodes Septentrionum
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 I know, but didn't want to make a always growing logfile, so simply set the setting in the config so that it should trigger the notification a minute away... save the file .... wait for the actual run ... open the run log file and check what it did.
Also check the domoticz log as all it really does is one of these:

Code: Select all

commandArray[x] = {['SendEmail'] = inotificationtitle .. '#' .. inotificationtext .. '#' .. emailaddress}
commandArray['SendNotification']=inotificationtitle .. '#' .. inotificationtext .. '####'..Notificationsystem
So in de domoticz.log you should see the result of the processing of these commands.

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 »

Oh,... I actually did add an undocumented notification test option to the script a while ago you could try to add to the config too:

Code: Select all

testnotification = true  -- (true/false) -- this will trigger a test notification for the first record for testing
You could try this, but this will trigger the notification with each 1 minute loop. :)

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 »

Rolandet wrote: Friday 09 October 2020 16:39 btw, problem with checking the logs right after when it should've sent a notification, is that the logfiles seem to update every minute (and overwrite the old entries)
By the way: this statement is not totally valid as there are 2 run logs generated:
garbagecalendar_run_m_module.log -> Each minute log
garbagecalendar_run_update_m_module.log -> Last update run log, which is at one of the times defined in the config table

This obviously is only valid when you have a debugging options disabled, which should always be the case when not debugging!
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: Friday 09 October 2020 16:49 Yes I know, but didn't want to make a always growing logfile, so simply set the setting in the config so that it should trigger the notification a minute away... save the file .... wait for the actual run ... open the run log file and check what it did.
Also check the domoticz log as all it really does is one of these:

Code: Select all

commandArray[x] = {['SendEmail'] = inotificationtitle .. '#' .. inotificationtext .. '#' .. emailaddress}
commandArray['SendNotification']=inotificationtitle .. '#' .. inotificationtext .. '####'..Notificationsystem
So in de domoticz.log you should see the result of the processing of these commands.

Jos
Allrighty, we have some progress

The run_log showed:

Code: Select all

@GarbageCal(m_omrin_api): ---->Notification Email send for biobak1 |GarbageCalendar: over 7 dagen de Groene Container aan de weg zetten!#Groene Container wordt over 7 dagen opgehaald! ()|
No entries in domoticz log though (looked for the lines/keywords you suggested)
Also, no email received :cry:
Last edited by Rolandet on Sunday 10 January 2021 23:05, edited 1 time in total.
Custodes Septentrionum
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 »

Do you have the EMail notification settings in Domoticz defined in the EMAIL tab and it is working successfully?

edit:
No entries in domoticz log though (looked for the lines/keywords you suggested)
It should just show up in the Web interface LOG window without searching as it happens now. ;)
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: Friday 09 October 2020 17:03 Do you have the EMail notification settings in Domoticz defined in the EMAIL tab and it is working successfully?

edit:
No entries in domoticz log though (looked for the lines/keywords you suggested)
It should just show up in the Web interface LOG window without searching as it happens now. ;)
and there we go..........my email settings were NOT correct.

Thanks for debugging m8, it works ! :D
Custodes Septentrionum
User avatar
Xenomes
Posts: 379
Joined: Tuesday 27 November 2018 19:05
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by Xenomes »

jvdz wrote: Tuesday 06 October 2020 16:25 I see a couple of strange things in the log that I don't understand, so could you Email me the following files in a zip file, so I can have a closer look? :
  • Garbagecalendarconfig.lua
  • Your input datafile with the csv dates as defined in the config.
  • /var/tmp/garbagecalendar_m_csv_file.data
  • /var/tmp/garbage_run_m_csv_file.log
  • /var/tmp/garbage_run_update_m_csv_file.log
  • /var/tmp/garbage_web_m_csv_file.log
.. but it feels like something is going in the nightly run. This info is located in the garbage_web_m_csv_file.log.

Thanks, Jos
I found the problem, was a human error. i used plastic instead of gmd :oops:
HP T630 (32GB SSD/8GB Mem) - Ubuntu 22.04.4 LTS (64Bit) - Domoticz 2024.7 with Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
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 »

Xenomes wrote: Saturday 10 October 2020 8:59 I found the problem, was a human error. i used plastic instead of gmd :oops:
Great you found the issue, but I would still have expected some data to be shown in your posted log when it was just a GarbageType name being wrong.

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

Saw there is a new version and want to test is but it is missing my garbage collector :o

Can you also make it work for: inzamelkalender.stadswerk072.nl

Zipcode: 1486 MK
Number: 88
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 »

Should work fine with these settings: ;)

Code: Select all

wmodule=m_opzet_api
Hostname=inzamelkalender.stadswerk072.nl
Zipcode=1486MK
Housenr=88

Code: Select all

Schedule: gft & etensresten: maa 19 okt ; plastic, blik & drinkpakken: vri 23 okt ; restafval.: maa 26 okt ; 
Done...
Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests