Page 10 of 18

Re: Sharing : Afval kalendar in text sensor

Posted: Wednesday 13 March 2019 15:36
by trunks403
Thanks you guys for script works perfect

Re: Sharing : Afval kalendar in text sensor

Posted: Wednesday 10 April 2019 12:57
by trunks403
Since 2 weeks it doenst work anymore

2019-04-10 12:54:00.283 Error: LUA: @AFW Error: Empty result from curl command

When curl the website it also doenst curl (empty)
When curl other website or https://www.mijnafvalwijzer.nl/nl/111AA/6/ it works

Re: Sharing : Afval kalendar in text sensor

Posted: Wednesday 10 April 2019 16:56
by jvdz
Which script version are you using?
What does the LOG say when you set Debug to True?
You can PM me your postcode/huisnummer info when you want me to do some testing to see what is going on.

Jos

Re: Sharing : Afval kalendar in text sensor

Posted: Thursday 11 April 2019 8:13
by Gravityz
Nice script.
seems to work very good.

2 questions

if i want complete months(eg januari) is this as simple as changing al the strings
local nMON={"januari","februari","maart","april","mei"

i changed april but also the format to mmmmm and then i got April04
with mont mmm it is ok but not sure if this is the way to go.

second question, is there a way to change the color of the text

Re: Sharing : Afval kalendar in text sensor

Posted: Thursday 11 April 2019 8:56
by trunks403
jvdz wrote: Wednesday 10 April 2019 16:56 Which script version are you using?
What does the LOG say when you set Debug to True?
You can PM me your postcode/huisnummer info when you want me to do some testing to see what is going on.

Jos
019-04-11 08:45:00.395 Status: LUA: @AFW:Failed loading default JSON.lua... trying /home/pi/domoticz/scripts/lua/JSON.lua
2019-04-11 08:45:00.395 Status: LUA: @AFW:Loaded JSON.lua.
2019-04-11 08:45:00.395 Status: LUA: @AFW:AfvalWijzer module start check
2019-04-11 08:45:00.395 Status: LUA: @AFW:afvaltype_cfg :tuinafval;14;12
2019-04-11 08:45:00.395 Status: LUA: @AFW:afvaltype_cfg :dummy2;2;10
2019-04-11 08:45:00.395 Status: LUA: @AFW:afvaltype_cfg :takken;14;14
2019-04-11 08:45:00.395 Status: LUA: @AFW:afvaltype_cfg :pmd;14;14
2019-04-11 08:45:00.395 Status: LUA: @AFW:afvaltype_cfg :restafval;8;45
2019-04-11 08:45:00.395 Status: LUA: @AFW:afvaltype_cfg :grofvuil;14;12
2019-04-11 08:45:00.395 Status: LUA: @AFW:afvaltype_cfg :gft;14;12
2019-04-11 08:45:00.395 Status: LUA: @AFW:afvaltype_cfg :plastic;14;12
2019-04-11 08:45:00.395 Status: LUA: @AFW:afvaltype_cfg :dummy1;0;1
2019-04-11 08:45:00.395 Status: LUA: @AFW:afvaltype_cfg :papier;14;12
2019-04-11 08:45:00.395 Status: LUA: @AFW:afvaltype_cfg :kerstbomen;14;12
2019-04-11 08:45:00.395 Status: LUA: AfvalWijzer module start update (v20190112-1653)
2019-04-11 08:45:00.395 Status: LUA: @AFW:=== web update ================================
2019-04-11 08:45:00.426 Error: LUA: @AFW Error: Empty result from curl command


I have tried many differnt postcode but still doenst work for example 9202EM 210

Much thanks for youre help!

Re: Sharing : Afval kalendar in text sensor

Posted: Thursday 11 April 2019 9:39
by jvdz
Looking fine for me:

Code: Select all

@AFW:Loaded default JSON.lua.
@AFW:Using user config file: alvalwijzerconfig.lua
@AFW:AfvalWijzer module start check
@AFW:afvaltype_cfg :gft;19;1
@AFW:afvaltype_cfg :pmd;19;1
@AFW:afvaltype_cfg :grofvuil;19;1
@AFW:afvaltype_cfg :restafval;19;1
@AFW:afvaltype_cfg :dummy2;2;10
@AFW:afvaltype_cfg :dummy1;2;10
@AFW:afvaltype_cfg :tuinafval;19;1
@AFW:afvaltype_cfg :plastic;19;1
@AFW:afvaltype_cfg :papier;12;5
@AFW:afvaltype_cfg :kerstbomen;19;1
@AFW:afvaltype_cfg :takken;19;1
AfvalWijzer module start update (v20190112-1653)
@AFW:=== web update ================================
@AFW:- start looping through received data -----------------------------------------------------------
@AFW:web_afvaltype:gft   web_afvaldate:2019-01-02
@AFW:...gerd-> diff:-99  afvalyear:2019  afvalmonth:01  afvalday:02
@AFW:web_afvaltype:gft   web_afvaldate:2019-01-09
@AFW:...gerd-> diff:-92  afvalyear:2019  afvalmonth:01  afvalday:09
@AFW:web_afvaltype:plastic   web_afvaldate:2019-01-15
@AFW:...gerd-> diff:-86  afvalyear:2019  afvalmonth:01  afvalday:15
@AFW:web_afvaltype:gft   web_afvaldate:2019-01-23
@AFW:...gerd-> diff:-78  afvalyear:2019  afvalmonth:01  afvalday:23
@AFW:web_afvaltype:plastic   web_afvaldate:2019-01-29
@AFW:...gerd-> diff:-72  afvalyear:2019  afvalmonth:01  afvalday:29
@AFW:web_afvaltype:gft   web_afvaldate:2019-02-06
@AFW:...gerd-> diff:-64  afvalyear:2019  afvalmonth:02  afvalday:06
@AFW:web_afvaltype:plastic   web_afvaldate:2019-02-12
@AFW:...gerd-> diff:-58  afvalyear:2019  afvalmonth:02  afvalday:12
@AFW:web_afvaltype:gft   web_afvaldate:2019-02-20
@AFW:...gerd-> diff:-50  afvalyear:2019  afvalmonth:02  afvalday:20
@AFW:web_afvaltype:plastic   web_afvaldate:2019-02-26
@AFW:...gerd-> diff:-44  afvalyear:2019  afvalmonth:02  afvalday:26
@AFW:web_afvaltype:gft   web_afvaldate:2019-03-06
@AFW:...gerd-> diff:-36  afvalyear:2019  afvalmonth:03  afvalday:06
@AFW:web_afvaltype:plastic   web_afvaldate:2019-03-12
@AFW:...gerd-> diff:-30  afvalyear:2019  afvalmonth:03  afvalday:12
@AFW:web_afvaltype:gft   web_afvaldate:2019-03-20
@AFW:...gerd-> diff:-22  afvalyear:2019  afvalmonth:03  afvalday:20
@AFW:web_afvaltype:plastic   web_afvaldate:2019-03-26
@AFW:...gerd-> diff:-16  afvalyear:2019  afvalmonth:03  afvalday:26
@AFW:web_afvaltype:gft   web_afvaldate:2019-03-29
@AFW:...gerd-> diff:-13  afvalyear:2019  afvalmonth:03  afvalday:29
@AFW:web_afvaltype:gft   web_afvaldate:2019-04-03
@AFW:...gerd-> diff:-8  afvalyear:2019  afvalmonth:04  afvalday:03
@AFW:web_afvaltype:plastic   web_afvaldate:2019-04-09
@AFW:...gerd-> diff:-2  afvalyear:2019  afvalmonth:04  afvalday:09
@AFW:web_afvaltype:gft   web_afvaldate:2019-04-12
@AFW:...gerd-> diff:1  afvalyear:2019  afvalmonth:04  afvalday:12
@AFW:...Noti-> i_daysdifference:1  afvaltype_cfg[s_afvaltype].daysbefore:1  hour:19  min:1
@AFW:web_afvaltype:plastic   web_afvaldate:2019-04-23
@AFW:...gerd-> diff:12  afvalyear:2019  afvalmonth:04  afvalday:23
@AFW:...Noti-> i_daysdifference:12  afvaltype_cfg[s_afvaltype].daysbefore:1  hour:19  min:1
@AFW:-End   --------------------------------------------------------------------------------------------
@AFW: Found:12 apr 19 Groente, Fruit en Tuinafval ; 23 apr 19 Plastic en kunststof ; 
You are sure you can access the internet and resolve the domain as you seem to get an empty result back from the curl query?
Could you Email or PM me your script so I can check what the difference is?

Jos

Re: Sharing : Afval kalendar in text sensor

Posted: Thursday 11 April 2019 10:15
by trunks403
I am using windows server with a direct connection trough internet.

I am also using the plug-in buienrader witch works fine to get data from xml.buienrader.nl

Re: Sharing : Afval kalendar in text sensor

Posted: Thursday 11 April 2019 10:25
by jvdz
It seems you aren't using the latest version of the script. PMed you the latest version with your information which seems to work fine when I tried.
Does that work for you too? :)

Jos

Re: Sharing : Afval kalendar in text sensor

Posted: Friday 12 April 2019 22:17
by Dutchsea
Just picked up "script_time_huisvuil-opzet.lua" version "20190121-2100" from GitHub for my town Hillywood (=Hilversum ;) )
The website is for the Gooi en Vechtstreek area (https://inzamelkalender.gad.nl) and also made by "Opzet"
(It was a handy tip to check the bottom of the webpage for this name)

After some some trail and error (I am no coder whatsoever) its works perfectly. My compliments and thanks to Jos, Zicht and other contributors!

Just one question; in the debug mode I get an update in the Domoticz log each minute. Is that expected behaviour?

Re: Sharing : Afval kalendar in text sensor

Posted: Friday 12 April 2019 23:07
by jvdz
Dutchsea wrote: Friday 12 April 2019 22:17 Just one question; in the debug mode I get an update in the Domoticz log each minute. Is that expected behaviour?
Yes, that is why it is called Debug and should only be enabled when debugging. So just set to to False when things work and the update process will only happen the any of the specified times in the table. ;)

cheers,
Jos

Re: Sharing : Afval kalendar in text sensor

Posted: Sunday 14 April 2019 19:41
by jeroenkl
Dutchsea wrote: Friday 12 April 2019 22:17 Just picked up "script_time_huisvuil-opzet.lua" version "20190121-2100" from GitHub for my town Hillywood (=Hilversum ;) )
The website is for the Gooi en Vechtstreek area (https://inzamelkalender.gad.nl) and also made by "Opzet"
(It was a handy tip to check the bottom of the webpage for this name)

After some some trail and error (I am no coder whatsoever) its works perfectly. My compliments and thanks to Jos, Zicht and other contributors!

Just one question; in the debug mode I get an update in the Domoticz log each minute. Is that expected behaviour?
thxs! Works also great for city named Bussum ;-)

Re: Sharing : Afval kalendar in text sensor

Posted: Sunday 28 April 2019 16:05
by Jan Jansen
Jos thanks, it also works well with dar.nl, after some minor changes in the cfg_table.

Jan

Re: Sharing : Afval kalendar in text sensor

Posted: Monday 29 April 2019 11:41
by Dellie
Hi,
Script works great but.... :lol:
Yesterday configured is all and in the evening received the email that today garbage is collected so far so good
Only thing is that I received 13 emails with this message send within a minute :shock: Does anybody have an idea why?

Re: Sharing : Afval kalendar in text sensor

Posted: Monday 29 April 2019 13:50
by jvdz
How are you running the script?
There are 2 options why this happens normally:
1. You haven't named it correctly as script_time_xxxxxxx.lua when using files for the time event.
2. you are using the internal LUA script editor and didn't change the event type from ALL to TIME.

Jos

Re: Sharing : Afval kalendar in text sensor

Posted: Monday 29 April 2019 14:00
by Dellie
Hi Jos,

Thanks for the quick response. Wasn't aware I had to change it to time trigger ;)
Did I miss this part? Couldn't find it on the Github page aswell unless its covered by "These Domoticz time scripts".
Anyhow, just changed it. Let's see what happens next week :D

Cheers!!

