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 »

Thuis wrote: Wednesday 10 February 2021 13:06 Ojee ik zie dat goeree overflakkee nu weer, sinds 1 januari 2021, een andere afval kalender gebruikt van RAD.
Ik ben benieuwd hoelang webadapter.watsoftware.nl nog werkt.
Geen idee of deze ook gebruikt wordt bij de nieuwe afval kalender. (wasteprod2portal.ximmio.com)

https://wasteprod2portal.ximmio.com/mod ... verflakkee

Hij krijgt nog wel nieuwe data binnen zol ijkt het.
@jvdz kun je me vertellen of dit iets uitmaakt of zou het gewoon blijven werken. Mij viel wel op dat de bakken maandag volgens webadapter wel werden opgehaald en op RAD stond dinsdag en woensdag. De laatste klopte met de werkelijkheid in vermelding met de sneeuw.
I will answer in English as this is an English forum. :)
I see that the link you provided is one for ximmio, so that module should work when you use that m_ximmio module.... but:
when I tried it wasn't working and several other zipcodes I have in my testrun weren't working anymore. While researching I found out that some are using a different API hostname so I tested with that and found your address works and the ones that failed in in test process also worked with that host.... but sadly the working ones on the original hostname didn't work anymore. So I decided to simply try the second hostname when the first one fails and now they all work including yours.
m_goeree-overflakkee: papier en karton: din 16 feb ; restafval: maa 22 feb ; groente-, fruit- en tuinafval: maa 1 maa ;
m_ximmio: grey: woe 10 feb ; paper: din 16 feb ; green: maa 1 maa ;

Please try this development version of ximmio and let me know whether that works. This also count for those currently seeing issues with the ximmio module as it could be they are moved to that new hostname too.

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

Yes yes i know, i put it in dutch, but 5 minutes later i changed it to english ... i thought. I did not know what happened or why i put it in dutch.

I just put the ximmio script changed it to goeree and ran the script. It looks like it is working it found this:
found schedule: De blauwe bak: di 16 feb ; De groene bak: ma 22 feb ; De bruine bak: ma 1 maa ; De groene bak: ma 8 maa ;

Do you need any specific info from the script, i can only see it is doing its thing without any errors. Thanks for changing it :-)
I Love Domoticz ! And the community around it :-)
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 »

i changed ximmio to goeree because i got this:
his device don't support action

2021-02-11 12:54:00.238 Error: LUA: @GarbageCal(m_goeree-overflakkee): !!! Error: module not found: /home/onshuis/Domotica/domoticz/scripts/lua/garbagecalendar/m_goeree-overflakkee.lua
2021-02-11 12:54:00.238 Error: LUA: @GarbageCal(m_goeree-overflakkee): !!! Error: Please check the path&name in variables "scriptpath=" "websitemodule= " in your "garbagecalenderconfig.lua" setup and try again.

so i thought is i change m_ximmio to m_goeree_overflakkee, then it works. Ofcourse i renamed the original m_goeree_overflakke
I Love Domoticz ! And the community around it :-)
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 »

Ah i had to look further then my nose is long, i just change the website modulename from goeree to ximmio and the script name back to ximmio.
haha i works though, both ways :-p
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 »

Thuis wrote: Thursday 11 February 2021 13:07 Ah i had to look further then my nose is long,
:lol: not sure that translates well for other that Dutch folks.

Good to hear things work. It could be I will do a re-write of the logic for ximmio later and make it based of the garbage company, but for now this works.
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
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 »

Ok i will be git pulling until i see an update :-p
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 »

Thuis wrote: Thursday 11 February 2021 14:25 Ok i will be git pulling until i see an update :-p
It is working at the moment ...right? so don't hold your breath but will publish the posted development changes into the master branch. :)
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
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 »

Yes yes for now it works perfectly,relaxed i'm just kidding.
Will see when it's updated. Thanks for all the hard work :-)
I Love Domoticz ! And the community around it :-)
Thelion
Posts: 54
Joined: Saturday 08 October 2016 12:15
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: The Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by Thelion »

Hi,

Since some time, my Garbagecalender doesn't collect any data and stayed with last data of february 25th.

Updated to the latest versions of the files from Github, changed the config file to suit my needs, but now the data is empty.

The file garbagecalendar_web_m_ximmio.log does show an error (I changed the postal code and housenumber):

Code: Select all

