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
1234ABformat - HACS installed in Home Assistant
Installation
- Open HACS in Home Assistant and go to Integrations.
- Click the three-dot menu (top right) → Custom repositories.
- Add
https://github.com/peternijssen/ha-postcodeloterijas an Integration. - Search for Postcodeloterij and install it.
- 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
| Property | Value |
|---|---|
| State | Number of prizes won |
| Unit | prizes |
| Icon | mdi:trophy |
Attributes:
| Attribute | Description |
|---|---|
prizes | List of prize names won |
period | The month results are for, e.g. 04-2026 |
prize_img_url | Image URL for the main prize |
prize_description | Plain-text description of the prize |
prize_more_info_url | Link 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: highNote: 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.