Lass dir die Auslastung oder Verfügbarkeit deiner Packstation in Home Assistant anzeigen.
Dank der zugänglichen DHL API ist es kein Problem die Daten innerhalb in Home Assistant zu verarbeiten.
Die Daten werden per Restful Sensoren abgeholt, pro Tag wird ein Sensor angelegt.
Ihr benötigt lediglich einen Account unter https://developer.dhl.com und einen API Key. Anschließend könnt ihr die ID der Packstation per Location Endpoint abfragen.
Wahlweise können diese angezeigt pro Tag angezeigt werden, oder innerhalb einer Mushroom Template Card nur den heutigen Tag angezeigt werden.
Nutzt gerne die Möglichkeiten innerhalb von Github und optimiert meine ersten Versuche die Daten möglichst kompakt und dynamisch anzuzeigen.
Viel Spaß mit der Nutzung. Und danke an DHL für die API die der Öffentlichkeit zur Verfügung steht.
Mushroom Template Card:
#Dashboard Cards
type: entities
entities:
- entity: sensor.dhl_packstation_monday
- entity: sensor.dhl_packstation_tuesday
- entity: sensor.dhl_packstation_wednesday
- entity: sensor.dhl_packstation_thursday
- entity: sensor.dhl_packstation_friday
- entity: sensor.dhl_packstation_saturday
- entity: sensor.dhl_packstation_sunday
title: Packstation Auslastung
state_color: true
type: custom:mushroom-template-card
primary: Auslastung Packstation
secondary: "\n {% if 'monday' == now().strftime('%A')|lower %} \n {{states(\"sensor.dhl_packstation_monday\")}}\n {% elif 'tuesday' == now().strftime('%A')|lower %} \n {{states(\"sensor.dhl_packstation_tuesday\")}}\n {% elif 'wednesday' == now().strftime('%A')|lower %} \n {{states(\"sensor.dhl_packstation_wednesday\")}}\n {% elif 'thursday' == now().strftime('%A')|lower %} \n {{states(\"sensor.dhl_packstation_thursday\")}}\n {% elif 'friday' == now().strftime('%A')|lower %} \n {{states(\"sensor.dhl_packstation_friday\")}} \n {% elif 'saturday' == now().strftime('%A')|lower %} \n {{states(\"sensor.dhl_packstation_saturday\")}} \n {% elif 'sunday' == now().strftime('%A')|lower %} \n {{states(\"sensor.dhl_packstation_sunday\")}} \_\n {% endif %}"
icon: mdi:mail
tap_action:
action: more-info
icon_color: |2-
{% if 'monday' == now().strftime('%A')|lower and is_state('sensor.dhl_packstation_monday', 'Sehr Hoch') %}
red
{% elif 'monday' == now().strftime('%A')|lower and is_state('sensor.dhl_packstation_monday', 'Hoch') %}
orange
{% elif 'monday' == now().strftime('%A')|lower and is_state('sensor.dhl_packstation_monday', 'Niedrig') %}
green
{% elif 'tuesday' == now().strftime('%A')|lower and is_state('sensor.dhl_packstation_tuesday', 'Sehr Hoch') %}
red
{% elif 'tuesday' == now().strftime('%A')|lower and is_state('sensor.dhl_packstation_tuesday', 'Hoch') %}
orange
{% elif 'tuesday' == now().strftime('%A')|lower and is_state('sensor.dhl_packstation_tuesday', 'Niedrig') %}
green
{% elif 'wednesday' == now().strftime('%A')|lower and is_state('sensor.dhl_packstation_wednesday', 'Sehr Hoch') %}
red
{% elif 'wednesday' == now().strftime('%A')|lower and is_state('sensor.dhl_packstation_wednesday', 'Hoch') %}
orange
{% elif 'wednesday' == now().strftime('%A')|lower and is_state('sensor.dhl_packstation_wednesday', 'Niedrig') %}
green
{% elif 'thursday' == now().strftime('%A')|lower and is_state('sensor.dhl_packstation_thursday', 'Sehr Hoch') %}
red
{% elif 'thursday' == now().strftime('%A')|lower and is_state('sensor.dhl_packstation_thursday', 'Hoch') %}
orange
{% elif 'thursday' == now().strftime('%A')|lower and is_state('sensor.dhl_packstation_thursday', 'Niedrig') %}
green
{% elif 'friday' == now().strftime('%A')|lower and is_state('sensor.dhl_packstation_friday', 'Sehr Hoch') %}
red
{% elif 'friday' == now().strftime('%A')|lower and is_state('sensor.dhl_packstation_friday', 'Hoch') %}
orange
{% elif 'friday' == now().strftime('%A')|lower and is_state('sensor.dhl_packstation_friday', 'Niedrig') %}
green
{% elif 'saturday' == now().strftime('%A')|lower and is_state('sensor.dhl_packstation_saturday', 'Sehr Hoch') %}
red
{% elif 'saturday' == now().strftime('%A')|lower and is_state('sensor.dhl_packstation_saturday', 'Hoch') %}
orange
{% elif 'saturday' == now().strftime('%A')|lower and is_state('sensor.dhl_packstation_saturday', 'Niedrig') %}
green
{% elif 'sunday' == now().strftime('%A')|lower and is_state('sensor.dhl_packstation_sunday', 'Sehr Hoch') %}
red
{% elif 'sunday' == now().strftime('%A')|lower and is_state('sensor.dhl_packstation_sunday', 'Hoch') %}
orange
{% elif 'sunday' == now().strftime('%A')|lower and is_state('sensor.dhl_packstation_sunday', 'Niedrig') %}
green
{% endif %}
picture: ''
fill_container: true
layout: vertical
multiline_secondary: true
Configuration.yaml
rest:
- resource: 'https://api.dhl.com/location-finder/v1/locations/888-location-id'
scan_interval: 240
headers:
DHL-API-Key: your-api-key
sensor:
- name: "DHL Packstation Monday"
value_template: >-
{% if value_json.averageCapacityDayOfWeek[0].capacity == 'very-low' %}
Sehr Hoch
{% elif value_json.averageCapacityDayOfWeek[0].capacity == 'low' %}
Hoch
{% elif value_json.averageCapacityDayOfWeek[0].capacity == 'high' %}
Niedrig
{% else %}
Unbekannt
{% endif %}
unique_id: dhl_packstation_penny_monday
- name: "DHL Packstation Tuesday"
value_template: >-
{% if value_json.averageCapacityDayOfWeek[1].capacity == 'very-low' %}
Sehr Hoch
{% elif value_json.averageCapacityDayOfWeek[1].capacity == 'low' %}
Hoch
{% elif value_json.averageCapacityDayOfWeek[1].capacity == 'high' %}
Niedrig
{% else %}
Unbekannt
{% endif %}
unique_id: dhl_packstation_penny_tuesday
- name: "DHL Packstation Wednesday"
value_template: >-
{% if value_json.averageCapacityDayOfWeek[2].capacity == 'very-low' %}
Sehr Hoch
{% elif value_json.averageCapacityDayOfWeek[2].capacity == 'low' %}
Hoch
{% elif value_json.averageCapacityDayOfWeek[2].capacity == 'high' %}
Niedrig
{% else %}
Unbekannt
{% endif %}
unique_id: dhl_packstation_penny_wednesday
- name: "DHL Packstation Thursday"
value_template: >-
{% if value_json.averageCapacityDayOfWeek[3].capacity == 'very-low' %}
Sehr Hoch
{% elif value_json.averageCapacityDayOfWeek[3].capacity == 'low' %}
Hoch
{% elif value_json.averageCapacityDayOfWeek[3].capacity == 'high' %}
Niedrig
{% else %}
Unbekannt
{% endif %}
unique_id: dhl_packstation_penny_thursday
- name: "DHL Packstation Friday"
unique_id: dhl_packstation_penny_friday
value_template: >-
{% if value_json.averageCapacityDayOfWeek[4].capacity == 'very-low' %}
Sehr Hoch
{% elif value_json.averageCapacityDayOfWeek[4].capacity == 'low' %}
Hoch
{% elif value_json.averageCapacityDayOfWeek[4].capacity == 'high' %}
Niedrig
{% else %}
Unbekannt
{% endif %}
- name: "DHL Packstation Saturday"
value_template: >-
{% if value_json.averageCapacityDayOfWeek[5].capacity == 'very-low' %}
Sehr Hoch
{% elif value_json.averageCapacityDayOfWeek[5].capacity == 'low' %}
Hoch
{% elif value_json.averageCapacityDayOfWeek[5].capacity == 'high' %}
Niedrig
{% else %}
Unbekannt
{% endif %}
unique_id: dhl_packstation_penny_saturday
- name: "DHL Packstation Sunday"
value_template: >-
{% if value_json.averageCapacityDayOfWeek[6].capacity == 'very-low' %}
Sehr Hoch
{% elif value_json.averageCapacityDayOfWeek[6].capacity == 'low' %}
Hoch
{% elif value_json.averageCapacityDayOfWeek[6].capacity == 'high' %}
Niedrig
{% else %}
Unbekannt
{% endif %}
unique_id: dhl_packstation_penny_sunday
Das Gezeigte brachte mich ans Ziel - bin mir aber sicher, dass der ein oder andere eindeutiges Verbesserungspotential sehen kann