Open hilsonp opened 2 years ago
You could do that with a template sensor. But I'll think about including the next-up sensor in this integration. But I'm struggling to see how useful this sensor would be..
As you see, I keep on my dashboard a fold-entity-row that allows me, in a tap, to see the next collect day/date. I would like to see, when folded, the next collect(s).
Maybe you are right, the "morgen" entity should suffice... I'll see.
I'll go the template route and will post here if anyone else is interested.
So. Here what I did:
A template sensor:
- name: "Prochaine collecte"
state: >
{%- if now() > today_at("10:15") -%}
{%- set next_collect = {
"moment": "Demain: ",
"garbage_items": states("sensor.recycleapp_morgen")
}
-%}
{% else %}
{%- set next_collect = {
"moment": "Aujourd'hui: ",
"garbage_items": states("sensor.recycleapp_vandaag")
}
-%}
{%- endif -%}
{%- if next_collect.garbage_items == 'None' -%}
{%- set next_collect = {
"moment": "",
"garbage_items": "Aucune"
}
-%}
{%- endif -%}
{{ next_collect.moment }}{{
next_collect.garbage_items
| regex_replace(find='gft', replace='Compost', ignorecase=False)
| regex_replace(find='papier', replace='Cartons', ignorecase=False)
| regex_replace(find='pmd', replace='PMC', ignorecase=False)
| regex_replace(find='restafval', replace='Grise', ignorecase=False)
}}
icon: >
{% if states("sensor.prochaine_collecte") is match("Demain", ignorecase=False) %}
mdi:delete
{% elif states("sensor.prochaine_collecte") is match("Aujourd'hui", ignorecase=False) %}
mdi:delete-circle
{% else %}
mdi:delete-empty
{% endif %}
An entity card:
entities:
- type: custom:auto-entities
filter:
include:
- entity_id: sensor.recycleapp_*
exclude:
- entity_id: sensor.recycleapp_morgen
- entity_id: sensor.recycleapp_vandaag
- entity_id: sensor.recycleapp_textiel
sort:
method: attribute
attribute: Sort_date
card:
type: custom:fold-entity-row
head:
entity: sensor.prochaine_collecte
name: Poubelles
tap_action:
action: fire-dom-event
fold_row: true
Here are 2 examples:
Closed (default) with collection of 2 items today (displayed like this until 10am):
Opened (when we tap on it) with no collection (as displayed after 10am):
Hi there! I would like the next up sensor also. With the possibility to have multiple and to have the terms today and tomorrow in it.
Examples: (today is the 6th of june)
Next up: Papier on june 10th
Next up: Tomorrow, june 7th is Papier
Next up: Today is Papier or if today and tomorrow there is pickups: Next up: Today is Papier, Tomorrow, june 7th is GFT and Restafval
I think having the possibility for a next up in HA is great for (week) planning. Besides, I have 3 bins, I don't want to display all 3 of them on the same time on my dashboard.
The "morgen" and "vandaag" sensors are great to set alerts/notifications. Nevertheless, I would love having a "volgende" sensor that would have as state:
- "none": if no schedule can be found
- "date: ressource, ressource, ..." with the date being the next date where a collect is found, then the list of ressources collected on that day (like the morgen and vandaag sensors display)
Here is a card I did that would be even better if the "head" entity was showing the next scheduled collect: `type: entities entities:
- type: custom:auto-entities filter: include:
- entityid: sensor.recycleapp* exclude:
- entity_id: sensor.recycleapp_morgen
- entity_id: sensor.recycleapp_vandaag
- entity_id: sensor.recycleapp_textiel sort: method: attribute attribute: Sort_date card: type: custom:fold-entity-row head: entity: sensor.recycleapp_vandaag tap_action: action: fire-dom-event fold_row: true`
Could you please provide how you set up an alert/notification. I have tried this but I don't get any
The "morgen" and "vandaag" sensors are great to set alerts/notifications. Nevertheless, I would love having a "volgende" sensor that would have as state:
Here is a card I did that would be even better if the "head" entity was showing the next scheduled collect: `type: entities entities: