Skip to content

Stadtreinigung Hamburg - get garbage collection dates in Hamburg - custom component for Home Assistant

License

Notifications You must be signed in to change notification settings

fabsenet/sensor.stadtreinigung_hamburg

 
 

Repository files navigation

Stadtreinigung Hamburg

Stadtreinigung Hamburg Custom Component

Code style: black Code style: black Hamburg Open Issues Release


This component will set up the following sensors

  • schwarze Restmülltonne
  • blaue Papiertonne
  • gelbe Wertstofftonne/-sack
  • grüne Biotonne
  • Weihnachtsbäume
  • Laubsäcke

The state of these sensors will be the next collection date.

example

Installation

  1. Using the tool of choice open the directory (folder) for your HA configuration (where you find configuration.yaml).
  2. If you do not have a custom_components directory (folder) there, you need to create it.
  3. In the custom_components directory (folder) create a new folder called stadtreinigung_hamburg.
  4. Download all the files from the custom_components/stadtreinigung_hamburg/ directory (folder) in this repository.
  5. Place the files you downloaded in the new directory (folder) you created.
  6. Restart Home Assistant
  7. In the HA UI go to "Configuration" -> "Integrations" click " " and search for "Stadtreinigung Hamburg"

Examples

Below are some use cases for this sensor

Binary Sensor: Garbage Collection Tomorrow

The binary_sensor will be on if the collection is tomorrow:

binary_sensor:
  - platform: template
    sensors:
      srh_morgen_sesamstrasse_blau:
        friendly_name: "blaue Papiertonne (morgen)"
        value_template: >-
          {% set collection = as_timestamp(states.sensor.stadtreinigung_hamburg_sesamstrasse_blaue_papiertonne.state)|timestamp_custom("%Y-%m-%d") %}
          {% set tomorrow = (as_timestamp(now())   86400)|timestamp_custom("%Y-%m-%d") %}
          {{ collection == tomorrow }}

Do you have some other examples? Make a PR and add it here.

Contributions are welcome!

If you want to contribute to this, please read the Contribution guidelines

About

Stadtreinigung Hamburg - get garbage collection dates in Hamburg - custom component for Home Assistant

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%