heyajohnny / afvalinfo Goto Github PK
View Code? Open in Web Editor NEWProvides Home Assistant sensors for multiple Dutch waste collectors. The idea is to add more cities and features in the future.
License: GNU General Public License v3.0
Provides Home Assistant sensors for multiple Dutch waste collectors. The idea is to add more cities and features in the future.
License: GNU General Public License v3.0
Please add Veldhoven
Calendars for Veldhoven (5500 - 5509) can be found via "afvalinfo.nl"
Hi @heyajohnny,
Could you please Utrecht?
Here is the link where the data can be found: https://www.mijnafvalwijzer.nl/
Thanks!
Errors in log 3 for all sensors
Update for sensor.afvalinfo_restafval fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 476, in async_device_update await self.hass.async_add_executor_job(self.update) File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/afvalinfo/sensor.py", line 264, in update self.data.update() File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 240, in wrapper result = method(*args, **kwargs) File "/config/custom_components/afvalinfo/sensor.py", line 222, in update self.city, self.postcode, self.street_number File "/config/custom_components/afvalinfo/location/westland.py", line 63, in get_data html = r.json()["html"] KeyError: 'html'
Update for sensor.afvalinfo_gft fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 476, in async_device_update await self.hass.async_add_executor_job(self.update) File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/afvalinfo/sensor.py", line 264, in update self.data.update() File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 240, in wrapper result = method(*args, **kwargs) File "/config/custom_components/afvalinfo/sensor.py", line 222, in update self.city, self.postcode, self.street_number File "/config/custom_components/afvalinfo/location/westland.py", line 63, in get_data html = r.json()["html"] KeyError: 'html'
Update for sensor.afvalinfo_oud_papier fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 476, in async_device_update await self.hass.async_add_executor_job(self.update) File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/afvalinfo/sensor.py", line 264, in update self.data.update() File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 240, in wrapper result = method(*args, **kwargs) File "/config/custom_components/afvalinfo/sensor.py", line 222, in update self.city, self.postcode, self.street_number File "/config/custom_components/afvalinfo/location/westland.py", line 63, in get_data html = r.json()["html"] KeyError: 'html'
Hallo,
Ik heb deze module geïnstalleerd en de stappen gevolgd zoals beschreven. Krijg ik nog iets van een kaart te zien wanneer het opgehaald wordt?
Op dit moment zie ik namelijk niks terug, ook niet wanneer dat zij komen.
Wellicht heb ik iets gemist?
Na installatie van HACS en (als eerste) Afvalinfo, kreeg ik een foutmelding dat module bs4 ontbrak. Na wat speurwerk bleek de oplossing te zijn het volgende aan configuration.yaml toe te voegen (boven de afvalinfo sensor):
- platform: scrape
resource: https://www.home-assistant.io
select: ".current-version h1"
Wellicht handig om op te nemen in de installatie info.
Hi,
we use this link:
Sinds de Meerlanden een nieuwe website heeft geintroduceerd werkt Afvalinfo niet meer.
Could you add the place Kesteren this is a place in Neder-Betuwe?
Hi, can you please add Enschede?
Like to use this one.
regards,
Tim
It's very cool that you added HVC already, but in the list i see that Alkmaar is missing. Could you please add that?
Hi, is het mogelijk om Nieuwstadt toe te voegen aan afvalinfo? Thanks.
Gemeente: Echt-Susteren.
Calendar: https://inzamelkalender.gad.nl/
Dear developers,
I've made an annual Google calender with manual entries for the waste collection. It would be great if you could add Heerenveen to this component. The waste collector is omrin. This is the link to their website (from which you can download a pdf file...). https://www.omrin.nl/bij-mij-thuis/afval-regelen/afvalkalender
Thanks,
Richard
is het mogelijk om Vianen toe te voegen aan afvalinfo
Do not know whether this is this is the way to say problems are solved, but....they are.
Thank you !!!
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 279, in async_update_ha_state
await self.async_device_update()
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 476, in async_device_update
await self.hass.async_add_executor_job(self.update)
File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/homeassistant/.homeassistant/custom_components/afvalinfo/sensor.py", line 250, in update
self.data.update()
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/util/__init__.py", line 240, in wrapper
result = method(*args, **kwargs)
File "/home/homeassistant/.homeassistant/custom_components/afvalinfo/sensor.py", line 211, in update
self.city, self.postcode, self.street_number
File "/home/homeassistant/.homeassistant/custom_components/afvalinfo/location/westerkwartier.py", line 26, in get_data
items = r.json()["items"]
File "/srv/homeassistant/lib/python3.7/site-packages/requests/models.py", line 897, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib/python3.7/json/__init__.py", line 348, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.7/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.7/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Ik heb een plaatsnaam, postcode en huisnummer uit een ander gebied (ROVA) ingevuld dan westerkwartier.
ik mis andijk
Zou het een mogelijkheid zijn om de sensors van een extra attribute/waarde te voorzien welk ON/OFF doen, naargelang het "ophaaldag" is?
Ik probeer een Hue lamp aan te sturen (Zodat ie blauw/groen wordt op de ophaaldagen) met een Node-red flow, en datums vergelijken (Is de input datum vandaag) in Node-red gaat mijn pet nog (even) te boven. Wanneer ik een On/Off waarde kan uitlezen gaat me dit sowieso lukken :)
The integration is working great, but can you make it possible to add "kerstbomen" to the resources?
Please add Venray
Calendars for Venray can be found via "afvalinfo.nl"
The source of the data: https://www.circulus-berkel.nl/afvalkalender/
Thanks!
Would be nice if RAD Hoeksche Waard can be added to the code.
The source of the data: http://afvalkalender.container-beheer.nl/
Thanks!
Als ik een geldige postcode/huisnummer uit Den Ham invul, krijg ik in HA 'Unknown' te zien. Iets uit Vriezenveen werkt wel. Beide plaatsen zijn uit dezelfde gemeente Twenterand en de geteste adressen werken wel in de invulkalender van ROVA. Komt dit misschien door de spatie in de plaatsnaam?
Example:
afval_morgen:
friendly_name: "Afval morgen"
value_template: >
{% if state_attr('sensor.afvalinfo_gft', 'days_until_collection_date') ==1 %}
{{ state_attr('sensor.afvalinfo_gft', 'friendly_name') }}
{% elif state_attr('sensor.afvalinfo_oud_papier', 'days_until_collection_date') ==1 %}
{{ state_attr('sensor.afvalinfo_oud_papier', 'friendly_name') }}
{% elif state_attr('sensor.afvalinfo_pbd', 'days_until_collection_date') ==1 %}
{{ state_attr('sensor.afvalinfo_pbd', 'friendly_name') }}
{% elif state_attr('sensor.afvalinfo_restafval', 'days_until_collection_date') ==1 %}
{{ state_attr('sensor.afvalinfo_restafval', 'friendly_name') }}
{% else %}
Niets
{% endif %}
With that, you can work with "state images" and generate something like: (based on the kind of trash that next)
**Lovelace config:**
aspect_ratio: 60%
entities:
- entity: sensor.afvalinfo_gft
- entity: sensor.afvalinfo_oud_papier
- entity: sensor.afvalinfo_pmd
- entity: sensor.afvalinfo_restafval
It's part of rova and the basic url format is:
https://inzamelkalender.rova.nl/nl/[zip]/[housenumber]/
From there it is quite straight forward I guess.
Hi,
Could you add Arnhem (including Elden and Schaarbergen) to the code, I did test with this URL that is provided by Suez at https://inzamelwijzer.suez.nl/adres/ .
On one of the sites of gemeente Arnhem this one was provided as alternative to the standard afvalwijzer. The syntax is identical to "Alphen aan de Rijn" so I used that as a template. I just changed the afvalstroom numbers to the correct one and it is working.
Hans
Hi,
Please add HVC:
three step rocket to receive the calendar as far as i can see:
1: get the address Id via
Request URL: https://inzamelkalender.hvcgroep.nl/adressen/postcode:housenumber Request Method: GET Status Code: 200 OK
response:
'[{"bagid":"0531200000002198","postcode":"1234AA","huisnummer":11,"huisletter":"","toevoeging":"","description":"Straatnaam 11, 1234AA Hendrik-Ido-Ambacht","straat":"Straatnaam","woonplaats":"Hendrik-Ido-Ambacht","woonplaatsId":2352,"gemeenteId":531,"latitude":51.333333,"longitude":5.642907}]
'
2 get all the types of trash via
'Request URL: https://inzamelkalender.hvcgroep.nl/rest/adressen/{{addressId}}/afvalstromen
Request Method: GET
Status Code: 200 OK'
response:
' [ {
"id": 6,
"parent_id": 0,
"title": "Plastic, blik & drinkpakken",
"slug": null,
"tags": null,
"page_title": "plastic, blik & drinkpakken",
"content": "heleboel tekst",
"menu_title": "Plastic, blik & drinkpakken",
"icon": "plastic-blik-drinkpak",
"icon_data": "data:image\/svg",
"ophaaldatum": "2020-02-28"
},....
]'
'https://inzamelkalender.hvcgroep.nl/rest/adressen/{{addressId}}/kalender/2020'
response
'[
{"afvalstroom_id":3,"ophaaldatum":"2020-01-10"},
{"afvalstroom_id":6,"ophaaldatum":"2020-02-14"},
....]'
Hi,
Could you please add Meppel to the list also?
Here you can find the link for the data: https://speciaal.meppel.nl/afvalkalender.html
Thanks!
Is het mogelijk de Westland afval kalender toe te voegen? Domoticz werkend lua script hier te vinden: https://github.com/jvanderzande/GarbageCalendar, weet niet of dat de boel makkelijker maakt. Zou in ieder geval top zijn
Ik krijg de volgende foutmelding voor oudpapier, restafval en gft, onderstaande config heeft altijd gewerkt:
foutmelding:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 476, in async_device_update
await self.hass.async_add_executor_job(self.update)
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/afvalinfo/sensor.py", line 243, in update
self.data.update()
File "/usr/src/homeassistant/homeassistant/util/init.py", line 240, in wrapper
result = method(*args, **kwargs)
File "/config/custom_components/afvalinfo/sensor.py", line 201, in update
self.city, self.postcode, self.street_number
File "/config/custom_components/afvalinfo/location/westland.py", line 65, in get_data
waste_dict["gft"] = self.get_date_from_afvaltype(html, "soort-groen")
File "/config/custom_components/afvalinfo/location/westland.py", line 20, in get_date_from_afvaltype
tag = BeautifulSoup(html, "html.parser").find(
File "/usr/local/lib/python3.7/site-packages/bs4/init.py", line 287, in init
elif len(markup) <= 256 and (
TypeError: object of type 'NoneType' has no len()
Hey Johnny,
Finally had the time (and courage) to update, but now the sensors aren't updating anymore.
In the logging I see the following:
"Updating afvalinfo sensor took longer than the scheduled update interval 0:00:30" and none of the sensors are updating.
All of the sensors show "unknown" as their state.
My configuration can be found below:
- platform: afvalinfo resources: - pbd - gft - papier - restafval - trash_type_today - trash_type_tomorrow city: helmond postcode: 1234AB <--Changed for privacy purposes streetnumber: 50 <--Changed for privacy purposes dateformat: '%d-%m-%Y' timespanindays: 365
Maybe I'm doing something wrong? I hardly doubt that since it was working until the update.
If you need more info, please ask!
Thank you for adding Westerkwartier. However when I check configuration an error says:
Platform error sensor.afvalinfo - No module named 'custom_components.afvalinfo.location.westerkwartier'
I reinstalled and restarted several times.
Besides that: when I copy the lines for time and date format the configuration check says :
Error loading /config/configuration.yaml: while parsing a block mapping
in "/config/sensors.yaml", line 219, column 3
expected , but found ''
in "/config/sensors.yaml", line 226, column 36
It works with the api of
https://wasteapi.ximmio.com/api/GetCalendar
Our garbage collector is Renewi. Paper, glass and such is collected by Hoeksema's Regionale Milieudiensten :)
Is it possible to add Venlo to the list?
any idea to use https://www.mijnafvalwijzer.nl/nl/3825AL/41
This site has all data in a unified format for some Dutch gemeenten
Hi,
Can you add Reinis?
It's a local wastecollector for Nissewaard (Spijkenisse and a numberous small villages)
Reinis uses API: https://wasteapi.2go-mobile.com/api/GetCalendar
which is also used for other wastecollectors:
barAfvalbeheer
twentemilieu
hellendoorn
almere
It is working on rooted Toon's so you might be able to extract data from that app:
https://github.com/ToonSoftwareCollective/wastecollection/blob/master/WastecollectionApp.qml
Could you please add Helmond to the app?
Would be great if you could add de Fryske Marren
Content can be received from (example):
https://www.afvalalert.nl/kalender/8493xx/xx/
It includes the following places:
Akmarijp
Bakhuizen
Balk
Bantega
Boornzwaag
Broek
Delfstrahuizen
Dijken
Doniaga
Echten
Echtenerbrug
Eesterga
Elahuizen
Follega
Goingarijp
Harich
Haskerhorne
Idskenhuizen
Joure
Kolderwolde
Langweer
Legemeer
Lemmer
Mirns
Nijehaske
Nijemirdum
Oldeouwer
Oosterzee
Oudega
Oudehaske
Oudemirdum
Ouwster-Nijega
Ouwsterhaule
Rijs
Rohel
Rotstergaast
Rotsterhaule
Rottum
Ruigahuizen
Scharsterbrug
Sint Nicolaasga
Sintjohannesga
Sloten
Snikzwaag
Sondel
Terhorne
Terkaple
Teroele
Tjerkgaast
Vegelinsoord
Wijckel
Je hebt er voor gekozen om restafval onder afvalstroom 92 te labelen. Maar dit klopt eigenlijk niet. Het restafval in de gemeente sliedrecht wordt op centrale plaatsen (ondergrondse containers) verzameld.
Afvalstroom 92 is bedoeld voor plastic, blik en drankkarton (met zo'n zilverachtige laag er in). Wellicht dat je dit wilt aanpassen?
Verder super tof dat een mede-Sliedrechter hier werk van heeft gemaakt!
Allereerst bedankt voor het toevoegen van Vianen (vijfherenlanden)
Ik gebruikte voorheen Garbage-Collection met Garbage-Collection-card, nadeel daarvan was dat je handmatig de datums van ophalen moest invullen, geen api dus en vooral met feestdagen niet nauwkeurig, maar je had wel het voordeel dat je het zo kon instellen dat hij x aantal dagen van te voren weergaf wat er opgehaald werd. (was zelf in te stellen) de rest liet hij niet zien. ook kon je verschillende icons en kleuren toe voegen.
Dat was een mooie oplossing. Is het mogelijk dat we bij afvalinfo ook zoiets kunnen verwachten?
Dan zou het helemaal een perfecte toevoeging zijn.
I am missing the gft for Westerkwartier. It is mostly collected in the week that "restafval" is not collected, but not necessary on the same day of the week.
The pbd sensor does not work for DeAfvalApp because DeAfvalApp uses afvaltype plastic instead of pdb. I don't know if it's the case for every locotion but it is for loacation Kerkdriel.
Waste collection site of municipality Haarlemmermeer, of which Boesingheliede is a part (buurtschap):
https://afvalkalender.meerlanden.nl/
Hi,
You'd be my hero if you could add the calender for Oud-Beijerland.
Thanks!
SirRene
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.