Prepaid Meter Counter for Home Assistant

Hi Guys

I posted a tutorial video onto Youtube on setting up a Prepaid Meter balance counter in Home Assistant.

This is based on a KellerZA post on the Powerforum and I decided to make a video as it seemed problematic to get set up properly.

It uses the Total Grid Import sensor from your inverter to keep track of your usage. It records the current sensor reading when you capture your current prepaid meter balance and then deducts your usage from your balance.

It will then alert you when the balance is running low so that you don’t run out of power on your prepaid meter.

Please let me know what you guys think :slight_smile:

1 Like

Cool Idea , @plonkster is there a way that we can pull the grid usage from the modbus to achieve similar results?

Need way more context to answer this question. What hardware is involved, is this in a Victron system or something else? In such a system, yes, you can poll energy counters over modbus.

Fair enough :slight_smile: .
So the basic principal is that you log your current prepaid meter reading against the current grid import kWh reading. Thereafter you deduct the difference of the current grid import reading and the logged reading against the Prepaid reading to give you an estimate units left.
So does Victron have a running grid import kWh reading?
So far I got this reading on Venus OS large ,
Currently stored selection:

  • MultiPlus 48/5000/70-100
  • Energy ACIn1 to AcOut (kWh)

But the value on my system seems to be to low (87.7) to be a running reading unless there has been a roll over.

Indeed. This is usually a lot easier if you just use an energy meter. Then you can just use register 2603 on the correct address, and you have a running energy meter.

If you want to use the Multi, it gets a bit more complex. You will have to sum registers 74 and 76 (again, look up the right modbus address using the modbus “available devices” page on the GUI). And this is further complicated because the energy counters in the Multi is volatile. They reset to zero when the Multi restarts.

The way this is handled internally, is to take a snapshot of the “baseline” counters every 15 minutes, and work from that. So you calculate the “delta” usage in every 15 minute slot, and these deltas added together eventually gives you your total consumption. Turning off the Multi therefore, on average, results in about 7 minutes of lost energy use.

It is significantly easier to do this with an energy meter :slight_smile:

If you have a three phase supply, and your energy is measured as the integral of the sum or the power over the phases (aka vector registration), then you have no choice, you must use an energy meter anyway. Assuming a single phase supply… you can ignore this last bit.

Not really worth getting an energy meter just to “track” the prepaid meter. Will look for an alternative option. It just playing as it is now :wink:

Hi @Paul

You have a Victron I assume?

Unfortunately I have no experience with connecting HA to the Victron’s but if you are using an ESP32 you could do the calculations on the ESP32 and keep the running prepaid balance there.

Interesting idea , could you possibly elaborate?

You could also just pull the energy data from VRM, using the API, and calculate it using that. Have not used it much, but you could probably use the installation stats call for this.

You probably want to look at existing efforts to start.