Re: Sharing : Afval kalendar in text sensor

Posted: Monday 29 April 2019 14:08
by jvdz
mmm, well the text starts with:
These Domoticz time scripts will retrieve ....
and the filenames are script_time_restofname.lua, so I though that would be pretty much of a no brainer that these are TIME event script, but can imagine it can be a little difficult when starting this stuff.
I am not using the internal editor at all myself but have seen that mistake made already so many times in these forums that one could wonder whether the default in that dropdown should be INACTIVE, forcing to make a decision for a eventtype when creating a script event. :)

Either way, I am always open for proposals to more this more clear! Just create a PullRequest for an update of the readme for better install instructions.

Jos

Re: Sharing : Afval kalendar in text sensor

Posted: Monday 29 April 2019 21:22
by Derik
Jos

Great work your script!!!

My WAF is very happy with the message she get ............... and i am also :-) :lol: :lol:

Is there perhaps a option to send the message to more email accounts???

I use now:

Code: Select all

ver="20190112-1653"
Are there very great changes?
So do i need tot update or?


Thanks

Re: Sharing : Afval kalendar in text sensor

Posted: Monday 29 April 2019 21:47
by jvdz
Derik wrote: Monday 29 April 2019 21:22 My WAF is very happy..
mmm .... This one is open for a lot of pun remarks but I am assuming you mean wife. ;)
Derik wrote: Monday 29 April 2019 21:22 Is there perhaps a option to send the message to more email accounts???
The script uses the standard event SendEmail notification and as far as I know that doesn't support it.:

Code: Select all

         commandArray['SendEmail'] = notificationtitle .. '#' .. notificationtext .. '#' .. NotificationEmailAdress
You could obviously simply repeat that line yourself and add the second email address to that, but that means you need to do that everytime you do an upgrade.
Derik wrote: Monday 29 April 2019 21:22 I use now:

Code: Select all

ver="20190112-1653"
Are there very great changes?
So do i need tot update or?
Several changes made but no drastic ones. Github does contain the commit log of all changes.

Jos

Re: Sharing : Afval kalendar in text sensor

Posted: Thursday 02 May 2019 15:38
by Gravityz
Nice script.
seems to work very good.

2 questions

if i want complete months(eg januari) is this as simple as changing al the strings
local nMON={"januari","februari","maart","april","mei"

i changed april but also the format to mmmmm and then i got April04
with mont mmm it is ok but not sure if this is the way to go.

second question, is there a way to change the color of the text
eg, highlight the first on on top in red

Re: Sharing : Afval kalendar in text sensor

Posted: Thursday 02 May 2019 17:00
by jvdz
Gravityz wrote: Thursday 02 May 2019 15:38 2 questions

if i want complete months(eg januari) is this as simple as changing al the strings
local nMON={"januari","februari","maart","april","mei"

i changed april but also the format to mmmmm and then i got April04
with mont mmm it is ok but not sure if this is the way to go.
Just change the array and that should do it:

Code: Select all

local nMON={"januari","februari","maart","april","mei"
local nMON={"januari","februari","maart","april","mei"
Gravityz wrote: Thursday 02 May 2019 15:38 second question, is there a way to change the color of the text
eg, highlight the first on on top in red
Everything is possible when you put your mind to it, but that requires changing some of the scriptlogic and add this to that first line:

Code: Select all

                     txt = txt..' <font color="red">'..web_afvaldate .. " = " .. web_afvaltype .. "</font>\r\n"
Jos