Please allow for one more suggestion, Ill illustrate with the below screenshot. AS you can see we have the 4 sensors for trash, and the trash_today/tomorrow. It today/tomorrow are Geen the next pickups for each trash type are shown. But, and thatâs my point, when trash_today has a trash_type (and your new trash_firstdate = Today, the same 4 trash_types are displayed. Put in another way, Today is still among those 4.
Wouldnât it be possible to have these shift their pickup. Eg, today is Got in my municipality, so trash_today shows GFT. It would be very nice it the trash_gft would then show its next pickup day being february 19th:
From a UI perspective I could maybe understand this, but I would really like to the behaviour to stay as-is. Otherwise in any of my trash-type specific automations I would always have to check the specific sensor, but also if the âtodayâ and/or âtomorrowâ sensor are of the desired type.
not sure what youâre saying here? what would be your problem? glad to help if needed. canât see what trouble my suggestion would cause for any automation?
As an illustration, what automation would use the date of sensor gft, when you also have trash_today?
Currently I have some automations that check if the value of for example the âGFTâ sensor equals todays or tomorrows date. If I understand your proposal correctly, I would have to modify these automations to check if the value of the âtodayâ sensor matches the current date and then if the type is the one required for the automation. This is possible of course, but feels less clean to me because it adds an extra step in the automation. Could be a matter of preference of course
well, I think you shouldnât worry, because my suggestion doesnât touch the todays / tomorrows sensors.
to be 100% certain please post one of these automations ?
my suggestion was merely to have the trash_type sensor that is currently showing todayâs date as the next pickup date, flip to the next date for that trash_type. No use having it show the whole day, what was picked up today isnât there?
having 2 automations, (1 notification for tomorrow, 1 for today) suffices, or do you have more?
As for for the sugestion, I think you mean that if the sensor today shows trash types for today, then the trash type sensor should show the next pickup date instead of the today date/value?
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
Iâm getting the same error, I`m looking into itâŚ
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.