Met deze Home Assistant automatisering laadt een apparaat alleen in de goedkoopste kwartieren van de dag. Een slimme stekker gaat aan als de stroom goedkoop is en weer uit als het duurder wordt. Ideaal voor apparaten met een eigen accu die het niet uitmaakt wanneer ze laden: een steelstofzuiger, accugereedschap, een e-bike-accu of een robotmaaier in de winterstalling.
De automatisering werkt op zichzelf: ze leest de kwartierprijzen van Zonneplan direct uit en heeft geen andere sensoren nodig.
Wat de automatisering doet:
- Kiest elke dag zelf de N goedkoopste kwartieren (standaard 6, dus 1,5 uur laden)
- Zet de slimme stekker alleen aan of uit als dat nodig is, zonder onnodig te schakelen
- Valt terug op altijd aan als er geen prijzen zijn, zodat het apparaat toch laadt
- Pakt na een herstart van Home Assistant meteen de juiste stand op
Onderaan dit artikel kun je de complete, kant-en-klare YAML downloaden, met een uitgebreide PDF-handleiding. Getest met Home Assistant 2026.10.
Het gaat om één automatisering met drie instellingen bovenaan: de stekker, het aantal kwartieren en de prijssensor.
⚙️ Wat heb je nodig?
Hardware:
- Een slimme stekker die als
switchin Home Assistant staat (bijvoorbeeld Shelly Plug, een Zigbee-stekker of een ESPHome-stekker) - Een apparaat met een eigen lader en accu dat weer verder laadt als de stroom terugkomt
- Een dynamisch energiecontract bij Zonneplan
In Home Assistant:
- De integratie Zonneplan ONE met
sensor.zonneplan_current_quarter_hourly_electricity_tariff - Home Assistant 2024.10 of nieuwer
🧩 De automatisering
Automatisering: Apparaat laden op goedkoopste kwartieren
Wat doet dit: zet de slimme stekker aan in de N goedkoopste kwartieren van vandaag en daarbuiten uit.
Hoe maak je dit:
variables:
stekker: switch.slimme_stekker_1
aantal_kwartieren: 6
Elk kwartier (5 seconden na de start van het kwartier) telt de automatisering hoeveel kwartieren van vandaag goedkoper zijn dan het huidige. Is dat minder dan het ingestelde aantal, dan hoort dit kwartier bij de goedkoopste en gaat de stekker aan. Een choose schakelt alleen als de stand echt moet veranderen.
📝 Gebruikte templates
- Rangorde van het huidige kwartier — telt hoeveel kwartieren van vandaag goedkoper zijn; bij minder dan het ingestelde aantal hoort het huidige kwartier bij de goedkoopste.
- Terugval zonder prijzen — als Zonneplan geen prijs voor dit kwartier geeft, wordt
moet_aanwaar en blijft de stekker aan.
❓ Veelgestelde vragen
Voor welke apparaten is dit geschikt? Voor apparaten met een eigen lader en accu, zoals een steelstofzuiger, accugereedschap of e-bike-accu. Niet voor apparaten die na stroomuitval opnieuw met een knop gestart moeten worden.
Kan ik meerdere stekkers sturen? Ja. Maak per apparaat een kopie van de automatisering en pas bovenaan de stekker en het aantal kwartieren aan.
Wat als de goedkoopste kwartieren al voorbij zijn als ik het apparaat aansluit? Dan laadt het apparaat de volgende dag. Wil je dat niet, zet de stekker dan even handmatig aan of verhoog het aantal kwartieren.
Heb ik het pakket Goedkoopste kwartieren nodig? Nee, deze automatisering leest de prijzen zelf uit. Met het pakket kun je wel meer, zoals een eigen tijdvenster.
Wil je de goedkoopste kwartieren ook voor andere automatiseringen gebruiken? Lees dan Goedkoopste kwartieren bepalen met Zonneplan.
Hieronder kun je bovenstaande automatiseringen downloaden incl. de genoemde helpers en templates, de volledige YAML en een uitgebreide PDF-handleiding.
Let op gebruik is op eigen risico!!
Home Assistant: charge a device on the cheapest quarter hours with a smart plug
With this Home Assistant automation a device only charges during the cheapest quarter hours of the day. A smart plug turns on when electricity is cheap and off again when it gets more expensive. Ideal for devices with their own battery that don’t care when they charge: a stick vacuum, cordless tools, an e-bike battery or a robot mower in winter storage.
The automation works on its own: it reads the Zonneplan quarter-hourly prices directly and needs no other sensors.
What the automation does:
- Picks the N cheapest quarter hours every day by itself (6 by default, so 1.5 hours of charging)
- Only switches the smart plug on or off when needed, without unnecessary switching
- Falls back to always on when there are no prices, so the device still charges
- Picks up the right state right after a Home Assistant restart
At the bottom of this article you can download the complete, ready-to-use YAML with an extensive PDF guide. Tested with Home Assistant 2026.10.
It is a single automation with three settings at the top: the plug, the number of quarters and the price sensor.
⚙️ What do you need?
Hardware:
- A smart plug that is a
switchin Home Assistant (for example Shelly Plug, a Zigbee plug or an ESPHome plug) - A device with its own charger and battery that continues charging when power returns
- A dynamic energy contract with Zonneplan
In Home Assistant:
- The Zonneplan ONE integration with
sensor.zonneplan_current_quarter_hourly_electricity_tariff - Home Assistant 2024.10 or newer
🧩 The automation
Automation: Charge a device on the cheapest quarter hours
What it does: turns the smart plug on in today’s N cheapest quarter hours and off outside them.
How to build it:
variables:
stekker: switch.slimme_stekker_1
aantal_kwartieren: 6
Every quarter (5 seconds after the quarter starts) the automation counts how many of today’s quarters are cheaper than the current one. If that is less than the set number, this quarter is one of the cheapest and the plug turns on. A choose only switches when the state really has to change.
📝 Templates used
- Rank of the current quarter — counts how many of today’s quarters are cheaper; below the set number the current quarter is one of the cheapest.
- Fallback without prices — if Zonneplan gives no price for this quarter,
moet_aanbecomes true and the plug stays on.
❓ Frequently asked questions
Which devices is this suitable for? For devices with their own charger and battery, such as a stick vacuum, cordless tools or an e-bike battery. Not for devices that need a button press to restart after a power cut.
Can I control several plugs? Yes. Make a copy of the automation per device and change the plug and the number of quarters at the top.
What if the cheapest quarters have already passed when I plug in the device? Then the device charges the next day. If you don’t want that, switch the plug on manually or increase the number of quarters.
Do I need the Cheapest quarter hours package? No, this automation reads the prices itself. The package does let you do more, such as your own time window.
Want to use the cheapest quarter hours for other automations too? Read Find the cheapest quarter hours with Zonneplan.
Below you can download the automations above including the helpers and templates mentioned, the complete YAML and an extensive PDF guide.
Use at your own risk!!


Geef een reactie