GarbageCalendar (new version) lua scripts

Moderator: leecollings

Post Reply
User avatar
Thuis
Posts: 273
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 »

I am sorry, it was late for me.

I will try to explain.

- The old data file when it would not refresh anything had all the rights 777 and the user and group onshuis. I must have chaged it to 777 some how in the past to get it to work, i can not remember,

- Then i changed the data file to data.old (to see if a new data file would be created, and it did.)
- I put the debug to true and it generated the new garbagecalendar_m_goeree-overflakkee.data file. This file is 644 with same user and group onshuis.
- I will now let it sit on 644 to see if the data will refresh in a few days.

In the logs, when the data.old file was still the data file, i could not see that it would get new dates, as you has showd me in previous post:
==> found schedule:restafval: maa 6 apr ; groente-, fruit- en tuinafval: zat 11 apr ; papier en karton: zat 18 apr ;

After changing the data to data.old and when the new data file was created i could see the new dates in the log, as you showed me in the previous post.

Well i do not understand either why the rights would have to do anything with it, 777 should always work? As it has all the rights. So there for maybe something else is different.

So the only thing to do is wait for a few days to see if it generates the new date in the log and the data file i think ?
I Love Domoticz ! And the community around it :-)
User avatar
jvdz
Posts: 2330
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 did understood you (I think)!
The reason I said "I don't understand" is that when a file has 777 rights, it would mean that everybody can do everything to the file, so that doesn't explain why the batch-script didn't update it! ;)
Can you check the Domoticz logs to see if you have an extra log entry like the first line in the second codeblock, this at the time the batchupdate is scheduled with this entry in your config:

Code: Select all

-- Add any missing records above this line
   ["reloaddata"]    ={hour=02,min=30,daysbefore=0,reminder=0,text="trigger for reloading data from website into a file"},

Code: Select all

2020-04-01 02:30:00.072  LUA: @GarbageCal(m_westland): lua /home/pi/domoticz/scripts/lua/garbagecalendar/m_westland.lua "/home/pi/domoticz/scripts/lua/" "1234xx" "99" "" "/var/tmp/garbagecalendar_m_westland.data" "/var/tmp/garbagecalendar_web_m_westland.log" "" ""
2020-04-01 02:30:00.074  LUA: @GarbageCal(m_westland): Start update for text device:
2020-04-01 02:30:00.080  LUA: @GarbageCal(m_westland): ==> found schedule:Groene bak: vri 3 apr ; Grijze bak: vri 10 apr ; Blauwe bak: din 28 apr ; 
No need to wait for a few days as it should be updated each day at that time in the config!!

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

I see this in the config file±
Spoiler: show
6 -- The "reloaddata" entry is required to run the background process to upda$
87 -- The "dummy" entry can be used to force reading the data, update the Domo$
88
89 garbagetype_cfg = {
90 ["Groente-, fruit- en tuinafval"] ={hour=19,min=0,daysbefore=1,remind$
91 ["Papier en karton"] ={hour=19,min=0,daysbefore=1,remind$
92 ["Restafval"] ={hour=19,min=0,daysbefore=1,remind$
93 -- Add any missing records above this line
And this is in the domoticz log when setting the debug to true:
Spoiler: show
2020-04-01 16:15:00.532 Status: EventSystem: Script event triggered: /home/onshuis/Domotica/domoticz/dzVents/runtime/dzVents.lua
2020-04-01 16:15:00.573 Status: LUA: @GarbageCal(m_goeree-overflakkee): #### Wed Apr 1 16:15:00 2020 ### Start garbagecalendar script v20200317-1900
2020-04-01 16:15:00.574 Status: LUA: @GarbageCal(m_goeree-overflakkee): #### Debuging with extra messages because "mydebug=true" in garbagecalendarconfig.lua
2020-04-01 16:15:00.574 Status: LUA: @GarbageCal(m_goeree-overflakkee): #### please change it back to "mydebug=false" when done testing to avoid growing a big domoticz log.
2020-04-01 16:15:00.574 Status: LUA: @GarbageCal(m_goeree-overflakkee): domoticzjsonpath: /home/onshuis/Domotica/domoticz/scripts/lua/
2020-04-01 16:15:00.575 Status: LUA: @GarbageCal(m_goeree-overflakkee): datafilepath: /home/onshuis/Domotica/domoticz/scripts/lua/garbagecalendar/temp/
2020-04-01 16:15:00.575 Status: LUA: @GarbageCal(m_goeree-overflakkee): scriptpath: /home/onshuis/Domotica/domoticz/scripts/lua/
2020-04-01 16:15:00.575 Status: LUA: @GarbageCal(m_goeree-overflakkee): Loaded /home/onshuis/Domotica/domoticz/scripts/lua/garbagecalendar/garbagecalendarconfig.lua.
2020-04-01 16:15:00.576 Status: LUA: @GarbageCal(m_goeree-overflakkee): Loaded /home/onshuis/Domotica/domoticz/scripts/lua/garbagecalendar/tablefuncs.lua.
2020-04-01 16:15:00.577 Status: LUA: @GarbageCal(m_goeree-overflakkee): Start checking garbagetype_cfg table:
2020-04-01 16:15:00.577 Status: LUA: @GarbageCal(m_goeree-overflakkee): Groente-, fruit- en tuinafval change to groente-, fruit- en tuinafval
2020-04-01 16:15:00.578 Status: LUA: @GarbageCal(m_goeree-overflakkee): Papier en karton change to papier en karton
2020-04-01 16:15:00.578 Status: LUA: @GarbageCal(m_goeree-overflakkee): Restafval change to restafval
2020-04-01 16:15:00.578 Status: LUA: @GarbageCal(m_goeree-overflakkee): -> NotificationTime:16:25 Garbagetype:dummy2
2020-04-01 16:15:00.578 Status: LUA: @GarbageCal(m_goeree-overflakkee): -> NotificationTime:19:0 Garbagetype:papier en karton
2020-04-01 16:15:00.579 Status: LUA: @GarbageCal(m_goeree-overflakkee): -> NotificationTime:19:0 Garbagetype:restafval
2020-04-01 16:15:00.579 Status: LUA: @GarbageCal(m_goeree-overflakkee): -> NotificationTime:19:0 Garbagetype:groente-, fruit- en tuinafval
2020-04-01 16:15:00.579 Status: LUA: @GarbageCal(m_goeree-overflakkee): -> NotificationTime:2:2 Garbagetype:dummy1
2020-04-01 16:15:00.579 Status: LUA: @GarbageCal(m_goeree-overflakkee): Start update for text device:
2020-04-01 16:15:00.581 Status: LUA: @GarbageCal(m_goeree-overflakkee): - Start looping through data from the website: /home/onshuis/Domotica/domoticz/scripts/lua/garbagecalendar/temp/garbagecalendar_m_goeree-overflakkee.data
2020-04-01 16:15:00.582 Status: LUA: ==> GarbageDate:2020-4-6 GarbageType:restafval Notify Time=19:0 Notify_DaysBefore=1 reminder=2 Calculated_Days_Differerence=5
2020-04-01 16:15:00.582 Status: LUA: ==> GarbageDate:2020-4-11 GarbageType:groente-, fruit- en tuinafval Notify Time=19:0 Notify_DaysBefore=1 reminder=2 Calculated_Days_Differerence=10
2020-04-01 16:15:00.583 Status: LUA: ==> GarbageDate:2020-4-18 GarbageType:papier en karton Notify Time=19:0 Notify_DaysBefore=1 reminder=2 Calculated_Days_Differerence=17
2020-04-01 16:15:00.585 Status: LUA: @GarbageCal(m_goeree-overflakkee): - End -----------------
2020-04-01 16:15:00.585 Status: LUA: @GarbageCal(m_goeree-overflakkee): ==> found schedule:ma 6 apr: Groene bak, Restafval ; za 11 apr: Bruine bak, GFT afval ; za 18 apr: Blauwe bak, Papier en Karton ;
2020-04-01 16:15:00.585 Status: LUA: @GarbageCal(m_goeree-overflakkee): No updated text for TxtDevice.
2020-04-01 16:15:00.587 Status: LUA: @GarbageCal(m_goeree-overflakkee): #### 16:15:00 End garbagecalendar script v20200317-1900
2020-04-01 16:15:00.597 Status: EventSystem: Script event triggered: /home/onshuis/Domotica/domoticz/scripts/lua/script_time_garbagecalendar.lua
I do not know what you mean with the extra log entry. I search for:
LUA: @GarbageCal(m_westland): lua /home/pi/domoticz/scripts/lua/garbagecalendar/m_westland.lua "/home/pi/domoticz/scripts/lua/" "1234xx" "99" "" "/var/tmp/garbagecalendar_m_westland.data" "/var/tmp/garbagecalendar_web_m_westland.log" "" ""

but with my own parameters, like goeree-overflakkee and so on, but i do not see it in the log. What am i doing wrong ?

Aha i see 5 hours ago you changed the table_funcs.lua file, so i misread, now i have downloaded the new file and will try again .... wait here it comes .
I Love Domoticz ! And the community around it :-)
User avatar
Thuis
Posts: 273
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 »

It seems to be the same, i downloaded the new file table_funcs.lua into the correct directory and restarted domoticz, but i do not see anything like LUA: @GarbageCal(m_goeree-overflakkee): lua /home/onshuis/ enzovoorts.....
Spoiler: show
2020-04-01 16:24:00.184 Status: EventSystem: Script event triggered: /home/onshuis/Domotica/domoticz/dzVents/runtime/dzVents.lua
2020-04-01 16:24:00.224 Status: LUA: @GarbageCal(m_goeree-overflakkee): #### Wed Apr 1 16:24:00 2020 ### Start garbagecalendar script v20200317-1900
2020-04-01 16:24:00.224 Status: LUA: @GarbageCal(m_goeree-overflakkee): #### Debuging with extra messages because "mydebug=true" in garbagecalendarconfig.lua
2020-04-01 16:24:00.224 Status: LUA: @GarbageCal(m_goeree-overflakkee): #### please change it back to "mydebug=false" when done testing to avoid growing a big domoticz log.
2020-04-01 16:24:00.225 Status: LUA: @GarbageCal(m_goeree-overflakkee): domoticzjsonpath: /home/onshuis/Domotica/domoticz/scripts/lua/
2020-04-01 16:24:00.225 Status: LUA: @GarbageCal(m_goeree-overflakkee): datafilepath: /home/onshuis/Domotica/domoticz/scripts/lua/garbagecalendar/temp/
2020-04-01 16:24:00.225 Status: LUA: @GarbageCal(m_goeree-overflakkee): scriptpath: /home/onshuis/Domotica/domoticz/scripts/lua/
2020-04-01 16:24:00.225 Status: LUA: @GarbageCal(m_goeree-overflakkee): Loaded /home/onshuis/Domotica/domoticz/scripts/lua/garbagecalendar/garbagecalendarconfig.lua.
2020-04-01 16:24:00.227 Status: LUA: @GarbageCal(m_goeree-overflakkee): Loaded /home/onshuis/Domotica/domoticz/scripts/lua/garbagecalendar/tablefuncs.lua.
2020-04-01 16:24:00.228 Status: LUA: @GarbageCal(m_goeree-overflakkee): Start checking garbagetype_cfg table:
2020-04-01 16:24:00.228 Status: LUA: @GarbageCal(m_goeree-overflakkee): Restafval change to restafval
2020-04-01 16:24:00.228 Status: LUA: @GarbageCal(m_goeree-overflakkee): Groente-, fruit- en tuinafval change to groente-, fruit- en tuinafval
2020-04-01 16:24:00.229 Status: LUA: @GarbageCal(m_goeree-overflakkee): Papier en karton change to papier en karton
2020-04-01 16:24:00.229 Status: LUA: @GarbageCal(m_goeree-overflakkee): -> NotificationTime:2:2 Garbagetype:dummy1
2020-04-01 16:24:00.229 Status: LUA: @GarbageCal(m_goeree-overflakkee): -> NotificationTime:16:25 Garbagetype:dummy2
2020-04-01 16:24:00.230 Status: LUA: @GarbageCal(m_goeree-overflakkee): -> NotificationTime:19:0 Garbagetype:papier en karton
2020-04-01 16:24:00.230 Status: LUA: @GarbageCal(m_goeree-overflakkee): -> NotificationTime:19:0 Garbagetype:groente-, fruit- en tuinafval
2020-04-01 16:24:00.230 Status: LUA: @GarbageCal(m_goeree-overflakkee): -> NotificationTime:19:0 Garbagetype:restafval
2020-04-01 16:24:00.230 Status: LUA: @GarbageCal(m_goeree-overflakkee): Start update for text device:
2020-04-01 16:24:00.232 Status: LUA: @GarbageCal(m_goeree-overflakkee): - Start looping through data from the website: /home/onshuis/Domotica/domoticz/scripts/lua/garbagecalendar/temp/garbagecalendar_m_goeree-overflakkee.data
2020-04-01 16:24:00.236 Status: LUA: ==> GarbageDate:2020-4-6 GarbageType:restafval Notify Time=19:0 Notify_DaysBefore=1 reminder=2 Calculated_Days_Differerence=5
2020-04-01 16:24:00.237 Status: LUA: ==> GarbageDate:2020-4-11 GarbageType:groente-, fruit- en tuinafval Notify Time=19:0 Notify_DaysBefore=1 reminder=2 Calculated_Days_Differerence=10
2020-04-01 16:24:00.237 Status: LUA: ==> GarbageDate:2020-4-18 GarbageType:papier en karton Notify Time=19:0 Notify_DaysBefore=1 reminder=2 Calculated_Days_Differerence=17
2020-04-01 16:24:00.239 Status: LUA: @GarbageCal(m_goeree-overflakkee): - End -----------------
2020-04-01 16:24:00.239 Status: LUA: @GarbageCal(m_goeree-overflakkee): ==> found schedule:ma 6 apr: Groene bak, Restafval ; za 11 apr: Bruine bak, GFT afval ; za 18 apr: Blauwe bak, Papier en Karton ;
2020-04-01 16:24:00.240 Status: LUA: @GarbageCal(m_goeree-overflakkee): No updated text for TxtDevice.
2020-04-01 16:24:00.241 Status: LUA: @GarbageCal(m_goeree-overflakkee): #### 16:24:00 End garbagecalendar script v20200317-1900
2020-04-01 16:24:00.249 Status: EventSystem: Script event triggered: /home/onshuis/Domotica/domoticz/scripts/lua/script_time_garbagecalendar.lua
I Love Domoticz ! And the community around it :-)
User avatar
jvdz
Posts: 2330
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 start to believe you have removed a record from the original provided garbagecalendarconfig_model.lua:
garbagetype_cfg = {
-- Add any missing records below this line
["pmd"] ={hour=19,min=22,daysbefore=1,reminder=0,text="pmd"},
["gft"] ={hour=19,min=22,daysbefore=1,reminder=0,text="gft"},
["papier"] ={hour=19,min=22,daysbefore=1,reminder=0,text="papier"},
-- Add any missing records above this line
["reloaddata"] ={hour=02,min=30,daysbefore=0,reminder=0,text="trigger for reloading data from website into garbagecalendar.data"},
["dummy1"] ={hour=02,min=30,daysbefore=0,reminder=0,text="dummy to trigger testing"}}
... which really needs to be there to schedule the WebUpdate in the background as described in the WiKi:
-- The "reloaddata" entry is required to run the background process to update the data one time per day.
-- The "dummy" entry can be used to force reading the data, update the Domoticz text device and see if there are any errors or missing garbage types.
Could you check that please?
Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
User avatar
Thuis
Posts: 273
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 »

I downloaded the file with wget from github to the directory and it downloaded but i see it put a .1 behind it, so it is still the same. As of i am still the linux noob i need to correct it. I also do not understand why the new file is much bigger, so i must be doing something wrong. Also i am noob with github, days ago i thought i would do a git pull and it updated my whole domoticz to some version and now i get dzvents warnings about a math.pow that is depreciated in version 5.3 or something. But that is something else. I wil try to get the new table file function again and see if i can get it right this time, sorry for all the wasted time.
I Love Domoticz ! And the community around it :-)
User avatar
Thuis
Posts: 273
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 »

Yes i know it is just me, now i was in the thinking thaty if i would delete just a file in the directory:
onshuis@ubuntu-huis:~/Domotica/domoticz/scripts/lua/garbagecalendar$

and would do a git pull, then it would download the missing file, but it does not, it just says that it is up to date,
So i do wget https://github.com/jvanderzande/Garbage ... _funcs.lua
and there it is. But it is mega big in comparison to the old file look:


112 -rw-rw-r-- 1 onshuis onshuis 112674 Apr 1 16:41 table_funcs.lua
4 -rwxrwxrwx 1 onshuis onshuis 3676 Feb 24 10:39 table_funcs.lua.old

i will try to edit the old file and put this in i guess ?
["reloaddata"] ={hour=02,min=30,daysbefore=0,reminder=0,text="trigger for reloading data from website into garbagecalendar.data"},

oh man i got it all fragged up now ......
I Love Domoticz ! And the community around it :-)
User avatar
Thuis
Posts: 273
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 »

