Skip to content

Instantly share code, notes, and snippets.

@osro
Created December 30, 2025 09:04
Show Gist options
  • Select an option

  • Save osro/77e44375e8608ae28487f1110290498c to your computer and use it in GitHub Desktop.

Select an option

Save osro/77e44375e8608ae28487f1110290498c to your computer and use it in GitHub Desktop.
Home Assistant Postin jakelu
# HA REST sensor
# https://www.home-assistant.io/integrations/rest/
rest:
- resource: "https://www.posti.fi/maildelivery-api-proxy/?q=45360" # tähän oma postinumero
method: GET
scan_interval: 21600 # 6h, muuta jos haluat
sensor:
- name: "Posti jakelupaivat"
unique_id: posti_jakelupaivat_0"
value_template: "ok"
json_attributes:
- postalCode
- deliveryDates
# HA Binary sensor
# Asetukset -> Laitteet ja palvluet -> Apurit -> Luo Apuri -> Template -> Binary Sensor
# Keksi joku kiva nimi sensorille ja lisää tämä "States" kohtaan
{% set dates = state_attr('sensor.posti_jakelupaivat', 'deliveryDates') %}
{{ dates is not none and (now().date().isoformat() in dates) }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment