Garbage pickup date (mijnafvalwijzer.nl) custom_component

I have a little problem with showing the first next item.
The sensor sensor.trash_first_next_item only shows one item, but there are two pickups at that day (wo 17 jun).
Is there any way to show them both, instead of ‘restafval’, ‘restafval, gft’, just like sensor.trash_tomorrow does?

1 Like

I’d like to fix this, but I need your postal code and housenumber in order to simulate this.

Can you provide this? Or else provide a postal code and housenumber in the same neighbourhood with the same pickup dates. You can PM me.

Thanks for helping! Sent a PM.

Tested and fixed in release 4.3.0

image

2 Likes

It is working, thanks!

1 Like

Any chance anyone can put all this information in a custom card (like the darksky weather card)?
I’m not so good with the code editor.

@xirixiz have you read this note?
I am also struggling with this part.

Would be nice to get that solve in some kind of way

anyone else suddenly seeing this too:

do we have a bug, a Saver issue, or has the trash type been changed?? My regular Saver app still shows GFT, so I dont understand what’s happening here…

thanks for having a look!

Trash type has changed :wink:

Hi @xirixiz

Haven’t checked in the source code myself yet, but would it at all be possible to add the ‘Nieuws’ to a sensor ?

Not grabbing the app daily myself, this would seem a nice addition to the integration?

This add on seems to break my HA when installing through HACS. It appears to be overwriting/removing/replacing files in the “custom_components” directory and as a result HACS is corrupted causing HA to throw a fit when starting. Tried this on 2 individual HA installs and both ran into problems.

Anybody else facing this?

Same for me… When I put the sensor to my configuration.yaml and restart HA, the lovelace UI won’t load anymore. After reboot of ubuntu server and restart all HA containers in portainer, it works again. But I don’t get the sensors in HA.

It does seem to work correctly when installing manually. Sensor appeared and are providing me with the desired info

Can irado be added? https://www.irado.nl/bewoners/afvalkalender

Can anyone explain to me how the sensor.trash_color is built? I am trying to get the type of waste in its own color in text, however, it always turns out grey.

anyone else seeing huge amounts of errors in the log today on afvalwijzer?

Thing is, it is completely blocking the correct startup procedure, HA hanging in 'Starting up ’ forever, and most of the Lovelace frontend showing the yellow bars…

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/asyncio/runners.py", line 43, in run
    return loop.run_until_complete(main)
  File "/usr/local/lib/python3.8/asyncio/base_events.py", line 603, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.8/asyncio/base_events.py", line 570, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.8/asyncio/base_events.py", line 1859, in _run_once
    handle._run()
  File "/usr/local/lib/python3.8/asyncio/events.py", line 81, in _run
    self._context.run(self._callback, *self._args)
  File "/config/custom_components/afvalwijzer/sensor.py", line 63, in async_setup_platform
    afvaldienst = await hass.async_add_executor_job(
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.8/site-packages/Afvaldienst/Afvaldienst.py", line 43, in __init__
    self._jsonData = self.__get_data_json()
  File "/usr/local/lib/python3.8/site-packages/Afvaldienst/Afvaldienst.py", line 53, in __get_data_json
    raise SystemExit('No JSON data received from ' + jsonUrl)
SystemExit: No JSON data received from https://json.mijnafvalwijzer.nl/?method=postcodecheck&postcode=

times xxx

isn’t some error trap built in the library yet, so this could simply fail and return to the system?

can only revert to a ‘ha host reboot’

I can confirm this.
At 13:11 my Home Assistant went down with no apparent reason.
Renamed the afvalwijzer folder in the custom_components folder and it’s working again.
Log was full of this:

Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity.py”, line 263, in async_update_ha_state
await self.async_device_update()
File “/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity.py”, line 439, in async_device_update
await self.parallel_updates.acquire()
File “/usr/lib/python3.7/asyncio/locks.py”, line 474, in acquire
await fut
concurrent.futures._base.CancelledError
2020-09-10 13:11:11 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.trash_restafval fails
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.7/site-packages/Afvaldienst/Afvaldienst.py”, line 51, in __get_data_json
jsonResponse = requests.get(jsonUrl).json()
File “/srv/homeassistant/lib/python3.7/site-packages/requests/models.py”, line 898, 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)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/lib/python3.7/asyncio/runners.py”, line 43, in run
return loop.run_until_complete(main)
File “/usr/lib/python3.7/asyncio/base_events.py”, line 574, in run_until_complete
self.run_forever()
File “/usr/lib/python3.7/asyncio/base_events.py”, line 541, in run_forever
self._run_once()
File “/usr/lib/python3.7/asyncio/base_events.py”, line 1786, in _run_once
handle._run()
File “/usr/lib/python3.7/asyncio/events.py”, line 88, in _run
self._context.run(self._callback, *self._args)
File “/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity.py”, line 263, in async_update_ha_state
await self.async_device_update()
File “/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity.py”, line 454, in async_device_update
await self.async_update() # type: ignore
File “/home/homeassistant/.homeassistant/custom_components/afvalwijzer/sensor.py”, line 130, in async_update
await self._hass.async_add_executor_job(self._fetch_trash_data.update)
File “/usr/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/srv/homeassistant/lib/python3.7/site-packages/homeassistant/util/init.py”, line 239, in wrapper
result = method(*args, **kwargs)
File “/home/homeassistant/.homeassistant/custom_components/afvalwijzer/sensor.py”, line 170, in update
afvaldienst = Afvaldienst(provider, zipcode, housenumber, suffix, count_today)
File “/srv/homeassistant/lib/python3.7/site-packages/Afvaldienst/Afvaldienst.py”, line 43, in init
self._jsonData = self.__get_data_json()
File “/srv/homeassistant/lib/python3.7/site-packages/Afvaldienst/Afvaldienst.py”, line 53, in __get_data_json
raise SystemExit('No JSON data received from ’ + jsonUrl)
SystemExit: No JSON data received from https://json.mijnafvalwijzer.nl/?method=postcodecheck&postcode=1234AB&street=&huisnummer=11&toevoeging=&langs=nl

Yes, seeing the same messages as of today. Had to disable the custom component, otherwise my HA was not reachable…

The response of the query is empty for me.

quick fix here: https://github.com/xirixiz/Home-Assistant-Sensor-Afvalwijzer/releases/tag/4.3.2

thanks @xirixiz

edit
quick fix is for the halting of the system, not for Afvalwijzer/Saver not being able to push json data…

more users getting the : Check afvaldienst platform settings ('No JSON data received from provider. Please verify the url error ?
when i manually entered the page etc. the page keeps blank