t least now this is in the log ... :

2020-04-01 16:48:00.260 Status: LUA: @GarbageCal(m_goeree-overflakkee): -> NotificationTime:2:30 Garbagetype:reloaddata
I Love Domoticz ! And the community around it :-)
User avatar
jvdz
Posts: 2330
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: Wednesday 01 April 2020 16:43 i will try to edit the old file and put this in i guess ?
["reloaddata"] ={hour=02,min=30,daysbefore=0,reminder=0,text="trigger for reloading data from website into garbagecalendar.data"},
That is indeed required when it isn't there!
Just look at the provided model config how it should look !
I will make another change to the mainscript to test for this as well to ensure you are informed whenever this record is missing. ;)

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
User avatar
jvdz
Posts: 2330
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: Wednesday 01 April 2020 16:43 So i do wget https://github.com/jvanderzande/Garbage ... _funcs.lua
and there it is. But it is mega big in comparison to the old file look:
112 -rw-rw-r-- 1 onshuis onshuis 112674 Apr 1 16:41 table_funcs.lua
4 -rwxrwxrwx 1 onshuis onshuis 3676 Feb 24 10:39 table_funcs.lua.old
No idea what you have done here but that file is "145 lines (131 sloc) 3.73 KB" according Github, so I guess you downloaded some HTML file in stead a raw text file.

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