(m_ximmio): 15:09:00 ### Start -- foreground _runmodule.au3 for garbage module m_ximmio (v20201222-1200)
@m_ximmio: 15:09:00 #### Sun Mar  7 15:09:00 2021 ### Start garbagecalendar module m_ximmio (v20201217-1500)
@m_ximmio: 15:09:00 Loaded JSON.lua.
@m_ximmio: 15:09:00 !!! perform background update to /var/tmp/garbagecalendar_m_ximmio.data for Zipcode 1111XX - 11 companyCode:800bf8d7-6dd1-4490-ba9d-b419d6dc8a45
@m_ximmio: 15:09:00 ---- web update ----------------------------------------------------------------------------
@m_ximmio: 15:09:00 sQuery=curl -k --data "companyCode=800bf8d7-6dd1-4490-ba9d-b419d6dc8a45&postCode=1111XX&houseNumber=11&houseNumberAddition=" "https://wasteapi.2go-mobile.com/api/FetchAdress" 2>/var/tmp/garbagecalendar_web_err_m_ximmio.log
@m_ximmio: 15:09:00 ---- web data ----------------------------------------------------------------------------
@m_ximmio: 15:09:00 {"userMessage":{"type":null,"messageCode":0,"description":null},"ExtraOption":{"$type":"System.Dynamic.ExpandoObject, System.Core"},"dataList":null,"intDataList":null,"data":null,"status":false,"messageCode":164,"pdfResponse":null,"token":null,"ID":null,"invalidParameters":null,"total":0,"messageToString":null}
@m_ximmio: 15:09:00 ---- web err ------------------------------------------------------------------------
@m_ximmio: 15:09:00 Web_Err=  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   412  100   312  100   100   3284   1052 --:--:-- --:--:-- --:--:--  4336

@m_ximmio: 15:09:00 ---- end web data ------------------------------------------------------------------------
(m_ximmio): 15:09:00 !! Module m_ximmio had hard error. check log:/var/tmp/garbagecalendar_web_m_ximmio.log
/home/pi/domoticz/scripts/lua/garbagecalendar/m_ximmio.lua:87: attempt to index a nil value (field 'dataList')
stack traceback:
        ...e/pi/domoticz/scripts/lua/garbagecalendar/_runmodule.lua:10: in function 'errhandler'
        /home/pi/domoticz/scripts/lua/garbagecalendar/m_ximmio.lua:87: in function 'Perform_Update'
        /home/pi/domoticz/scripts/lua/garbagecalendar/m_ximmio.lua:157: in main chunk
        [C]: in function 'dofile'
        ...e/pi/domoticz/scripts/lua/garbagecalendar/_runmodule.lua:61: in function 'RunWebModule'
        [C]: in function 'xpcall'
        ...e/pi/domoticz/scripts/lua/garbagecalendar/_runmodule.lua:68: in main chunk
        [C]: in function 'dofile'
        .../pi/domoticz/scripts/lua/script_time_garbagecalendar.lua:185: in function 'GetWebDataInBackground'
        .../pi/domoticz/scripts/lua/script_time_garbagecalendar.lua:316: in function 'Perform_Data_check'
        .../pi/domoticz/scripts/lua/script_time_garbagecalendar.lua:603: in main chunk
(m_ximmio): 15:09:00 /var/tmp/garbagecalendar_web_m_ximmio.log
(m_ximmio): 15:09:00 
%%%%% LUA Hardcrash log %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
(m_ximmio): 15:09:00 nil
(m_ximmio): 15:09:00 stack traceback:
        ...e/pi/domoticz/scripts/lua/garbagecalendar/_runmodule.lua:76: in main chunk
        [C]: in function 'dofile'
        .../pi/domoticz/scripts/lua/script_time_garbagecalendar.lua:185: in function 'GetWebDataInBackground'
        .../pi/domoticz/scripts/lua/script_time_garbagecalendar.lua:316: in function 'Perform_Data_check'
        .../pi/domoticz/scripts/lua/script_time_garbagecalendar.lua:603: in main chunk
(m_ximmio): 15:09:00 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
(m_ximmio): 15:09:00 <-- ### End _runmodule.au3 for garbage module m_ximmio (v20201222-1200)
What can cause this?
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 assume you changed the zipcode/housenr to 1111XX - 11, so I will need an valid zipcode/housenumber/ company code when you want me to test to see what is happening. ;)
PM or Email is fine when you don't want to post it in the public forum.

Jos

EDIT: Or do I have it already and should it be : Schedule: paper: maa 8 maa ; packages: woe 10 maa ; green: woe 17 maa ;
EDIT2: There is a newer module available for module m_ximmio (v20210210-1540) in the development branch, which has a fix for a change in hostname for several garbage providers! https://github.com/jvanderzande/Garbage ... ximmio.lua , and I have just pushed that fix also to the master branch.
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
AllesVanZelf
Posts: 265
Joined: Monday 05 February 2018 8:42
Target OS: Raspberry Pi / ODroid
Domoticz version: 12467
Location: Netherlands, near Haarlem
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by AllesVanZelf »

Hi Jos,
I assume something had changed in Meerlanden using Ximmio. Since recently the device did not update anymore. It looks like something went wrong retrieving data from: https://wasteprod2api.ximmio.com
I have send you my config file and the log files. Could ou please have a look at it? Thanks a lot for all the good work here!
Domoticz 2020.1 (12230) on Raspberry Pi 3B with Raspian Buster. Besides Domoticz, Rpi is running Pi-Hole.
Thelion
Posts: 54
Joined: Saturday 08 October 2016 12:15
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: The Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by Thelion »

jvdz wrote: Sunday 07 March 2021 18:04
EDIT2: There is a newer module available for module m_ximmio (v20210210-1540) in the development branch, which has a fix for a change in hostname for several garbage providers! https://github.com/jvanderzande/Garbage ... ximmio.lua , and I have just pushed that fix also to the master branch.
The new m_ximmio.lua fixes the issue with Meerlanden.

Thanks!
AllesVanZelf
Posts: 265
Joined: Monday 05 February 2018 8:42
Target OS: Raspberry Pi / ODroid
Domoticz version: 12467
Location: Netherlands, near Haarlem
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by AllesVanZelf »

Strange... In my case it is not working. I pulled the latest version from github.
ls -l /tmp:

Code: Select all

-rw-r----- 1 root root       29 feb 23 17:56 garbagecalendar_m_ximmio.data
-rw-r----- 1 root root     1854 mrt  7 22:39 garbagecalendar_run_m_ximmio.log
-rw-r----- 1 root root     1777 mrt  7 22:39 garbagecalendar_run_update_m_ximmio.log
-rw-r----- 1 root root     1222 mrt  7 02:30 garbagecalendar_web_m_ximmio.log
And this is garbagecalendar_web_m_ximmio.log:

Code: Select all

(m_ximmio): 02:30:00 ### Start -- foreground _runmodule.au3 for garbage module m_ximmio (v20201222-1200)
(m_ximmio): 02:30:00 !! Module m_ximmio had hard error. check log:/tmp/garbagecalendar_web_m_ximmio.log
cannot open ./garbagecalendar/m_ximmio.lua: No such file or directory
stack traceback:
        .../domoticz/scripts/lua/garbagecalendar/_runmodule.lua:10: in function <.../domoticz/scripts/lua/garbagecalendar/_runmodule.lua:9>
        [C]: in function 'dofile'
        .../domoticz/scripts/lua/garbagecalendar/_runmodule.lua:61: in function <.../domoticz/scripts/lua/garbagecalendar/_runmodule.lua:29>
        [C]: in function 'xpcall'
        .../domoticz/scripts/lua/garbagecalendar/_runmodule.lua:68: in main chunk
        [C]: ?
(m_ximmio): 02:30:00 /tmp/garbagecalendar_web_m_ximmio.log
(m_ximmio): 02:30:00
%%%%% LUA Hardcrash log %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
(m_ximmio): 02:30:00 nil
(m_ximmio): 02:30:00 stack traceback:
        .../domoticz/scripts/lua/garbagecalendar/_runmodule.lua:76: in main chunk
        [C]: ?
(m_ximmio): 02:30:00 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
(m_ximmio): 02:30:00 <-- ### End _runmodule.au3 for garbage module m_ximmio (v20201222-1200)
This is strange: "cannot open ./garbagecalendar/m_ximmio.lua: No such file or directory"
Domoticz 2020.1 (12230) on Raspberry Pi 3B with Raspian Buster. Besides Domoticz, Rpi is running Pi-Hole.
Thelion
Posts: 54
Joined: Saturday 08 October 2016 12:15
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: The Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by Thelion »

AllesVanZelf wrote: Sunday 07 March 2021 22:42
This is strange: "cannot open ./garbagecalendar/m_ximmio.lua: No such file or directory"
Are the persmissions of m_ximmio.lua set to pi:pi ?
AllesVanZelf
Posts: 265
Joined: Monday 05 February 2018 8:42
Target OS: Raspberry Pi / ODroid
Domoticz version: 12467
Location: Netherlands, near Haarlem
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by AllesVanZelf »

I deleted the four files in /tmp and for some reason the garbagecalendar is working again. Not sure why.
Domoticz 2020.1 (12230) on Raspberry Pi 3B with Raspian Buster. Besides Domoticz, Rpi is running Pi-Hole.
Thelion
Posts: 54
Joined: Saturday 08 October 2016 12:15
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: The Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by Thelion »

AllesVanZelf wrote: Sunday 07 March 2021 23:04 I deleted the four files in /tmp and for some reason the garbagecalendar is working again. Not sure why.
Great! Have fun ;-)
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, it is I again, everything stopped working, so i removed the whole setup.
Then i did git clone the repository. Then i copied the files. Made the garbagecalendarconfig.lua to my needs.
now when i put it on testload and debug. In domoticz log it tells me an error i can not figure out.
Could you please help me with it ? The error is as follow:

domoticz/scripts/lua/script_time_garbagecalendar.lua: ...user/domoticz/scripts/lua/garbagecalendar/_runmodule.lua:75: attempt to index a nil value (global 'arg')

script_time_garbagecalendar.lua : MainScriptVersion = '20210313-1220'
_runmodule.lua: MainRunModVersion = '20210313-1220'

garbagecalendar_run_m_ximmio.log:
Spoiler: show
23:51:00 MainScript: ### Start garbagecalendar script v20210313-1220 Sat Mar 13 23:51:00 2021
23:51:00 MainScript: ---> Debuging dataload each cycle in the foreground because "testdataload=true" in garbagecalendarconfig.lua
23:51:00 MainScript: ---> please change it back to "testdataload=false" when done testing to avoid growing a big domoticz log and slowing down the event system.
23:51:00 MainScript: ---> Debuging with extra messages because "mydebug=true" in garbagecalendarconfig.lua
23:51:00 MainScript: ---> please change it back to "mydebug=false" when done testing to avoid growing a big domoticz log.
23:51:00 MainScript: domoticzjsonpath: /home/someuser/domoticz/scripts/lua/
23:51:00 MainScript: datafilepath: /home/someuser/domoticz/scripts/lua/garbagecalendar/tmp/
23:51:00 MainScript: scriptpath: /home/someuser/domoticz/scripts/lua/
23:51:00 MainScript: Loaded /home/someuser/domoticz/scripts/lua/garbagecalendar/garbagecalendarconfig.lua.
23:51:00 MainScript: Loaded /home/someuser/domoticz/scripts/lua/garbagecalendar/generalfuncs.lua (v20210313-1220)
23:51:00 MainScript: => Start new foreground WebUpdate for module m_ximmio
But it is not:
if arg[6] == nil and (MainScriptVersion or "??") ~= MainRunModVersion

i think ~= means "is not" or "not equal to" ???
Spoiler: show
So arg[6] == nil (according to the domoticz log on line 75), but the MainScriptVersion OR "??" is equal to MainRunModVersion AND i do not get a log error which says "### Warning: Version of _runmodule.lua ...."
Thus what happends if it is equal to nil AND the versions are the same. I'll try to figure out what arg[6] would be then, i guess ...
I guess arg[] is some array or something, but where it is declared is a bit of mistery to me...
Spoiler: show
When looking in the m_ximmio.lua i see also these arg stuff, same as in the _runmodule.lua, like:
afwlogfile = weblogfile or arg[6]. So weblogfile or arg[6] become afwlogfile .. hmm.. But again, would this be the same arg? is this possible to use these between different files. and how? pfff..
This LUA stuff is hard if you can not see any logic in it and with zero LUA programming skill. haha. Im tired, going to sleep now.

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

mmm thought I tested that properly, so checked again and can't get that error when I test here locally.
Could you provide the full logs to me in email please so I can check what is happening as I think that line 76 should be correct?


I understand the issue now: I am testing by running the scripts with LUA which always provides an empty arg array. When the scripts run with Domoticz, the arg array doesn't exists hence the error. I have just pushed a fix for this to github, so could you try that please.

Just to explain a little: The arg array isn't provided (nil) when ran in the foreground, so I simply test whether argument 6 is provided and when not ( ~=) the case then check compare the version of the main script with the _runmodule to ensure they are both at the same release.

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

jvdz wrote: Sunday 14 March 2021 9:49 mmm thought I tested that properly, so checked again and can't get that error when I test here locally.
Could you provide the full logs to me in email please so I can check what is happening as I think that line 76 should be correct?


I understand the issue now: I am testing by running the scripts with LUA which always provides an empty arg array. When the scripts run with Domoticz, the arg array doesn't exists hence the error. I have just pushed a fix for this to github, so could you try that please.

Just to explain a little: The arg array isn't provided (nil) when ran in the foreground, so I simply test whether argument 6 is provided and when not ( ~=) the case then check compare the version of the main script with the _runmodule to ensure they are both at the same release.

Jos
But .. ok ... so it provides an empty array? How and why does it do that, and should the arraybe filled with some sort of info? Ah, ok, just git pull the latest and it seems to be working. The only thing is in the virtual text switch in domoticz, i see gray green and paper, just like on the case id of the website of the garbage company. But in the script i put
Spoiler: show
garbagetype_cfg = {
-- Add any missing records below this line
['pmd'] = {hour = 18, min = 00, daysbefore = 1, reminder = 0, text = 'groene bak'},
['gft'] = {hour = 18, min = 00, daysbefore = 1, reminder = 0, text = 'bruine bak'},
['papier'] = {hour = 18, min = 00, daysbefore = 1, reminder = 0, text = 'blauwe bak'},
And on the switch it says:
Image

Is there a way to put the text groene bak, bruine bak blauwe bak, instead of gray, green, paper ? in the switch's text ?

But for the new update, it seems to work just fine now. So big thanks for that :-)

arg[6] hmm i just do not understand arrays that are provided empty, isn't this clogging up code and resources. I guess i have to study LUA if i want to know this, so short amount of time i have.
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 »

Thuis wrote: Sunday 14 March 2021 13:20 But .. ok ... so it provides an empty array? How and why does it do that, and should the arraybe filled with some sort of info?
-snip-
arg[6] hmm i just do not understand arrays that are provided empty, isn't this clogging up code and resources. I guess i have to study LUA if i want to know this, so short amount of time i have.
I knew I was going to confuse people when trying to explain the LUA script internals and why I test for the arg array being nil. :D
Thuis wrote: Sunday 14 March 2021 13:20 The only thing is in the virtual text switch in domoticz, i see gray green and paper, just like on the case id of the website of the garbage company.
Is there a way to put the text groene bak, bruine bak blauwe bak, instead of gray, green, paper ? in the switch's text ?
But for the new update, it seems to work just fine now. So big thanks for that :-)
Doesn't your log say something like?:

Code: Select all

13:45:37 MainScript: #!# -- start -- Add these records into the garbagetype_cfg table and adapt the schedule and text info to your needs :
   ["green"]                            ={hour=19,min=02,daysbefore=1,reminder=0,text="Ste...........GFT"},
   ["paper"]                            ={hour=19,min=02,daysbefore=1,reminder=0,text="Wijk 3x, 3x, 3x"},
   ["grey"]                             ={hour=19,min=02,daysbefore=1,reminder=0,text="Ste.......... RST"},

in other words: the table you have doesn't contain the appropriate keywords at the left side of the = sign, so you need to modify the shown :

Code: Select all

garbagetype_cfg = {
-- Add any missing records below this line
['pmd'] = {hour = 18, min = 00, daysbefore = 1, reminder = 0, text = 'groene bak'},
['gft'] = {hour = 18, min = 00, daysbefore = 1, reminder = 0, text = 'bruine bak'},
['papier'] = {hour = 18, min = 00, daysbefore = 1, reminder = 0, text = 'blauwe bak'},
to

Code: Select all

garbagetype_cfg = {
-- Add any missing records below this line
['grey'] = {hour = 18, min = 00, daysbefore = 1, reminder = 0, text = 'groene bak'},
['green'] = {hour = 18, min = 00, daysbefore = 1, reminder = 0, text = 'bruine bak'},
['paper'] = {hour = 18, min = 00, daysbefore = 1, reminder = 0, text = 'blauwe bak'},
...all clear? more info is available in the Wiki: https://github.com/jvanderzande/Garbage ... devicetext
Thuis wrote: Sunday 14 March 2021 13:20 But for the new update, it seems to work just fine now. So big thanks for that :-)
Nice ...thanks for the confirmation.
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest