Sharing : Afval kalendar in text sensor

Moderator: leecollings

trunks403
Posts: 6
Joined: Wednesday 13 March 2019 15:32
Target OS: Windows
Domoticz version:
Contact:

Re: Sharing : Afval kalendar in text sensor

Post by trunks403 »

Thanks you guys for script works perfect
trunks403
Posts: 6
Joined: Wednesday 13 March 2019 15:32
Target OS: Windows
Domoticz version:
Contact:

Re: Sharing : Afval kalendar in text sensor

Post 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
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: Sharing : Afval kalendar in text sensor

Post 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
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
Gravityz
Posts: 583
Joined: Wednesday 16 December 2015 19:13
Target OS: NAS (Synology & others)
Domoticz version: 2022.2
Location: Netherlands
Contact:

Re: Sharing : Afval kalendar in text sensor

Post 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
trunks403
Posts: 6
Joined: Wednesday 13 March 2019 15:32
Target OS: Windows
Domoticz version:
Contact:

Re: Sharing : Afval kalendar in text sensor

Post 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!
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: Sharing : Afval kalendar in text sensor

Post 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
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
trunks403
Posts: 6
Joined: Wednesday 13 March 2019 15:32
Target OS: Windows
Domoticz version:
Contact:

Re: Sharing : Afval kalendar in text sensor

Post 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
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: Sharing : Afval kalendar in text sensor

Post 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
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
User avatar
Dutchsea
Posts: 116
Joined: Tuesday 08 December 2015 13:22
Target OS: Raspberry Pi / ODroid
Domoticz version: v2023.2
Location: The Netherlands
Contact:

Re: Sharing : Afval kalendar in text sensor

Post 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?
Raspberry PI 3B on USB drive, Debian version: 12 (bookworm), Domoticz 2023.2
Aeon Z-Wave G5 stick, RFXCOM, Sonof Zigbee 3.0 Dongle plus E, Nefit Easy, Fritzbox, Buienradar, Sonos
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: Sharing : Afval kalendar in text sensor

Post 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
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
jeroenkl
Posts: 113
Joined: Sunday 14 July 2013 22:00
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: NL
Contact:

Re: Sharing : Afval kalendar in text sensor

Post 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 ;-)
Jan Jansen
Posts: 229
Joined: Wednesday 30 April 2014 20:27
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: The Netherlands
Contact:

Re: Sharing : Afval kalendar in text sensor

Post by Jan Jansen »

Jos thanks, it also works well with dar.nl, after some minor changes in the cfg_table.

Jan
Dellie
Posts: 10
Joined: Wednesday 03 April 2019 12:03
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.9
Location: Netherlands
Contact:

Re: Sharing : Afval kalendar in text sensor

Post 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?
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: Sharing : Afval kalendar in text sensor

Post 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
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
Dellie
Posts: 10
Joined: Wednesday 03 April 2019 12:03
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.9
Location: Netherlands
Contact:

Re: Sharing : Afval kalendar in text sensor

Post 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!!
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: Sharing : Afval kalendar in text sensor

Post 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
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
Derik
Posts: 1601
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: Sharing : Afval kalendar in text sensor

Post 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
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
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: Sharing : Afval kalendar in text sensor

Post 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
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
Gravityz
Posts: 583
Joined: Wednesday 16 December 2015 19:13
Target OS: NAS (Synology & others)
Domoticz version: 2022.2
Location: Netherlands
Contact:

Re: Sharing : Afval kalendar in text sensor

Post 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
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: Sharing : Afval kalendar in text sensor

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

Who is online

Users browsing this forum: No registered users and 1 guest