A prepaid meter’s units counted down from the grid import your inverter or energy meter already measures.
Made for South African prepaid meters, but it counts kWh, not money, so it works whatever the tariff or supplier.
- Units left in a Number helper you can put on any dashboard.
- One warning when they run low, and again only after the next token.
- A recharge is simply setting the helper to the meter’s reading after loading a token; a message confirms it.
Why it is built this way:
- It works from the import reading itself, with a mark in a second helper, so a restart or a stretch offline loses
nothing: the use in between is counted at the next reading. - A daily import counter (back to 0 at midnight) works as well as a lifetime one.
- It writes in steps (0.1 kWh), not on every reading, to keep the database small.
- A jump too big to be use (a meter swapped, a bad reading) is not taken off; the message says so.
A metro that takes a fixed daily charge from the units makes the count drift: correct it from the meter now and then.
Setup: two Number helpers (“Prepaid units”, “Prepaid import mark”), import the blueprint, pick the grid import sensor
and the helpers, set the units from the meter. Details and 6 tests: GitHub - Pr0t3ct0r/ha-sa-solar-blueprints · GitHub