Btw; Nice this blue theme. Dan you pls share?
@Pippyn thanks for your component. Can you also add some extra sensors like garbage out today and garbage out tomorrow? Now I have a nice card but really a lot of work to create any automation around this. Thanks
getting back to this, I still see use for my 2 sensors your component doesn’t provide for:
.firstDate and .firstWasteType are simply what they are named. A sensor for the next pickup date (showing Vandaag, or the next date, no further calculation needed at all), and a sensor for the first waste type.
I don’t see these in your component, without having to further template the trash sensors it currently makes.
Of course having a list of all next waste types (we now have) shows this info too, but you have to have the full view of the list, before being able to deduct it.
- type: vertical-stack
cards:
- type: custom:useful-markdown-card
content: >
Vandaag is het **<font color=green>[[ sensor.vandaag.state ]]</font>**.
Volgende afval-ophaal over **<font color=var(--secondary-text-color)>[[ sensor.trash_next.state ]]</font>** dagen:
**<font color=var(--secondary-text-color)>[[ sensor.afval_datum.state ]]</font>** : **[[ sensor.afval_soort.state ]]**
It’s very nice to have a sensor on the front page showing only which and when the first will be.
Hope you’d be willing to reconsider. I did have a look where this would fit in you CC, but didnt dare to edit here and there…My requested sensors being scrapers too, I have hopes this wouldn’t interfere with your CC?
cheers.
Cool! thank you very much!
will implement immediately.
can report its working beautifully:
# sensor.afval_datum:
sensor.trash_firstdate:
friendly_name: Afval datum
icon: mdi:calendar-check
# sensor.afval_soort:
# hidden: true
sensor.trash_firstwastetype:
friendly_name: Afval soort
templates:
entity_picture: >
if (state === 'Papier') return '/local/mijnafvalwijzer/papier.png';
if (state === 'Groente, Fruit en Tuinafval' ) return '/local/mijnafvalwijzer/gft.png';
if (state === 'Plastic verpakkingsafval') return '/local/mijnafvalwijzer/plastic.png';
if (state === 'Restafval') return '/local/mijnafvalwijzer/restafval.png';
return '/local/mijnafvalwijzer/kliko_geen.png';
regular HA:
Lovelace:
- type: vertical-stack
cards:
- type: custom:useful-markdown-card
content: >
Vandaag is het **<font color=green>[[ sensor.vandaag.state ]]</font>**.
Volgende afval-ophaal over **<font color=var(--secondary-text-color)>[[ sensor.trash_next.state ]]</font>** dagen:
**<font color=var(--secondary-text-color)>[[ sensor.trash_firstdate.state ]]</font>** : **[[ sensor.trash_firstwastetype.state ]]**
HI @xirixiz
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:
and calendar:
thanks for having a look!
btw, your new sensors are behaving very nicely! thanks again for adding those.
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?
@juggles have you seen the automation I modified recently? https://github.com/xirixiz/home-assistant-config/blob/master/readme.md
But I understand what your point is.
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?
yes please. that would be very nice.
I’ll think about it. In the meantime, if you’d really like to have this feature…
You could modify line 257 from:
if value_date >= today_date:
to:
if value_date > today_date:
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';
This is great dude! I was planning to create this myself, but then I saw your component, awesome!
I hadn’t seen that yet, but it looks pretty nice. I think I’ll change my current (to-do list based) automation for this notification based setup.
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?
I make it optional so you can choose. I`m on a holiday at the moment, but when I return I’ll draft a new release.
cool, have a good holiday ! make it a good one.
and, for when your back:
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.
this still works:
{{ now().strftime("%d-%m-%Y") ==
(as_timestamp(strptime(states('sensor.trash_papier'), "%d-%m-%Y")) -
(2 * 86400 )) | timestamp_custom("%d-%m-%Y") }}