OpenEnergyMonitor Community

PV and night tariff + EV and immersion heater

Robert, I’m shocked you don’t know - you are the font of all knowledge on here…

BS EN 50470-1 is the standard that meters have to be built to and there are three levels of accuracy. No mention of a minimum unit of measurement though.

Interestingly, wikipedia on electricity meters says:

The accuracy is generally laid down in statute for the location in which the meter is installed. Statutory provisions may also specify a procedure to be followed should the accuracy be disputed.

The UK gov site isn’t very helpful, talks about accuracy and testing etc but not about a minimum unit of measurement, although there’s lots of mention of watt hour meters (1000imp/kWh) although we know that some are now more accurate (4000imp/kWh) → National regulation: gas and electricity meters - GOV.UK

Wikipedia continues…

For the United Kingdom, any installed electricity meter is required to accurately record the consumed energy, but it is permitted to under-read by 3.5%, or over-read by 2.5%. Disputed meters are initially verified with a check meter operating alongside the disputed meter. The final resort is for the disputed meter to be fully tested both in the installed location and at a specialist calibration laboratory. Approximately 93% of disputed meters are found to be operating satisfactorily. A refund of electricity paid for, but not consumed (but not vice versa) will only be made if the laboratory is able to estimate how long the meter has been misregistering. This contrasts with gas meters where if a meter is found to be under reading, it is assumed that it has under read for as long as the consumer has had a gas supply through it.

So never query a faulty gas meter!!

I guess we could set up a test on a smart meter?


I think you’ve completely missed the point. No-one is talking about the accuracy of the meter, but, as you point out in your second sentence

And it’s exactly that which the diverter attempts to take advantage of.

The principle of MartinR’s and Robin’s diverters is: the imported and exported energy is balanced within that “minimum unit of measurement” (your words), “energy bucket” (Robin’s words) or “quantum of energy” (my words). While that condition prevails, the meter does not register an import. When it no longer prevails, the meter registers and eventually, a charge appears on the bill.

I recommend you visit Robin’s website to refresh your knowledge about how the diverter and meter interact. He has (or had) a video where he demonstrates a Ferraris meter experiencing successive cycles of import and export while the disc moves backwards and forwards always remaining within the same arc.

And this statement

is not quite true. There is no correlation between the meter’s accuracy and the resolution offered by the increased rate of LED flashes.

Sorry Robert, what you quoted from my reply shows I haven’t - maybe just the way things are read. I thought the information about accuracy might be of interest and might be pertinent to finding out what those units are.

And if you’d been following the thread, you’d have seen that I have built a diverter based on MartinR’s design, so while it’s useful maybe for anyone else reading the thread I think I won’t be going through the theory again.

Anyway, to move things on, when the meter is installed, I’ll see if it is rated at 1000imp/kWh or 4000imp/kWh or something else. And if necessary I’ll adjust the sketch by the relevant factor and test things out on a sunny day to see if the meter display increments or not when the sun’s out.

Unless you have some better advice?


Sorry Robert, not being picky but to quote you, you’ve missed the point! :smiley:

The resolution of some meters is more accurate than others… depends how you read things again…

I’ll carry on with my plan as outlined above…


I shall await your measurements with interest. But one caveat, I need to know that the registers record a zero nett energy flow, as well as what the LED indicates. If those work out to be the same thing, then that too is very useful information. But my natural pessimism/cynicism says that they won’t necessarily be the same.

You’re not are you? :wink: :smiley:

Card-carrying, no less.

The Mk2 PV Router continuously measures the flow of energy in a similar way to utility meters. The key difference for our purposes is that Mk2 makes this information available every mains cycle so the optimal state of the dump load(s) can be determined. This allows the energy state of the premises to be tightly controlled so that it remains within the penalty-free zone that is provided by the meter.

By contrast, the meter tells us nothing about the overall energy state until something of financial significance has already happened. Its LED can only tell us when some consumed energy has been registered, or when some energy which can no longer be retrieved has just been lost to the grid. Either way, this source of information is not helpful for making best use of surplus power as it’s always just too late.

The Mk2’s knowledge about the energy state of the premises is stored in an accumulator (aka “energy bucket”) in its software. This accumulator needs to have a sufficient capacity so that its end-stops will never be reached while surplus power is being actively diverted. However, it does need to have a finite size otherwise the system would take forever to get started when surplus power first appears.

Loosely speaking, it makes sense for the Mk2’s energy bucket to be of a similar size to the penalty-free zone that the meter provides. In many cases, this will be 1 WattHour or 3600J. For less tolerant meters, there is little to be gained in reducing the energy bucket’s capacity.

Provided that anti-flicker mode is not in use, the Mk2 controller will only be using one energy threshold. When the energy state is found to be above that threshold, the load is turned on; and when the energy state is found to be below that threshold, the load is turned off. This behavour will constrain the energy state of the premises to remain within a range of around 100 Joules which shoud be well under the radar of any UK meter.

For meters which are relatively tolerant, anti-flicker mode can be beneficially used. This allows the load(s) to be cycled at a slower rate which can reduce the effect of flicker in some types of lighting.

FWIW, I don’t think that the terms “accuracy” or “sensitivity” are helpful in this context. I would expect the meter to account for every Joule that it sees, as does the Mk2 Router. However, the meter will only register a chargeable unit of energy after a certain amount of energy flow has been internally recorded. For the type quoted above with 4000 impulses/kWh, that “quantum” will be 3600 / 4 = 900 Joules.

A while back I had to code all that reversing power stuff from a meter perspective so might be able to shed some light on the internals, although as you’ve already observed it no doubt varies wildly from one meter design to the next, but at least on this one…

The energy IC used records energy in a signed register with a resolution of WattSecs (aka Joules). It grows in one direction or the other, depending on the power direction, freely passing through zero as required. It resets to zero upon reading.

In contrast, the meter offers its clients two unsigned 64-bit readings: Positive WattSecs and Negative WattSecs. Those two values only ever get bigger. It’s a 12-channel per phase meter, so each phase has a set of registers like this:

So the basic f/w approach is to read the IC’s energy register every second, if it’s positive add it into the meter’s Positive Energy register and if negative add it into the meter’s Negative Energy register. The value read also gives an average Power value over the last second in Watts which can be read in yet another meter register (all that times 36, in the case of the 3-phase meter).

Left like that it would give a diverter a full second to balance the books and no energy would get recorded in the meter registers as the IC energy register would read as 0 (assuming the diverter could sync up with the meter’s one second window). But the IC can additionally raise an interrupt when it detects a change of direction in power flow. When that interrupt fires the f/w immediately reads the IC’s energy register and does the same processing as above. In that case the opportunity for a diverter to get the value back to 0 before the f/w reads it is greatly reduced. It comes down to how long the IC takes to notice the reversal, and how long the f/w takes to respond to the /IRQ and read the value.

The IC can only monitor half the channels at a time for power reversal, which is why half the channels in the meter register table above are flagged as “preferred for bi-directional circuits”. All channels can correctly tally bi-directional circuits into positive and negative accumulators, but half of them respond much faster to reversals. In different variants of the energy IC, the device itself tallies the positive and negative energies, making life much easier for the firmware, while being less friendly to diverters.

To test all this, I needed a way to reverse the power flow, preferably under f/w control, so I could test things like “what happens if the power reverses during a WaveView capture?”. This little device lets me do that:

It’s designed for high currents but low voltages, so is a good fit with the Current loop of a calibrator. It takes a single GPIO input to control which way the power should flow.

1 Like

So smart meter installed - Kaifa MA120. States that it does 2000imp/kWh. The display on the meter is in kWhs

The ‘smart’ remote display thingie has a resolution of Whs, so currently showing 00000000.387 kWhs as the meter reading.

Testing the diverter will have to wait until tomorrow though - it’s chucking it down here!!

That’s pretty much how I thought an electronic meter did/would work. The bit I didn’t know, and presumably could be different depending on the maker or owner of the meter, was the 1 second transfer from the bi-directional register to the separate import and export registers.

