Sharing : Afval kalendar in text sensor

Moderator: leecollings

User avatar
jvdz
Posts: 2269
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 »

bvansteyn wrote: Friday 31 January 2020 17:43 Is the wrong data something I can solve?
Not much you can do about it as that is returned in the result of the URL with your postalcode and housenr. ;)
Hope they will fix it at the source some day, although it seems the website itself isn't bothered about this wrong data received, so they ignore it too there.

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
bvansteyn
Posts: 18
Joined: Wednesday 07 March 2018 18:22
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: The Netherlands
Contact:

Re: Sharing : Afval kalendar in text sensor

Post by bvansteyn »

jvdz wrote: Friday 31 January 2020 18:49
bvansteyn wrote: Friday 31 January 2020 17:43 Is the wrong data something I can solve?
Not much you can do about it as that is returned in the result of the URL with your postalcode and housenr. ;)
Hope they will fix it at the source some day, although it seems the website itself isn't bothered about this wrong data received, so they ignore it too there.

Jos
Ok, great!
One more question; if I use the dummy to trigger an update for testing purpose; should the message notification also work? In my case I don't get any messages.

Code: Select all

NotificationEmailAdress = {"[email protected]","[email protected]"} -- Specify multiple Email Addresses for the notifications. Leave empty to skip email notification
Notificationsystem = "telegram" 
Both are configured within Domoticz and working (verified by pushing test).
User avatar
jvdz
Posts: 2269
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 »

Notifications will only work at the defined times for the specific afvaltype and at the defined time+reminder:
-- ### define a line for each afvaltype_cfg returned by the webrequest:
-- hour & min ==> the time the check needs to be performed and notification send when daysbefore is true
-- daysbefore ==> 0 means that the notification is send on the day of the planned garbage collection
-- daysbefore ==> X means that the notification is send X day(s) before the day of the planned garbage collection
-- reminder ==> Will send a second reminder after x hours. 0=no reminder (needs to be in the same day!)
-- text ==> define the text for the notification.
All clear?
Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
bvansteyn
Posts: 18
Joined: Wednesday 07 March 2018 18:22
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: The Netherlands
Contact:

Re: Sharing : Afval kalendar in text sensor

Post by bvansteyn »

jvdz wrote: Friday 31 January 2020 21:03 Notifications will only work at the defined times for the specific afvaltype and at the defined time+reminder:
-- ### define a line for each afvaltype_cfg returned by the webrequest:
-- hour & min ==> the time the check needs to be performed and notification send when daysbefore is true
-- daysbefore ==> 0 means that the notification is send on the day of the planned garbage collection
-- daysbefore ==> X means that the notification is send X day(s) before the day of the planned garbage collection
-- reminder ==> Will send a second reminder after x hours. 0=no reminder (needs to be in the same day!)
-- text ==> define the text for the notification.
All clear?
Jos
All clear! :oops:
Thanks for your help! :!:
User avatar
jvdz
Posts: 2269
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 »

bvansteyn wrote: Saturday 01 February 2020 9:07 All clear! :oops:
Sorry, My quote was merely to explain it in more detail and not to tell you that "you could have read it yourself"!
It was a logical question to ask and just wanted to share the details for all to read! :D

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
bvansteyn
Posts: 18
Joined: Wednesday 07 March 2018 18:22
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: The Netherlands
Contact:

Re: Sharing : Afval kalendar in text sensor

Post by bvansteyn »

jvdz wrote: Saturday 01 February 2020 13:40
bvansteyn wrote: Saturday 01 February 2020 9:07 All clear! :oops:
Sorry, My quote was merely to explain it in more detail and not to tell you that "you could have read it yourself"!
It was a logical question to ask and just wanted to share the details for all to read! :D

Jos
Haha, no problem! At least it was no 'RTFM'... ;)
User avatar
Thuis
Posts: 269
Joined: Tuesday 11 September 2018 11:36
Target OS: Linux
Domoticz version: Beta
Location: The Netherlands
Contact:

Re: Sharing : Afval kalendar in text sensor

Post by Thuis »

jvdz wrote: Thursday 30 January 2020 17:20 Ah... ok, just let me know the website you use and your postal code so I can have a look to see what the response looks like.
Just PM the info to me.

Think I have the above covert, so send me an Email to my github emailaddress with your postal code so I can confirm my tests en I will send you a test script you can try in your setup. ;)

Jos
I finally sent an email to your github. Sorry for being so late to comply. I am very surprised, thanks for helping me, would be great if it works.
I Love Domoticz ! And the community around it :-)
User avatar
Thuis
Posts: 269
Joined: Tuesday 11 September 2018 11:36
Target OS: Linux
Domoticz version: Beta
Location: The Netherlands
Contact:

Re: Sharing : Afval kalendar in text sensor

Post by Thuis »

@jvdz This is so cool, and it is working perfectly, thank you so much for adding my county to your afval kalender. I tested it and it is messaging, mailing and notifying me on all media. The correct dates and wastes are displayed in the sensor, so thanks again, i am very happy here. Just to let you and everyone else know :-)
I Love Domoticz ! And the community around it :-)
User avatar
jvdz
Posts: 2269
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 »

@Thuis, You are welcome. ;)
Made the following updates available in GitHub:

Code: Select all

Added:
- script for Goerree-Overflakkee
- script for OPZET using API for those where the screen scraping script 
won't work
Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
User avatar
Thuis
Posts: 269
Joined: Tuesday 11 September 2018 11:36
Target OS: Linux
Domoticz version: Beta
Location: The Netherlands
Contact:

Re: Sharing : Afval kalendar in text sensor

Post by Thuis »

Great, never forgetting the garbage again, and never thinking about it. Telegram and Kodi are telling me when and what garbage has to be at the street the day before the collection. Yes !
I Love Domoticz ! And the community around it :-)
User avatar
erem
Posts: 230
Joined: Tuesday 27 March 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Amsterdam/netherlands
Contact:

Re: Sharing : Afval kalendar in text sensor

Post by erem »

Found this script, and i am using the afvalwijzer one.
I was not happy with the Afvalwijzer.nl description of the waste showing up on the text sensor, so i replaced it with the text portion of the afvalwijzer_cfg table thus:

replace (around line 228) : stextformat = stextformat:gsub('ldesc',rdesc[web_afvaltype:upper().."_L"])
with : stextformat = stextformat:gsub('ldesc', afvaltype_cfg[web_afvaltype].text)

this only works if you you use the long description in the textformat string. (textformat = "dd mmm yyyy ldesc")

this replaces the generic description from afvalwijzer "Groente, Fruit en Tuinafval" with my local description "Groene Container met GFT afval"

I hope someone will benefit from this.
Regards,

Rob
User avatar
jvdz
Posts: 2269
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 »

erem wrote: Wednesday 05 February 2020 15:44 I was not happy with the Afvalwijzer.nl description of the waste showing up on the text sensor, so i replaced it with the text portion of the afvalwijzer_cfg table thus:

replace (around line 228) : stextformat = stextformat:gsub('ldesc',rdesc[web_afvaltype:upper().."_L"])
with : stextformat = stextformat:gsub('ldesc', afvaltype_cfg[web_afvaltype].text)
Thanks for the suggestion.
I will make the following change so this option is simply added as alternative:

Code: Select all

                        stextformat = stextformat:gsub('ldesc',rdesc[web_afvaltype:upper().."_L"])
                        stextformat = stextformat:gsub('sdesc',web_afvaltype)
                        stextformat = stextformat:gsub('tdesc', afvaltype_cfg[web_afvaltype].text)


and change the description at the top to:

Code: Select all

   -- Afvaltype description options
   --    sdesc = short afvaltype description from Website  eg pmd
   --    ldesc = Long afvaltype description from Website   eg Plastic, Metalen en Drankkartons
   --    tdesc = Use the description available in the table text field
You, or anybody else, could also make a pull request in case there is an suggestion for update of fix to the published code. :-)

Cheers,
Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
User avatar
erem
Posts: 230
Joined: Tuesday 27 March 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Amsterdam/netherlands
Contact:

Re: Sharing : Afval kalendar in text sensor

Post by erem »

Jos,

That is the better solution. Thanks for honoring the suggestion.
Regards,

Rob
User avatar
jvdz
Posts: 2269
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 »

@All,

I am have been reworking the set of scripts currently supported on GITHUB to make the whole setup modular. The issue that I have is that the scriptd aren't all working in the same way, making it very cumbersome to add/update logic as that would require to visit all the scripts. Also adding new garbage websites is more difficult in this way.
I have started a new thread (https://www.domoticz.com/forum/viewtopi ... 61&t=31295) to continue the discussion for my script there, as this really was never my thread to begin with. :D

Cheers,
Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
User avatar
cyberclwn
Posts: 103
Joined: Thursday 20 August 2015 22:53
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: The Netherlands
Contact:

Re: Sharing : Afval kalendar in text sensor

Post by cyberclwn »

Hi,

Can the site "https://acv-afvalkalender.nl/" also be added to this script?

I hope so, if needed more info (postal code e.g.) then drop me a p.m. :)

Greetz,
3xPi 2B (Domoticz "live", Domoticz "sandbox", PhotoFrame)
RFXCom433(E), KaKu, Oregon Scientific, Keyes 2-relay, Logitech Media Server, MiLight, Smartwares heating controller(2x), IR Send/Receive, Keyes PIR, XH-M131 DuskSensor, DHT22/11
menno.vanmunster
Posts: 8
Joined: Thursday 28 August 2014 8:49
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.9700
Contact:

Re: Sharing : Afval kalendar in text sensor

Post by menno.vanmunster »

cyberclwn wrote: Tuesday 07 April 2020 22:41 Hi,

Can the site "https://acv-afvalkalender.nl/" also be added to this script?

I hope so, if needed more info (postal code e.g.) then drop me a p.m. :)

Greetz,
I,am also hoping for this to be added
User avatar
jvdz
Posts: 2269
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 is already available in my new GarbageCalendar version, module m_ximmio. ;)
See the linked thread.

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
User avatar
cyberclwn
Posts: 103
Joined: Thursday 20 August 2015 22:53
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: The Netherlands
Contact:

Re: Sharing : Afval kalendar in text sensor

Post by cyberclwn »

Oh, sorry ... must have overlooked it.

Thanks
3xPi 2B (Domoticz "live", Domoticz "sandbox", PhotoFrame)
RFXCom433(E), KaKu, Oregon Scientific, Keyes 2-relay, Logitech Media Server, MiLight, Smartwares heating controller(2x), IR Send/Receive, Keyes PIR, XH-M131 DuskSensor, DHT22/11
User avatar
Dutchsea
Posts: 120
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 »

Hi Jos,

Just upgraded my Raspberri Pi from older OS (i think Raspian) to Debian doing a full clean install. Since I liked the Afval text sensor a lot on my old system I wanted to implement it on my new system too. I choose the use new version you created (GarbageCalendar).

Just here to report that it works well on my new system though I only have 2 days experience so far and I have not used the E-mail option.
Also i can confirm that it works with Lua v5.1.5 which is included in Raspberry Debian Buster image.

And some suggestions for your set-up instructions that may make the implementation of this tool a bit more straightforward for Noobs like myself. (I managed to figure it out by myself in the end though it took some time, trial and error and puzzling...).

Suggestions:

0. Start with the point that a websitemodule needs to be selected for this tool and some ideas how to determine which websitemodule is applicable for the user implemeting the tool.
1. Change some text: In the hardware section of Domoticz; create Dummy and within the Dummy create a virtual Text sensor and remember the name you gave this virtual Text sensor. eg "Container".
2. Add link to the download location
3. Add full path from domoticz directory to garbagecalendar/ so: Go into directory “domoticz/scripts/lua/garbagecalendar/"
4. Give examples for the format of the parameters that need to be added as well as change Text Device name into "virtual sensor name":

myGarbageDevice = 'Container' -- The virtual Text sensor name you created in Domoticz
ShowNextEvents = 3 -- indicate the next x events to show in the TEXT Sensor in Domoticz
Zipcode = '' -- Your zipcode eg: Zipcode = '1234AB'
Housenr = '' -- Your housnr eg: Housenr = '123'
Housenrsuf = '' -- Your housnr suffix eg: Housenrsuf = 'A'
Hostname = '' -- m_opzet & m_opzet_api: Specify the hostname of your website. eg: Hostname = 'mijnafvalwijzer.nl'
-- *m_ximmio: Specify the companycode. (See m_ximmio.lua on how to find this code).
Street='' -- Street name Only needed for: m_recycleapp eg: Street='Example of streetname (dont have one myself)' [/i]

Cheers
Raspberry PI 3B on USB drive, Debian version: 12 (bookworm), Domoticz 2024.7
Aeon Z-Wave G5 stick, RFXCOM, Sonof Zigbee 3.0 Dongle plus E, Nefit Easy, Fritzbox, Buienradar, Sonos
User avatar
jvdz
Posts: 2269
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 23 October 2020 2:24 Hi Jos,

Just upgraded my Raspberri Pi from older OS (i think Raspian) to Debian doing a full clean install. Since I liked the Afval text sensor a lot on my old system I wanted to implement it on my new system too. I choose the use new version you created (GarbageCalendar).
Great, but you do know there is a new thread for that version here?: viewtopic.php?f=61&t=31295 ;)

I do appreciate the time you took to report your findings and specific feedback and have made several changes as suggested.
These are the comments I have on your suggestions:
Dutchsea wrote: Friday 23 October 2020 2:24 Suggestions:
3. Add full path from domoticz directory to garbagecalendar/ so: Go into directory “domoticz/scripts/lua/garbagecalendar/"
The whole set of files as they are on GitHub do need to be stored into “domoticz/scripts/lua" and does also contain the subdirectory garbagecalendar, so this change would not be correct.
Dutchsea wrote: Friday 23 October 2020 2:24 4. Give examples for the format of the parameters that need to be added as well as change Text Device name into "virtual sensor name":

myGarbageDevice = 'Container' -- The virtual Text sensor name you created in Domoticz
ShowNextEvents = 3 -- indicate the next x events to show in the TEXT Sensor in Domoticz
Zipcode = '' -- Your zipcode eg: Zipcode = '1234AB'
Housenr = '' -- Your housnr eg: Housenr = '123'
Housenrsuf = '' -- Your housnr suffix eg: Housenrsuf = 'A'
Hostname = '' -- m_opzet & m_opzet_api: Specify the hostname of your website. eg: Hostname = 'mijnafvalwijzer.nl'
-- *m_ximmio: Specify the companycode. (See m_ximmio.lua on how to find this code).
Street='' -- Street name Only needed for: m_recycleapp eg: Street='Example of streetname (dont have one myself)' [/i]
Your example values aren't always correct as they depend on the used module and Country, so I prefer to leave things as they are unless something is wrong. People really should know the information they need to fill in as they mostly need to do the same when using the online version of their GarbageCalendar and then use that same info in the script.
Dutchsea wrote: Friday 23 October 2020 2:24 0. Start with the point that a websitemodule needs to be selected for this tool and some ideas how to determine which websitemodule is
There is a separate section is the setup about the modules that can be selected and there is an whole Wiki page with an description of each of the modules: https://github.com/jvanderzande/Garbage ... le_modules
There isn't much more I can do there and agree it does require some research for some of these WebSite to figure out which module would work, but I don't know an easy way to describe that and simple either Google or check of the WebSite to see if the format looks familiar.

Cheers,
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