I just deleted the whole thing. And then did a git clone, setup the config lua and now it seems toe be okay again.
Spoiler: show
2020-04-01 17:06:00.483 Status: EventSystem: Script event triggered: /home/onshuis/Domotica/domoticz/dzVents/runtime/dzVents.lua
2020-04-01 17:06:00.509 Status: LUA: @GarbageCal(m_goeree-overflakkee): #### Wed Apr 1 17:06:00 2020 ### Start garbagecalendar script v20200317-1900
2020-04-01 17:06:00.511 Status: LUA: @GarbageCal(m_goeree-overflakkee): #### Debuging with extra messages because "mydebug=true" in garbagecalendarconfig.lua
2020-04-01 17:06:00.512 Status: LUA: @GarbageCal(m_goeree-overflakkee): #### please change it back to "mydebug=false" when done testing to avoid growing a big domoticz log.
2020-04-01 17:06:00.514 Status: LUA: @GarbageCal(m_goeree-overflakkee): domoticzjsonpath: /home/onshuis/Domotica/domoticz/scripts/lua/
2020-04-01 17:06:00.515 Status: LUA: @GarbageCal(m_goeree-overflakkee): datafilepath: /home/onshuis/Domotica/domoticz/scripts/lua/garbagecalendar/temp/
2020-04-01 17:06:00.516 Status: LUA: @GarbageCal(m_goeree-overflakkee): scriptpath: /home/onshuis/Domotica/domoticz/scripts/lua/
2020-04-01 17:06:00.518 Status: LUA: @GarbageCal(m_goeree-overflakkee): Loaded /home/onshuis/Domotica/domoticz/scripts/lua/garbagecalendar/garbagecalendarconfig.lua.
2020-04-01 17:06:00.521 Status: LUA: @GarbageCal(m_goeree-overflakkee): Loaded /home/onshuis/Domotica/domoticz/scripts/lua/garbagecalendar/tablefuncs.lua.
2020-04-01 17:06:00.522 Status: LUA: @GarbageCal(m_goeree-overflakkee): Start checking garbagetype_cfg table:
2020-04-01 17:06:00.524 Status: LUA: @GarbageCal(m_goeree-overflakkee): -> NotificationTime:19:22 Garbagetype:gft
2020-04-01 17:06:00.525 Status: LUA: @GarbageCal(m_goeree-overflakkee): -> NotificationTime:2:30 Garbagetype:reloaddata
2020-04-01 17:06:00.527 Status: LUA: @GarbageCal(m_goeree-overflakkee): -> NotificationTime:2:30 Garbagetype:dummy1
2020-04-01 17:06:00.528 Status: LUA: @GarbageCal(m_goeree-overflakkee): -> NotificationTime:19:22 Garbagetype:pmd
2020-04-01 17:06:00.529 Status: LUA: @GarbageCal(m_goeree-overflakkee): -> NotificationTime:19:22 Garbagetype:papier
2020-04-01 17:06:00.531 Status: LUA: @GarbageCal(m_goeree-overflakkee): Start update for text device:
2020-04-01 17:06:00.533 Status: LUA: @GarbageCal(m_goeree-overflakkee): - Start looping through data from the website: /home/onshuis/Domotica/domoticz/scripts/lua/garbagecalendar/temp/garbagecalendar_m_goeree-overflakkee.data
2020-04-01 17:06:00.535 Status: LUA: ==> GarbageDate:2020-4-6 GarbageType:restafval Notify Time=0:0 Notify_DaysBefore=0 reminder=0 Calculated_Days_Differerence=5
2020-04-01 17:06:00.537 Status: LUA: ==> GarbageDate:2020-4-11 GarbageType:groente-, fruit- en tuinafval Notify Time=0:0 Notify_DaysBefore=0 reminder=0 Calculated_Days_Differerence=10
2020-04-01 17:06:00.538 Status: LUA: ==> GarbageDate:2020-4-18 GarbageType:papier en karton Notify Time=0:0 Notify_DaysBefore=0 reminder=0 Calculated_Days_Differerence=17
2020-04-01 17:06:00.540 Status: LUA: @GarbageCal(m_goeree-overflakkee): - End -----------------
2020-04-01 17:06:00.541 Status: LUA: @GarbageCal(m_goeree-overflakkee): #### Warning: These records are missing in your garbagecalendarconfig.lua file!
2020-04-01 17:06:00.543 Status: LUA: @GarbageCal(m_goeree-overflakkee): #### -- start -- Add these records into the garbagetype_cfg table and adapt the schedule and text info to your needs :
2020-04-01 17:06:00.544 Status: LUA: ["restafval"] ={hour=19,min=02,daysbefore=1,reminder=0,text="restafval"},
2020-04-01 17:06:00.544 ["groente-, fruit- en tuinafval"] ={hour=19,min=02,daysbefore=1,reminder=0,text="groente-, fruit- en tuinafval"},
2020-04-01 17:06:00.544 ["papier en karton"] ={hour=19,min=02,daysbefore=1,reminder=0,text="papier en karton"},
2020-04-01 17:06:00.544
2020-04-01 17:06:00.547 Status: LUA: @GarbageCal(m_goeree-overflakkee): #### -- end ----------------------------
2020-04-01 17:06:00.548 Status: LUA: @GarbageCal(m_goeree-overflakkee): ==> found schedule:restafval: maa 6 apr ; groente-, fruit- en tuinafval: zat 11 apr ; papier en karton: zat 18 apr ;
2020-04-01 17:06:00.549 Status: LUA: @GarbageCal(m_goeree-overflakkee): No updated text for TxtDevice.
2020-04-01 17:06:00.552 Status: LUA: @GarbageCal(m_goeree-overflakkee): #### 17:06:00 End garbagecalendar script v20200317-1900
2020-04-01 17:06:00.562 Status: EventSystem: Script event triggered: /home/onshuis/Domotica/domoticz/scripts/lua/script_time_garbagecalendar.lua
Now i will go and delete all my .old files, thanks for your time.
I Love Domoticz ! And the community around it :-)
User avatar
jvdz
Posts: 2330
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 »

Looking good now. I've also learned something as I could have simply seen the issue in the very first logfile you posted, but it is always harder to find an issue when something is missing! The latest mainscript will simply trigger an error each minute, which should be clear now.
Thuis wrote: Wednesday 01 April 2020 17:08 thanks for your time.
You're welcome :)
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
User avatar
jvdz
Posts: 2330
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 »

woempiej wrote: Monday 30 March 2020 19:26 I try to figure out how to read the data from source http://www.montferland.afvalwijzer.net/ with the eventsystem script_time.lua
Is there a way to copy the data in the script from afval westland?

I'm no professional in scripting sorry :roll:
For any other takers:
I've made a new module for "montferland" GarbageCalendar, currently being tested by @woepiej.
It will soon be available on GitHub, when all is working, but let me know in case others like to test it as well.

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
User avatar
Hesitated
Posts: 42
Joined: Monday 04 June 2018 21:40
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.11665
Location: Ede
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by Hesitated »

I've try to run the script

Code: Select all

sudo lua script_time_garbagecalendar.lua
My garbagecalendarconfig.lua

Code: Select all

myGarbageDevice = 'Container'      -- The Text devicename in Domoticz
ShowNextEvents = 3                 -- indicate the next x events to show in the TEXT Sensor in Domoticz
Zipcode = '6711KM'                 -- Your zipcode
Housenr = '71'                      -- Your housnr
Housenrsuf = ''                    -- Your housnr suffix                    (Optional: a/b/c  etc)
Street=''                          -- Street name                           Only needed for: m_ophaalkalender-be
Hostname = ''                      -- Specify the hostname of your website. Only needed for: m_opzet ; m_opzet_api ;
                                   -- OR Specify the companycode for the m_ximmio.lua module. See m_ximmio.lua on how to find this code.

-- choose one of these modules
websitemodule = "m_ximmio"

-- Switch on mydebug in case of issues and initially and check the domoticz log for any issues or missing
mydebug      = true  -- (true/false)
testdataload = true  -- (true/false)
See Attachments for full configuration and logfiles.

Am i doing something wrong?
Attachments
garbagecalendarconfig.lua.txt
(8.57 KiB) Downloaded 79 times
garbagecalendar_web_m_ximmio.log
(1.3 KiB) Downloaded 49 times
garbagecalendar_run_m_ximmio.log
(4.65 KiB) Downloaded 40 times
Domoticz 2020.2 - RPi3B+ - RFXtrx433XL - P1 - CC2531 - Somfy - Xiaomi - Hue - Omron - MQTT
User avatar
jvdz
Posts: 2330
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 »

ximmio is a bit of a special and guess you missed this comment for m_ximmio in the config:
Hostname = '' -- Specify the hostname of your website. Only needed for: m_opzet ; m_opzet_api ;
-- OR Specify the companycode for the m_ximmio.lua module. See m_ximmio.lua on how to find this code.
This refers to this comment in m_ximmio.au3:
-- API WebSite: https://wasteapi.2go-mobile.com/api
--
--- Find your companycode by:
-- 1. goto your webpage calendar and display the garbage calendar
-- 2. go into Developer mode for your browser
-- 3. find source file controller.js
-- 4. find this section and copy the value for companyCode:
-- $api('GetConfigOption', {
-- companyCode: '53d8db94-7945-42fd-9742-9bbc71dbe4c1',
-- configName: 'ALL'
-- })

I would be happy to change this when anybody has any idea how to obtain this in a more generic way by script! suggestions or pullrequests are always welcome. :)

All clear?
Jos

EDIT:I will update m_ximmio.au3 with a check and better error message in case the companycode isn't provided.
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
User avatar
Hesitated
Posts: 42
Joined: Monday 04 June 2018 21:40
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.11665
Location: Ede
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by Hesitated »

jvdz wrote: Saturday 04 April 2020 19:02 ximmio is a bit of a special and guess you missed this comment for m_ximmio in the config:
Hostname = '' -- Specify the hostname of your website. Only needed for: m_opzet ; m_opzet_api ;
-- OR Specify the companycode for the m_ximmio.lua module. See m_ximmio.lua on how to find this code.
Of course I missed that... :oops:
jvdz wrote: Saturday 04 April 2020 19:02 This refers to this comment in m_ximmio.au3:
-- 4. find this section and copy the value for companyCode:
-- $api('GetConfigOption', {
-- companyCode: '53d8db94-7945-42fd-9742-9bbc71dbe4c1',
-- configName: 'ALL'

I think ximmio has changed that:

Code: Select all

Referer: https://acv-groep.ximmio.com/modules/f8e2844a-095e-48f9-9f98-71fceb51d2c3/sitekalender/calendar.html?297193&van%20Heutszlaan---71%20%20%20---6711KM---EDE%20GLD---EDE
I've used the guid f8e2844a-095e-48f9-9f98-71fceb51d2c3 from that url and it worked.
jvdz wrote: Saturday 04 April 2020 19:02 All clear?
Jos
Yep, thnxs!
Domoticz 2020.2 - RPi3B+ - RFXtrx433XL - P1 - CC2531 - Somfy - Xiaomi - Hue - Omron - MQTT
User avatar
jvdz
Posts: 2330
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 »

Hesitated wrote: Saturday 04 April 2020 21:09 I think ximmio has changed that:

Code: Select all

Referer: https://acv-groep.ximmio.com/modules/f8e2844a-095e-48f9-9f98-71fceb51d2c3/sitekalender/calendar.html?297193&van%20Heutszlaan---71%20%20%20---6711KM---EDE%20GLD---EDE
I've used the guid f8e2844a-095e-48f9-9f98-71fceb51d2c3 from that url and it worked.
Not really... in your case for EDE it is also visual in the index file, but you will find there is also a controller.js file that has on line 116:

Code: Select all

   $api('GetConfigOption', {
      companyCode: 'f8e2844a-095e-48f9-9f98-71fceb51d2c3',
      configName: 'ALL'
    })
The other case I have seen for XIMMIO, ALmere, there was no index file like yours and they had a link on their main site directly to:
https://afvalportaal.2go-mobile.com/mod ... /kalender/
So it is a little hard to make a description that will work for everybody with sites like these. ;)


... but nice things are working now for you. 8-)

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

