nice, will test and report back if this is what I hope it is. Will see tomorrow
thanks!
would there also be a way to have a sensor.trash_day_after_tomorrow? I ask because the website shows these ‘overmorgen’ pickups.
in our municipality, there’s always pickup in pairs per week, and on the first day of that pickup, ‘overmorgen’ is available too. Don’t think it is a template made on the trash_next, like my handmade below but a true scrape for ‘overmorgen’.
afval_overmorgen:
friendly_name: Afval overmorgen
value_template: >
{% if states('sensor.trash_next') == '2' %}
{{states('sensor.trash_firstwastetype')}}
{% else %} Geen
{% endif %}
entity_picture_template: >
{% set mapper = {'Papier': '/local/mijnafvalwijzer/papier.png',
'Groente, Fruit en Tuinafval': '/local/mijnafvalwijzer/gft.png',
'Plastic verpakkingsafval': '/local/mijnafvalwijzer/plastic.png',
'Restafval': '/local/mijnafvalwijzer/restafval.png'} %}
{% set state = states('sensor.afval_overmorgen') %}
{{ mapper[state] if state in mapper else '/local/mijnafvalwijzer/kliko_geen.png' }}
and customize:
sensor.afval_overmorgen:
templates:
theme: >
if (state === 'Papier') return 'blue';
if (state === 'Groente, Fruit en Tuinafval' ) return 'green';
if (state === 'Plastic verpakkingsafval') return 'orange';
if (state === 'Restafval') return 'black';
return 'grey';
the seems to have killed the trash_today, which doesn’t show correctly anymore, while sensor.trash_firstdate == ‘vandaag’.
changed it back to if value_date >= today_date: makes it popup immediately again, but unfortunately also give me back the reason I asked… Now how can we have the dates shift, and still have a valid sensor.trash_today?
check this please, which is related. .firsttrashtype is seen as todays trash:
afval_overmorgen:
friendly_name: Afval overmorgen
value_template: >
{% if states('sensor.trash_next') == '2' %}
{{states('sensor.trash_firstwastetype')}}
{% else %} Geen
{% endif %}
entity_picture_template: >
{% set mapper = {'Papier': '/local/mijnafvalwijzer/papier.png',
'Groente, Fruit en Tuinafval': '/local/mijnafvalwijzer/gft.png',
'Plastic verpakkingsafval': '/local/mijnafvalwijzer/plastic.png',
'Restafval': '/local/mijnafvalwijzer/restafval.png'} %}
{% set state = states('sensor.afval_overmorgen') %}
{{ mapper[state] if state in mapper else '/local/mijnafvalwijzer/kliko_geen.png' }}
might be the afvalwijzer doest update the nexttrashtype on a pickup day, but ultimately I am looking for a way to have todays trash, tomorrows trash and day after tomorrow…
which is all there:
maybe we have to combine things, like on a pickup day, compare the dates for day after tomorrow… still, I have hope you can find a way to find ‘overmorgen’ on the afvalwijzer.nl page and scare that somehow.
Yesterday i installed everyting and it was working well.
Since today it’s showing ‘Geen’ and i think it’s getting no data.
The website afvalwijzer is working.
When i look at the logs it says for all the sensors:
update for sensor.trash_today fails
More people with this problem?
Wed Feb 20 2019 18:47:16 GMT+0100 (West-Europa (standaardtijd))
Update for sensor.trash_firstdate fails
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py”, line 221, in async_update_ha_state
await self.async_device_update()
File “/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py”, line 349, in async_device_update
await self.hass.async_add_executor_job(self.update)
File “/usr/local/lib/python3.6/concurrent/futures/thread.py”, line 56, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/custom_components/sensor/mijnafvalwijzer.py”, line 135, in update
for item in self.data.data:
TypeError: ‘NoneType’ object is not iterable
Update: the output has changed from mijnafvalwijzer.nl. The output now contains a lot of spaces. As a workaround I`m stripping all spaces from the output so this error won’t occur again.
@xirixiz
HI,
minutes after posting my question above, my sensors where gone, apparently the change kicked in.
Updated to 2.07, and now get this for all sensors:
Update for sensor.trash_ fails
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 221, in async_update_ha_state
await self.async_device_update()
File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 349, in async_device_update
await self.hass.async_add_executor_job(self.update)
File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/sensor/mijnafvalwijzer.py", line 137, in update
for item in self.data.data:
TypeError: 'NoneType' object is not iterable
anything else we need to change in the setup to get it back working again?
Hi, for me it’s working fine. However some people are still experiencing issues. What I need is a postcal code and housenumber in your region so I can debug what causes the problem. Can you provide me that (pm otherwise).
Update for sensor.trash_gft fails
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 221, in async_update_ha_state
await self.async_device_update()
File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 349, 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/mijnafvalwijzer/sensor.py", line 137, in update
for item in self.data.data:
TypeError: 'NoneType' object is not iterable
I think I`m going to switch back to json anyway, scraping mijnafvalwijzer is way to messy. Fingers crossed mijnafvalwijzer won’t complain again about this component. If so, I’ll discontinue this component. Tomorrow evening I have all night to fix this!
btw, if Saver or Afvalwijzer complain again this service is only for paying customers, there are 2 points to be made:
we all pay for this service, and rather directly, by means of the municipal contracts that have been agreed on. Not as a general tax, but as a direct, service contract paying for the services delivered.
based on European GDPR law, AVG Dutch, they might have a hard time denying customers access to their own data…