The other information about the interrupt that I would assume is that it can only fire at (or as a consequence of) the end of a cycle when the integrals for the rms calculation have a meaning - unless it continually calculates a rolling rms over the last cycle with every new sample. And if that were to be the case, then a diverter simply could never bounce energy backwards and forwards through the meter without the meter accumulating an import or an export to the appropriate register each time the power flow reversed.

So, you have a meter that is accuracy Class 2 (or Class B if you prefer) with a display resolution of 1 kWh, the remote display has of necessity the same accuracy, but its display resolution is 1 Wh.

Yes, the 1 second was entirely a “local” design choice - all the meter’s registers update every second. Even at full scale deflection in a single direction, the underlying IC register won’t overflow for about 75 hours, so plenty of freedom there for the meter designer.

Here’s an old pic of the /IRQ firing. Red is current - changing from a low level forward flow to a higher level reverse flow and Yellow is the /IRQ signal:

From memory its responsiveness varies a lot, with no obvious pattern. I suspect there are internal thresholds that need to be crossed, and they’re not really visible to me. The IC vendor wasn’t particularly helpful with some vague reference to filter settling times.

I concur with your position. I don’t think any of @Bramco’s meter specs give much in the way of clues as to how big the “bucket” is likely to be. By way of example, all my meter’s channels have identical specs with regards accuracy and resolution, and if I had LED outputs I could make them flash at any reasonable rate requested, but half the channels are much more responsive to power reversals than the other half.

Very true - and as you say, you could get the LED to flash in pretty patterns if you wanted :smiley:

The answer to the question about bucket size turns out to be easy to answer.

We had our new meter installed last week and in the last few days we’ve finally had some sun!!

It turned out to be very easy to show that the bucket is the same as before 3600 joules.

Our PV is about 1.5kWp and the immersion that the PV is diverted to is 3kW and the background use is between 100 and 200W. So if it is sunny, all the excess from the panels is diverted into the immersion.

Yesterday we had several periods of full sunshine, so full PV output. As you can see below, for 2 half hour periods, we used a total of 0.010kWhs or 10 times 3600 joules, which might have been cloud cover for a short time taking the PV output down below the background usage.

There are also a couple half hour periods that are registering zero usage, one at 9am.

So it looks as though even though the meter that was installed shows 2000imp/kWh, it only register usage at 1000 imp/kWh.

So given the diverter bucket limit isn’t causing the meter to register additional usage, I’ll leave things alone.


1 Like

Do you think this is likely to be true for all smart meters? I’m about to get one installed because I want to get on OctopusGo, but I’d prefer to also be able to use my diverter to heat water, when I don’t need to charge the car.

Hi Allen,

I don’t know but I suspect that whatever the various meters can display, the standard bucket of chargeable energy is 3600 joules which is what the diverters are based on.

I took a fairly pragmatic way of testing this theory, at least for the meter Octopus installed for us. Basically, I let the diverter run for a few days and checked out what we are being charged on the Octopus site where I can see half hourly what I have been charged, as in the screen shot above.

If the meter bucket was smaller than 3600 joules, then I would be diverting energy from the grid as well as from the PV by keeping the divert ‘on’ for too long. But clearly from the half hourly charging periods on Octopus, when it’s blue sky and sunshine then I’m not being charged anything, so the diverter is working as designed.

Should maybe add a caveat there that we only have around 1.5kWp of solar and of course the immersion is a 3kW element.


Just going back through some of the comments above, it’s clear that while a meter can display 4000imp/kWh, the chargeable unit may only be 1000imp/kWh.

So there’s a difference between the ability of the meter’s energy usage display and what it reports to the provider as chargeable usage which would seem to be pegged at 0.001kWh or 3600 joules as used in the divert s/w.


The Mk2 software is generally set to have a linear operating range of 3600 Joules that being similar to the “bucket capacity” of many types of meter. But the energy state of the premises is pegged by the action of the Router much more tightly than that; generally to within just a few tens of Joules from a constant point.

When used in its Anti-Flicker mode, the energy state is allowed to vary within two pre-set energy levels. The load is only activated/deactivated when the energy state strays outside that permitted zone. The optimal setup is usually for the load(s) to be cycled as slowly as is possible without financial penalties being imposed by the meter. A slower rate of transitions will reduce the disturbance that may be seen on older types of lighting.