I get an error when I use 'm_opaalkalender'

Code: Select all

myGarbageDevice = 'Container'      -- The Text devicename in Domoticz
ShowNextEvents = 3                 -- indicate the next x events to show in the TEXT Sensor in Domoticz
Zipcode = '9000'                       -- Your zipcode
Housenr = '59'                       -- Your housnr
Housenrsuf = 'm_ophaalkalender'                    -- Your housnr suffix                    (Optional: a/b/c  etc)
Street='De Pintelaan'                          -- Street name                           Only needed for: m_ophaalkalender-be
Hostname = ''                      -- Specify the hostname of your website. Only needed for: m_opzet ; m_opzet_api ;
                                   -- OR Specify the companycode for the m_ximmio.lua module. See m_ximmio.lua on how to find this code.
2020-04-05 15:50:00.208 Status: LUA: @OphaalKalender:Loaded JSON.lua.
2020-04-05 15:50:00.208 Status: LUA: OphaalKalender module start check
2020-04-05 15:50:00.208 Status: LUA: @OphaalKalender:afvaltype_cfg :dummy1;2;2
2020-04-05 15:50:00.208 Status: LUA: @OphaalKalender:afvaltype_cfg :GFT;19;22
2020-04-05 15:50:00.208 Status: LUA: @OphaalKalender:afvaltype_cfg :PMD;19;22
2020-04-05 15:50:00.209 Status: LUA: @OphaalKalender:afvaltype_cfg :Restafval;19;22
2020-04-05 15:50:00.209 Status: LUA: @OphaalKalender:afvaltype_cfg :Glas;19;22
2020-04-05 15:50:00.209 Status: LUA: @OphaalKalender:afvaltype_cfg :Kerstboom;19;22
2020-04-05 15:50:00.209 Status: LUA: @OphaalKalender:afvaltype_cfg :dummy2;16;25
2020-04-05 15:50:00.209 Status: LUA: @OphaalKalender:afvaltype_cfg :Snoeiafval;19;22
2020-04-05 15:50:00.209 Status: LUA: @OphaalKalender:afvaltype_cfg :P-K;19;22
2020-04-05 15:50:00.209 Status: LUA: OphaalKalender module start update (v20200121-1630)
2020-04-05 15:50:00.209 Status: LUA: @OphaalKalender:=== web update ================================
2020-04-05 15:50:00.209 Status: LUA: @OphaalKalender:sQuery=curl "https://www.ophaalkalender.be/Calendar/ ... /?query=De Pintelaan&zipcode=9000" 2>nul
2020-04-05 15:50:00.358 Status: LUA: @OphaalKalender:adressid:
2020-04-05 15:50:00.358 Error: LUA: @OphaalKalender Error: Empty result from curl command
2020-04-05 15:50:00.358 Error: EventSystem: in /home/pi/domoticz/scripts/lua/script_time_huisvuil-ophaalkalender-be.lua: ...z/scripts/lua/script_time_huisvuil-ophaalkalender-be.lua:252: attempt to index a nil value (global 'adressdata')
When I go to
https://www.ophaalkalender.be/Calendar/ ... /?query=De Pintelaan&zipcode=9000" 2>nul
I get next
[{"Value":"De Pintelaan","Id":34152,"Brussels":false}]
BarryT
Posts: 369
Joined: Tuesday 31 March 2015 22:06
Target OS: Linux
Domoticz version: 2024.3
Location: east netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by BarryT »

I think you have to use the ical url:
https://www.ophaalkalender.be/Calendar/ ... pcode=9000
User avatar
jvdz
Posts: 2330
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 wrote: Sunday 05 April 2020 15:59 I get an error when I use 'm_opaalkalender'
I do not get the error when I test with your information and module "m_ophaalkalender-be"!
Is that also what you are using as you state a different modulename?
Please provide the 3 GarbageCalender logfiles to me in a ZIP file so I can have a look why it doesn't work for you.
just send them to my GitHub Email address.

PS: Why is this line there:
Housenrsuf = 'm_ophaalkalender'
BarryT wrote: Sunday 05 April 2020 16:09 I think you have to use the ical url:
Nah ... he is using the provide scripts. ;)

Jos
Last edited by jvdz on Sunday 05 April 2020 16:54, edited 2 times in total.
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest