I’m currently attempting a couple of different methods (including logging values to influxDB and graphing in there) but so far the most correct method seem to be to use the utility meter, with the quarter-hourly cycle.
As input I use the tarif 1 and tarif 2 consumption sensors coming from the DSMR integration.
My next steps will be to get the monthly max peak and all the peak from the last year/12 months, but with the new statistics charts that shouldn’t be too hard (that info is also kept indefinitely as opposed to the state changes)
EDIT: This is my graph from yesterday:
The yellow bars are values coming from the DSMR integration, every 1 second, grouped per 15minutes by the apex-charts card. The blue one is the tarif1 utility meter, the red one is the tarif2 utility meter (red one has no values just yet, only activated this morning)
As you can see, grouping and taking the average from the actual Power values from DSMR seems to align pretty much with the utility meter integration. I’m going to keep both of them active for a while and compare results in the coming days. if the result stay the same I’ll be removing the direct DSMR graphs and changing the interval back to 30seconds (default), the 1 second interval causes a lot of data to come into home assistant which really isn’t needed.
I actually don’t really care about 100% accurate results, just a rough estimate is good enough for me.
The main reason I don’t need 100% accurate results is that my meter actually does not send any data to Fluvius, so I don’t get any info from MijnFluvius at all
As mentioned above the utility meter with quarter-hourly cycle is the correct option to measure the correct “kwartierpiek” or “capaciteitstarief”…
Don’t forget to multiply this by 4 to get the correct value which is needed.
I’m struggling to get these values for a month/year… I want the values with the MAX value of the current and past months. Anyone found a solution for that yet? I cannot find something useful in HA. min/max sensor doesn’t help…
I have a bar graph that shows this for the last 24h with max values. (and can see that 2.08 is the highest value last 24h.)
If there is a monthpeak of less than 2.5kW, then indeed 2.5kW will be used to calculate the average monthpeak.
However, if the year is incomplete (not all monthpeaks known) and therefore there are missing values for calculating the “average monthpeak”, the average is calculated with the known values only.
The missing values are simply omitted and you should not use a default minimum monthpeak of 2.5kW in that case.
So the first year of introducing the capacity tarif, your calculation will be off somewhat.
48°/1 Gemiddelde maandpiek afname: het rollend gemiddelde van de 12 laatste maandpieken
afname met inachtneming van de minimumwaarde van de maandpiek, zoals gedefinieerd in de
tariefmethodologie, vastgelegd door de VREG. Indien de maandpiek nog niet voor 12 maanden
beschikbaar is, is de gemiddelde maandpiek het gemiddelde sinds de eerste relevante maandpiek
48°/1 Gemiddelde maandpiek afname: het rollend gemiddelde van de 12 laatste maandpieken
afname met inachtneming van de minimumwaarde van de maandpiek, zoals gedefinieerd in de
tariefmethodologie, vastgelegd door de VREG. Indien de maandpiek nog niet voor 12 maanden
beschikbaar is, is de gemiddelde maandpiek het gemiddelde sinds de eerste relevante maandpiek
To avoid misunderstandings, let me summarise:
When you start taking measurements, for the first month the monthly peak and the average monthly peak are identical.
1st monthly peak: a kW ==> average monthly peak: a kW
2nd monthly peak: b kW ==> average monthly peak: (a+b)/2 kW
3rd monthly peak: c kW ==> average monthly peak: (a+b+c)/3 kW
…
12th monthly peak: l kW ==> average monthly peak: (a+b+c+d+e+f+g+h+i+j+k+l)/12 kW
13th monthly peak: m kW ==> average monthly peak: (b+c+d+e+f+g+h+i+j+k+l+m)/12 kW
14th monthly peak: n kW ==> average monthly peak: (c+d+e+f+g+h+i+j+k+l+m+n)/12 kW
…
==> “het rollend gemiddelde van de 12 laatste maanden” or “the rolling average of the last 12 months”
Yes, your summary is correct. (Only the case <2.5kW is missing.)
More formaly: (With the correct terminology.)
The average monthpeak is the rolling average of the available monthpeaks, with a window size of 12. This window size is reduced to the amount of available monthpeaks if there are less than 12 monthpeaks available.
Pay attention to:
If an available monthpeak is less than 2.5kW, you must use a value of 2.5kW to represent that monthpeak in the calculations of the average monthpeak.
(Technically the monthpeak itself remains on its original value of less than 2.5kW.This might become relevant if the minimum value of 2.5kW in use today is changed (lowered) in the future. Today’s value was actualy determined by other net usage information and it can be reviewed and changed in the future if required.)
Also:
It doesn’t matter when “you” start taking measurements, but when the network operator starts.
Today, monthpeaks are only relevant for consumption, not injection. However, if deemed necessary, this could change in the future so injection might then also be subject to a similar calculation (which might employ different numerical values).
It is unclear (not defined) what happens when you move to a different location within the geographical area where this capacitytarif is applicable, or when the legal owner of the electricitycontract is changed without moving. (Will the previous monthpeaks of the legal contractowner be used? Will the previous monthpeaks of the meter be used? Will you start again with no available monthpeaks?)
I’m trying to understand following in the automation ‘Maximum maandpiek’
If the first condition fails and failing means that the monthly peak is < 2.5 kW (2.5 kW is the minimum value of the input_number january in this example)
all the next steps are not done?
If so, the input_number.max_peak_2 is never reset and remains with his value.
February will then start with the value of the previous month in input_number.max_peak_2??
I’m trying to set up something similar. The difference for me is that my monthly rate is calculated from the 5 highest hourly energy use figures each month. Any good ideas how I might achieve that? I’ve successfully set up @gieljnssns’s configuration so far, yet that obviously onnly gets me the single highest figure for the month.
Could somebody help me in the right direction? I’m trying to use the utility_meter with cycle string: quarter-hourly but I’m not getting the right result. I’m fairly new at this so cut me some slack
cycle string (Optional)
How often to reset the counter. Valid values are quarter-hourly, hourly, daily, weekly, monthly, bimonthly, quarterly and yearly. Cycle value bimonthly will reset the counter once in two months.
I’ve added the following to allow me to be able to measure the “kwartuurpiek”.
However, the sensor seems to add up consumed power instead of just measuring. Thereafter I changed the kind of measurement in ‘entity customization’ into ‘measurement’ instead of ‘total increasing’ because the entity doesn’t have a unique ID (because it was added in YAML.). But this doesn’t change its behaviour.
This entity (‘sensor.energy’) does not have a unique ID, therefore its settings cannot be managed from the UI. See the documentation for more detail.
You can overwrite some attributes in the [entity customisations] section.
Because I needed the ‘mean’ value I added statistics sensor. Normally this should already give the mean value
The statistics sensor platform consumes the state from other sensors. It exports the mean value as state and the following values as attributes: count, mean, median, quantiles, standard_deviation, variance, total, min_value, max_value, min_age, max_age, change, average_change and change_rate. If the source is a binary sensor then only state changes are counted.
Am I approaching this all wrong? What do I need to change in order for this to work? Also am I missing something? Do I need to multiply the value?
@Giovanni85, I’m trying to understand your post, but have difficulty to follow you.
I imagine that this sensor, in his raw value, is giving you the actual power consumption (W or kW) of your installation? This value is the real-time power consumption from the grid, correct?
Be careful if you have solar panels! You must only have the grid consumption!
This value must be converted to kWh (kilo-watt-hour), the number of kW per hour.
For this you can use the Riemann sum integration from HA.
### creat quarterhour utility_meter from the riemann sum sensor.smappeemqtt_grid_afname_kwh
smappeemqtt_quarterhour_gridenergy:
source: sensor.smappeemqtt_grid_afname_kwh
cycle: quarter-hourly
Now you can follow 2 ways for the calculation of the average peak power per quarter.
via a template sensor
- platform: template
sensors:
### create from the utility_meter sensor the average peakpower per quarterhour ###
smappeemqtt_quarterhour_grid_averagepeakpower:
value_template: "{{ states('sensor.smappeemqtt_quarterhour_gridenergy')|float * 4 }}"
unit_of_measurement: "kW"
icon_template: mdi:calculator
friendly_name: "Gemiddeld piekvermogen per kwartier"