Working thank you!jvdz wrote:Correct, they have changed the website so I fixed it a couple of weeks ago, but hadn't uploaded the change yet. (it is committed now to github)
Just give that version a try and let me know.
Jos
Sharing : Afval kalendar in text sensor
Moderator: leecollings
-
- Posts: 37
- Joined: Friday 30 August 2013 20:24
- Target OS: NAS (Synology & others)
- Domoticz version: DS213+
- Contact:
Re: Sharing : Afval kalendar in text sensor
- Stefan
-
- 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
Josjvdz wrote: ↑Sunday 06 January 2019 23:06 This is an description in Dutch how to make the script working for any of the variations I have published in github:Nu zou het moeten werken, maar de tekst sensor wordt pas geupdate als een van de tijden uit de tabel gelijk is aan de huidige tijd, want dan alleen gaat hij de website info ophalen. Je kan dus even tijdelijk de dummy regel aanpassen naar huidige tijd plus 1 minute om de update te forceren.
- Maak een dummy TEKST sensor aan in domoticz (ik heb Heerlen-Afval gebruikt voor het testen)
- Kopieer juiste versie script voor jouw regio van https://github.com/jvanderzande/mijnafvalwijzer naar directory domoticz\scripts\lua
- Edit script en:
- Pas de variable myAfvalDevice aan met de Device naam die jij hebt aangemaakt in Domoticz.
- Pas de variable NotificationEmailAdress aan naar jouw email adres.
- Pas de afvaltype_cfg tabel aan met de tijden en daysbefore die jij wilt per afval type en de tekst die je in de notificatie wilt ontvangen.
Sorry for the Dutch and let me know in case anybody needs a translation, but these script are only valid for several Dutch areas.
Jos
Thanks for your great work..
Dit set my dummy and other perimeters.. i wait what happend, cannot find the time settings :-]
One question:
What is this dummy for:
Code: Select all
[""},
["Dummy"] ={hour=02,min=10,daysbefore=0,text="dummy to trigger update of text sensor at night"}}
This works better for me into dashticz...
And i mis my Grofvuil and oud ijzer.. Perhaps ?
Edit:
Jos
Perhaps here something wrong?:
Code: Select all
local commando = "curl --max-time 5 -s 'https://www.mijnafvalwijzer.nl/nl/"..Postcode.."/"..Huisnummer.."/'"
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
- 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
@Derik, you are asking many questions in one post so lets see ... oh and you haven't provided me with any info on which script you use and what your information of you area is as several settings depend on this, like the types of garbage you need to define in the table.
This script ONLY gets an update at the defined time in any record that matches the hour/min. So the Dummy simply causes the Website to be checked at 02:10 in the night.
Jos
Did you read the comment behind dummy?Derik wrote: ↑Monday 07 January 2019 19:53 One question:
What is this dummy for:Code: Select all
[""}, ["Dummy"] ={hour=02,min=10,daysbefore=0,text="dummy to trigger update of text sensor at night"}}
This script ONLY gets an update at the defined time in any record that matches the hour/min. So the Dummy simply causes the Website to be checked at 02:10 in the night.
The general script_time_afvalwijzer.lua only shows the next event. The others default to 3 but have this field you can configure:
Code: Select all
local ShowNextEvents = 3 -- indicate the next events to show in the TEXT Sensor in Domoticz
Well, simply add them to the afvaltype_cfg table with their specific information.
I have no idea what you mean here, please explain?Derik wrote: ↑Monday 07 January 2019 19:53 Jos
Perhaps here something wrong?:2 times .nlCode: Select all
local commando = "curl --max-time 5 -s 'https://www.mijnafvalwijzer.nl/nl/"..Postcode.."/"..Huisnummer.."/'"
Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
-
- 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
Jos Thanksjvdz wrote: ↑Monday 07 January 2019 20:21 @Derik, you are asking many questions in one post so lets see ... oh and you haven't provided me with any info on which script you use and what your information of you area is as several settings depend on this, like the types of garbage you need to define in the table.Did you read the comment behind dummy?Derik wrote: ↑Monday 07 January 2019 19:53 One question:
What is this dummy for:Code: Select all
[""}, ["Dummy"] ={hour=02,min=10,daysbefore=0,text="dummy to trigger update of text sensor at night"}}
This script ONLY gets an update at the defined time in any record that matches the hour/min. So the Dummy simply causes the Website to be checked at 02:10 in the night.
The general script_time_afvalwijzer.lua only shows the next event. The others default to 3 but have this field you can configure:Code: Select all
local ShowNextEvents = 3 -- indicate the next events to show in the TEXT Sensor in Domoticz
Well, simply add them to the afvaltype_cfg table with their specific information.
I have no idea what you mean here, please explain?Derik wrote: ↑Monday 07 January 2019 19:53 Jos
Perhaps here something wrong?:2 times .nlCode: Select all
local commando = "curl --max-time 5 -s 'https://www.mijnafvalwijzer.nl/nl/"..Postcode.."/"..Huisnummer.."/'"
Jos
i mean:
https://www.mijnafvalwijzer.nl/nl/
Is this correct two times the nl
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
- 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
Did you try and did you have issues?Derik wrote: ↑Monday 07 January 2019 21:11 Jos Thanks
i mean:
https://www.mijnafvalwijzer.nl/nl/
Is this correct two times the nl
Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
-
- Posts: 223
- Joined: Sunday 30 March 2014 15:24
- Target OS: Linux
- Domoticz version: Beta
- Location: Waterland
- Contact:
Re: Sharing : Afval kalendar in text sensor
Still works ok for me for almost 7 months,( also purmerend)
Thanks to Jos
Rpi, RFXcom, klikaan klikuit switch,thermosmart, z-wave, espeasy, smartevse
-
- Posts: 7
- Joined: Thursday 10 January 2019 12:09
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Netherlands
- Contact:
Re: Sharing : Afval kalendar in text sensor
Cool script! Unfortunately, it does not work for me... At my place is RWM instead of RD4... Have tried to adjust it by myself, unfortunately I have not succeeded yet. Someone here adjusted for RWM?
Did anyone also built this script with ''Pushover" messages?
Did anyone also built this script with ''Pushover" messages?
- 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
PM me the details of the website and some valid postal code/address (whatever is needed to make the script work) and I will have a look for you.
Jos
That should be really easy and simply change this line to reflect the details needed for Pusover:
Code: Select all
commandArray['SendEmail'] = notificationtitle .. '#' .. notificationtext .. '#' .. NotificationEmailAdress
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
-
- Posts: 10
- Joined: Monday 18 April 2016 12:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.9700
- Contact:
Re: Sharing : Afval kalendar in text sensor
Would it be possible to change the general script so it shows multiple events ? At my location they collect the garbage containers and the PMD & Plastics on the same day. Currently I only receive one in my Text device.The general script_time_afvalwijzer.lua only shows the next event.
- 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
Yes that is possible as with the other scripts, just need to modify it to make that happen.
Let you know when I have a script to play with.
Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
- 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
I have made a new version available on GitHub that has a variable at the top where you define the ShowNextEvents to display in the Text sensor.
Give it a spin and let me know.
https://github.com/jvanderzande/mijnafvalwijzer
Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
-
- Posts: 10
- Joined: Monday 18 April 2016 12:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.9700
- Contact:
Re: Sharing : Afval kalendar in text sensor
Thanks, I installed the new script and I'm testing it now.
Edit: Almost what I want;
What I get now is
2019-01-11 11:19:03 zaterdag 12 januari=Papier en karton donderdag 17 januari=Restafval donderdag 24 januari=Groente, Fruit en Tuinafval
But on 'donderdag 17 januari' also the Plastic Metalen and Drankkartons is collected where I live, and I am missing those now.
See
https://mijnafvalwijzer.nl/nl/6671GK/35/
Edit: Almost what I want;
What I get now is
2019-01-11 11:19:03 zaterdag 12 januari=Papier en karton donderdag 17 januari=Restafval donderdag 24 januari=Groente, Fruit en Tuinafval
But on 'donderdag 17 januari' also the Plastic Metalen and Drankkartons is collected where I live, and I am missing those now.
See
https://mijnafvalwijzer.nl/nl/6671GK/35/
- 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
@Rainman, I see that the formatting for your region for PMD is different than I had with the other test Postcode/Housenr combo's, so it wasn't seeing PMD dates at all.
I have made a change to the RegEx and it looks like it now works for the different test combo's I have. Let me know in case there are still people having issues.
Updated the Github code.
Cheers,
Jos
I have made a change to the RegEx and it looks like it now works for the different test combo's I have. Let me know in case there are still people having issues.
Updated the Github code.
Cheers,
Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
-
- Posts: 10
- Joined: Monday 18 April 2016 12:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.9700
- Contact:
Re: Sharing : Afval kalendar in text sensor
Works for me, thanks a lot.
R
R
- 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
In my search for trying to avoid all of the REGEXing to scrape the webcontent, I found an option to download the data as JSON, which should be much more reliable. Code is nearly finished and some more testing to be done.
You will have to change the WasteTypes in the table to a a shortname version eg:
To
Jos
You will have to change the WasteTypes in the table to a a shortname version eg:
Code: Select all
local afvaltype_cfg = {
["Restafval"] ={hour=19,min=22,daysbefore=1,text="Grijze Container met Restafval"},
["GFT-container"] ={hour=19,min=22,daysbefore=1,text="Groene Container met Tuinfval"},
["PMD-zakken"] ={hour=19,min=22,daysbefore=1,text="Oranje Container met Plastic en Metalen"},
["Kerstbomen"] ={hour=19,min=22,daysbefore=1,text="Kerstbomen"},
["Snoeiafval"] ={hour=19,min=22,daysbefore=1,text="Snoei afval"},
["Oud papier"] ={hour=12,min=00,daysbefore=0,text="Blauwe Container met Oud papier"},
["dummy"] ={hour=02,min=10,daysbefore=0,text="dummy to trigger update of text sensor at night"}}
Code: Select all
["restafval"] ={hour=19,min=22,daysbefore=1,text="Grijze Container met Restafval"},
["gft"] ={hour=19,min=22,daysbefore=1,text="Groene Container met Tuinfval"},
["pmd"] ={hour=19,min=22,daysbefore=1,text="Oranje Container met Plastic en Metalen"},
["kerstbomen"] ={hour=19,min=22,daysbefore=1,text="Kerstbomen"},
["takken"] ={hour=19,min=22,daysbefore=1,text="Snoei afval"},
["papier"] ={hour=12,min=00,daysbefore=0,text="Blauwe Container met Oud papier"},
["dummy"] ={hour=02,min=10,daysbefore=0,text="dummy to trigger update of text sensor at night"}}
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
- 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
An updated script_time_afvalwijzer.lua is made available in github: https://github.com/jvanderzande/mijnafvalwijzer
Changes:
Jos
Changes:
- It now uses the json.mijnafvalwijzer.nl website, which returns the information in a JSON format, making the script less sensitive for layout changes.
- It is also faster as the amount of data is less and faster processed.
- It now also has an option to save your config details in a separate file "afvalwijzerconfig.lua" to avoid having to modify the bases script and making script upgrades easier. An example file is available.
- The script will now also tell you exactly which table entries are missing in the afvaltype_cfg tabel, which you can cut&paste into your config and modify.
- An reminder field is added to the table in case you like to get a second notification after x hours, the same day.
Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
Re: Sharing : Afval kalendar in text sensor
Real nice and working perfectly.
I have 2 suggestions.
1. Create some short additional text to show in the domoticz text device.
pdm is a little bit short and should start with a Capital e.g. Pmd, but better Plastic, Metaal and Drankkartons.
Please put extra space around the "=" for readability in the line.
I have 2 suggestions.
1. Create some short additional text to show in the domoticz text device.
pdm is a little bit short and should start with a Capital e.g. Pmd, but better Plastic, Metaal and Drankkartons.
Please put extra space around the "=" for readability in the line.
Code: Select all
txt = txt..web_afvaldate .. " = " .. web_afvaltype .. "\r\n"
Last edited by EddyG on Saturday 12 January 2019 15:06, edited 2 times in total.
- 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
Thanks
Just checked and we can retrieve the long description from the returned JSON data and these will then return e.g.:
gft = Groente, Fruit en Tuinafval
papier = Papier en karton
pmd = Plastic, Metalen en Drankkartons
restafval = Restafval
It is an simple change when people want this rather than the short name.
I've already changed the content of the text sensor from:EddyG wrote: ↑Saturday 12 January 2019 14:14 Please put extra space around the "=" for readability in the line.Code: Select all
txt = txt..web_afvaldate .. " = " .. web_afvaltype .. "\r\n"
12-1-2019=pmd
to
12 jan 2019 -> pmd
which with the previous proposal would be:
12 jan 2019 -> Plastic, Metalen en Drankkartons
What say you?
Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
Re: Sharing : Afval kalendar in text sensor
Sounds perfect, Tnx for the quick response.
- 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
I decided to add the following option to keep things flexible for everyone:
It is available in the current github version.
Jos
Code: Select all
-- ### text sensor format options -----------------------------------------
-- date options:
-- dd = day in 2 digits eg 31
-- mm = month in 2 digits eg 01
-- mmm = month abbreviation in 3 characters eg : jan
-- yy = year in 2 digits eg 19
-- yyyy = year in 4 digits eg 2019
-- Afvaltype description options
-- sdesc = short afvaltype description from Website eg pmd
-- ldesc = LOng afvaltype description from Website eg Plastic, Metalen en Drankkartons
textformat = "dd mmm yy ldesc"
Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
Who is online
Users browsing this forum: No registered users and 1 guest