Posted in

Postcode Loterij Sensor Integration

Updated May 2026: the integration is now installable via HACS with a UI config flow. No YAML required.

The Postcodeloterij is a Dutch lottery where your postal code is your ticket number. With this Home Assistant integration you can automatically check whether your postcode has won a prize each month and get a push notification the moment results are in.

What You Need

  • A Dutch postcode in 1234AB format
  • HACS installed in Home Assistant

Installation

  1. Open HACS in Home Assistant and go to Integrations.
  2. Click the three-dot menu (top right) → Custom repositories.
  3. Add https://github.com/peternijssen/ha-postcodeloterij as an Integration.
  4. Search for Postcodeloterij and install it.
  5. Restart Home Assistant.

Configuration

Go to Settings → Devices & Services → Add Integration and search for Postcodeloterij. Enter your postcode in 1234AB format. The integration validates the format and tests the API connection before saving. You can add the integration multiple times if you want to track more than one postcode.

Sensor

The integration creates one sensor per postcode:

sensor.postcodeloterij_1234ab

PropertyValue
StateNumber of prizes won
Unitprizes
Iconmdi:trophy

Attributes:

AttributeDescription
prizesList of prize names won
periodThe month results are for, e.g. 04-2026
prize_img_urlImage URL for the main prize
prize_descriptionPlain-text description of the prize
prize_more_info_urlLink to more information about the prize

The integration always checks the previous calendar month — prize results are published around the 1st of the following month. It polls every 12 hours.

Automation

What’s the fun in winning if you don’t get notified? Here’s a simple automation that checks the sensor on the 2nd day of each month at 14:00 and sends a notification if you’ve won something.

automation:
  - id: postcodeloterij
    alias: "Postcodeloterij: Prijs"
    initial_state: "on"
    trigger:
      platform: time
      at: "14:00:00"
    condition:
      - "{{ now().day == 2 }}"
      - "{{ states('sensor.postcodeloterij_1234ab') | int(0) > 0 }}"
    action:
      action: notify.all_devices
      data:
        title: "Postcodeloterij uitslag"
        message: "{{ state_attr('sensor.postcodeloterij_1234ab', 'prize_description') }}"
        data:
          clickAction: "{{ state_attr('sensor.postcodeloterij_1234ab', 'prize_more_info_url') }}"
          image: "{{ state_attr('sensor.postcodeloterij_1234ab', 'prize_img_url') }}"
          ttl: 0
          priority: high

Note: If your prize count doesn’t change month-to-month (e.g., you win twice in a row), you’ll still get notified on the 2nd. It’s the earliest possible moment after most updates.

Conclusion

The integration is one of those small additions that just runs quietly in the background until the day it actually matters. Install it once, forget about it, and let Home Assistant do the checking for you.

Leave a Reply

Your email address will not be published. Required fields are marked *