Skip to content

Days to collection Sensor #51

@torsti09

Description

@torsti09

Hey!
First of all, thanks for this nice integration.

I've build a sensor in configuration for display how many days until colletion date.
Feel free to use it, too.

template:
  - sensor:
      - name: "Abholung Restmüll"
        unique_id: "abholung_restmuell"
        unit_of_measurement: "Days"
        icon: mdi:trash-can
        state: >
            {% set days_to = (((as_timestamp(strptime(states('sensor.restabfall'), "%Y-%m-%d")))  - as_timestamp(now())) / 86400) | round(0, "ceil", default)%}
            {% if days_to == 0 %}Heute{% elif days_to == 1 %}Morgen{% else %}in {{days_to}} Tagen{% endif %}

Greetings
torsti09

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions