EOS_connect icon indicating copy to clipboard operation
EOS_connect copied to clipboard

Modul 3 Prices - TOU - static/ dynamic prices - grid fees

Open ohAnd opened this issue 1 year ago • 30 comments

For special fixed price zones per day there is a need to confgiure this TOU prices as another price provider source.

(Details see discussion link below)

Info: Modul 3 Prices will not be implemented in the API Price for Tibber and Octopus, since there is no edi (MaKo) information that will adress this information. So the End User has to add or subtract the cost.

if an array is listed to subtract the ST-Fee and ad the array fee to the price:

source: fixed_24h_array
fixed_24h_array: [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24]
gridfee: [NT,NT,NT,NT,NT,ST,ST,ST,ST,ST,NT,NT,NT,NT,NT,ST,HT,HT,HT,HT,HT,HT,ST,NT]
gridfee_nt: 5
gridfee_st: 10 // the ST Price in M3 represents the Standard Grid Fee in every case
gridfee_ht: 25
token: tibberBearerToken
feed_in_price: 0.0755833
negative_price_switch: false

Originally posted by @thecem in https://github.com/ohAnd/EOS_connect/discussions/50#discussioncomment-13255005

ohAnd avatar May 24 '25 09:05 ohAnd

@thecem

step 1: for clarification: this

fixed_24h_array: [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24]

is then something like this

fixed_24h_array: [0.05,0.05,0.08,0.08,0.08,0.06,0.06,0.06,0.06,0.06,0.06,0.12,0.12,0.12,0.12,0.12,0.12,0.12,0.12,0.06,0.06,0.06,0.06,0.06] # price per hour of the day in €/kWh

this is a config fixed entry as another source of "dynamic" prices and will be used with this values for the optimization input

step 2: adding gridfee config

gridfee: [NT,NT,NT,NT,NT,ST,ST,ST,ST,ST,NT,NT,NT,NT,NT,ST,HT,HT,HT,HT,HT,HT,ST,NT]
gridfee_nt: 5
gridfee_st: 10 // the ST Price in M3 represents the Standard Grid Fee in every case
gridfee_ht: 25

this will be sperated from the "dynamic" price source and

  1. will be added regardless of the price source?
  2. for my understanding with your description: st price is the base and should be usually included in the dynamic price - means the difference between nt and st or ht and st should be the add/sub to the given dynamic price for the given hour (zone)?
  3. and so if st is set for the hour (inj gridfee array) no change to the resulting price given by source should be done?

ohAnd avatar May 24 '25 09:05 ohAnd

step 1: Yes step 2:

Grid Fee Structure & End-User Pricing Key Relationship:

The Standard Tariff (ST) represents the base grid fee. High (HT) and Low Tariffs (NT) are derived from ST:

HT ≤ 2× ST (applied ≥ 2h/day)

NT = 10–40% of ST

Pricing Adjustment Process:

Identify ST: The grid operator defines the annual ST (e.g., €0.25/kWh).

Calculate HT/NT:

    HT = Up to €0.50/kWh (2× ST)

    NT = €0.025–0.10/kWh (10–40% of ST)

End-User Price Breakdown:

    Total Price = Energy (spot market) + Grid Fees (ST/HT/NT) + Taxes/Charges

    To isolate grid fees:
    Grid Fee Component = Total Price - (Energy + Taxes/Charges)

Apply Time-Based Fees:
Replace the standard grid fee (ST) in the total price with HT or NT during their respective windows.

Example:

If ST = €0.25/kWh and NT = 20% of ST:

NT Rate = €0.05/kWh (applied overnight)

During NT hours:
User Price = (Spot Energy) + €0.05/kWh + Taxes/Charges

Example pricesheet (Page 7):

https://www.westnetz.de/content/dam/revu-global/westnetz/documents/ueber-westnetz/unser-netz/netzentgelte-strom/westnetz-preisblaetter-strom-2025-vorlaeufig.pdf

thecem avatar May 24 '25 09:05 thecem

def calculate_final_price(base_price, grid_schedule, st_fee, ht_fee, nt_fee):
    """
    Applies Module 3 grid fee rules:
    1. Subtracts ST fee from base price
    2. Adds time-specific fee (HT/ST/NT)
    """
    # Validation checks
    if ht_fee > 2 * st_fee:
        raise ValueError("HT cannot exceed 2× ST (Max: {})".format(2*st_fee))
    if not (0.1*st_fee <= nt_fee <= 0.4*st_fee):
        raise ValueError("NT must be 10-40% of ST (Range: {}-{})".format(0.1*st_fee, 0.4*st_fee))
    
    return [base_price - st_fee + fee for fee in [
        nt_fee if slot == 'NT' else ht_fee if slot == 'HT' else st_fee 
        for slot in grid_schedule
    ]]

# Example Usage
final_prices = calculate_final_price(
    base_price = 30,   # Price without grid fees
    grid_schedule = ['NT','NT','NT','NT','NT','ST','ST','ST','ST','ST',
                     'NT','NT','NT','NT','NT','ST','HT','HT','HT','HT','HT','HT','ST','NT'],
    st_fee = 10,       # Standard fee
    ht_fee = 20,       # 2× ST (compliant)
    nt_fee = 4         # 40% of ST (max allowed)
)

print(final_prices)

Hour 00-04: 30 - 10 + 4 = 24
Hour 05-09: 30 - 10 + 10 = 30
Hour 10-14: 30 - 10 + 4 = 24
Hour 15: 30 - 10 + 10 = 30
Hour 16-21: 30 - 10 + 20 = 40
Hour 22: 30 - 10 + 10 = 30
Hour 23: 30 - 10 + 4 = 24

thecem avatar May 24 '25 10:05 thecem

Additionally, it is important to note that quarter-hourly based Module 3 tariffs are in place. This means that, in the future, there could be increased interest in applying and analyzing grid fees and energy prices at a 15-minute interval rather than on an hourly basis. Such a finer granularity would allow for even more precise and flexible pricing models, as well as better alignment with actual consumption patterns and dynamic market conditions.

thecem avatar May 24 '25 10:05 thecem

thanks for the details and also for the function template...

I'm still confused how we get the final price for the specific hour

Total Price = Energy (spot market) + Grid Fees (ST/HT/NT) + Taxes/Charges

caused by the taxes/ charges ...

e.g. from tibber side i can get the price with total, energy, tax

"current": {
                "total": 0.2088,
                "energy": -0.0002,
                "tax": 0.209,
                "startsAt": "2025-05-24T12:00:00.000+02:00"
              },

How we can combine this with the grid fees ... ?

the taxes/ charges including currently

  • energy price stock / fixed
  • the specific grid fee (with module 3 the more dynamic according to your explanation)

dynamic by provider:

  • Additional procurement costs - at my side e.g. 1,81 ct/kWh

fixed charges (by law - I guess)

  • energy tax - in Germany 2,05 ct/kWh
  • Concession fee 1,32 ct/kWh
  • Offshore wind levy 0,816 ct/kWh
  • CHP levy 0,277 ct/kWh
  • Electricity NEV levy 1,56 ct/kWh

the sum of = energy base price + grid fee + provider_fees + charges will be then charged with the VAT of 19%

this will then the final price for the given hour (and later within a 15min cycle)

If we have the provider price and the module 3 price then we also need the addtional price parts from charges and VAT and so on by config - or I'm on the wrong way?

ohAnd avatar May 24 '25 11:05 ohAnd

Simplified Pricing Strategy for Tibber Integration Key Principles:

Optimization Focus: Relies on relative hourly price differences (HT vs. NT), not absolute values.

Accounting Relevance: Total prices matter for revenue/expense tracking, but not for time-shifting optimization.

Two Implementation Scenarios:

Case 1: Spot Market Price (No Added Fees in API)

 Final Price = Spot Price + Grid Fee (ST/HT/NT)  
  • Use this if Tibber/EOS API provides pure energy prices without grid fees.

Case 2: Total Price (Fees Included in API)

Final Price = (API Total Price - ST) + Time-Based Grid Fee (ST/HT/NT)  
  • Use this if API already includes standard grid fees.

Handling Fixed Charges:

Taxes/levies (non-hourly) can be added as flat rates:

Final Price += Fixed Charges  

These don’t affect optimization since they’re constant across all hours.

Recommended Approach:

Default to Case 2 logic for TOU tariffs (aligns with Module 3’s ST-first principle).

Use Case 1 only if API explicitly provides spot-only prices.

thecem avatar May 24 '25 11:05 thecem

If we have the provider price and the module 3 price then we also need the addtional price parts from charges and VAT and so on by config - or I'm on the wrong way?

No we don´t need additional price parts.

Image

Netznutzungsentgeld is the variable part of Modul 3.

thecem avatar May 24 '25 11:05 thecem

hmm...

I'm not really convinced ... ;-)

Back to the main - EOS needs the different prices to level it out over the whole energy system and time - means:

  • the current grid price for the hour (as disscussed above and also understood at my side - thx again)
  • the feedin price - constant value currently - with the extra feature could be 0 if negative stock prices
  • cost per wh from accu

so that this point

Optimization Focus: Relies on relative hourly price differences (HT vs. NT), not absolute values.

Accounting Relevance: Total prices matter for revenue/expense tracking, but not for time-shifting optimization.

could be lead to the wrong direction and incorrect evaluations

conclusion from my side: Either all prices that goes into EOS are the final customer prices or all are only the base prices without specific fixed local charges/ taxes. To have for all prices the same relational base.

(last option will also leads to the net prices in dashboard and shown to the user...)

That's maybe the point, where I have the problem in thinking about that...

ohAnd avatar May 24 '25 12:05 ohAnd

No, that’s the point! All Prices have to be the final customer prices! ;-) Since the the feedin and battery per wh price is a final customer price, and even the fixed price is the final one. The diff of ht to st and nt to st have to added or subtracted, this is then also the final price for this hour.

If the tibber-API (or other spot market tariff provider) is providing the price without taxes, charges, fees the above could be wrong taken in the optimisation.

To adapt this (when there is only a spot sprice) we have to add charges, taxes and fees to have a right calculation.

thecem avatar May 24 '25 14:05 thecem

Gross electricity price:

Hour Price Standard Gridfee (-) Gridfee Modul 3 (+) End(gross) price(=)
0 15,07 6,64 1,99 10,42
1 15,07 6,64 1,99 10,42
2 15,07 6,64 1,99 10,42
3 15,07 6,64 1,99 10,42
4 15,07 6,64 1,99 10,42
5 28,17 6,64 6,64 28,17
6 28,17 6,64 6,64 28,17
7 28,17 6,64 6,64 28,17
8 28,17 6,64 6,64 28,17
9 28,17 6,64 6,64 28,17
10 28,17 6,64 1,99 23,52
11 28,17 6,64 1,99 23,52
12 28,17 6,64 1,99 23,52
13 28,17 6,64 1,99 23,52
14 28,17 6,64 6,64 28,17
15 28,17 6,64 6,64 28,17
16 28,17 6,64 12,75 34,28
17 28,17 6,64 12,75 34,28
18 28,17 6,64 12,75 34,28
19 28,17 6,64 12,75 34,28
20 28,17 6,64 6,64 28,17
21 28,17 6,64 1,99 23,52
22 28,17 6,64 1,99 23,52
23 28,17 6,64 1,99 23,52

This would be step 1 to use TOU prices and Modul 3 combined:

fixed_24h_price: [10.42, 10.42, 10.42, 10.42, 10.42, 23.52, 28.17, 28.17, 28.17, 28.17, 28.17, 23.52, 23.52, 23.52, 23.52, 28.17, 28.17, 34.28, 34.28, 34.28, 34.28, 34.28, 28.17, 23.52]

thecem avatar May 25 '25 15:05 thecem

[you were faster - and I forgot to click]

Especially with already given tibber prices I have my "thinking problem" - I've played with real example - and also for fix given final prices to integrate the module 3 thing:

Image

  • With the last column I'm coming still to the point that the end customer price has to be seperated to the different blocks due to the VAT that is calculated with overall price and then added... - that leads me to the point the VAT is important to get the right final price
  • first few line at tibber - the 'normal' situation without module 3 stuff
  • between the black columns there is the small calculaion as suggested - with relational changes...

Where I have the "node in the brain" (denglish) ;-)

ohAnd avatar May 25 '25 16:05 ohAnd

your table is shown in same way as on my side in the middle (between black coulumns) - the user which configures the fixed_24h_array should put the end prices there without module 3 - then to add the module 3 I'm coming to the table above...

ohAnd avatar May 25 '25 16:05 ohAnd

Yes, my table is an example to bring this with the minimum work to life. If there is like in the first example gross price and grid charge seperated the user don’t have to calculate the price. Especially if there are not gross prices given, there has to be charges, fees and VAT added to be in line with battery per kWh and feedin prices.

thecem avatar May 25 '25 16:05 thecem

This config hase some error and if starting w/o it throws an error "addi... is missing"

  additional_load_1_sensor: null
  additional_load_1_runtime: 0
  additional_load_1_consumption: 0

The fixed_24h_array must be without "[]" and in UI mode in quotation marks ""

This is a working config:

load:
  source: homeassistant
  url: http://192.168.76.100:8123
  access_token: >-
    1234
  load_sensor: sensor.home_power_statistic
  car_charge_load_sensor: sensor.car_charge_load_sensor
  additional_load_1_sensor: sensor.additional_load_1
  additional_load_1_runtime: 1
  additional_load_1_consumption: 10
eos:
  server: 192.168.1.100
  port: 8503
  timeout: 360
price:
  source: fixed_24h
  token: tibberBearerToken
  fixed_24h_array: >-
    10.42, 10.42, 10.42, 10.42, 10.42, 23.52, 28.17, 28.17, 28.17, 28.17, 28.17,
    23.52, 23.52, 23.52, 23.52, 28.17, 28.17, 34.28, 34.28, 34.28, 34.28, 34.28,
    28.17, 23.52
  feed_in_price: 0.0755833
  negative_price_switch: false
battery:
  source: homeassistant
  url: http://192.168.76.100:8123
  soc_sensor: sensor.battery_storage_soc_total
  access_token: >-
    1234
  capacity_wh: 28480
  charge_efficiency: 0.88
  discharge_efficiency: 0.88
  max_charge_power_w: 10000
  min_soc_percentage: 10
  max_soc_percentage: 80
  price_euro_per_wh_accu: 0.0001
pv_forecast:
  - name: balkon_dg
    lat: 50
    lon: 8
    azimuth: 52
    tilt: 60
    power: 900
    powerInverter: 1000
    inverterEfficiency: 0.9
    horizont: ""
  - name: balkon_og
    lat: 50
    lon: 8
    azimuth: 52
    tilt: 60
    power: 900
    powerInverter: 1000
    inverterEfficiency: 0.9
    horizont: ""
  - name: dach_nord_ost
    lat: 50
    lon: 8
    azimuth: -128
    tilt: 37
    power: 4620
    powerInverter: 4200
    inverterEfficiency: 0.9
    horizont: ""
  - name: dach_nord_west
    lat: 50
    lon: 8
    azimuth: 142
    tilt: 37
    power: 5390
    powerInverter: 4200
    inverterEfficiency: 0.9
    horizont: ""
  - name: dach_sud_ost
    lat: 50
    lon: 8
    azimuth: -38
    tilt: 37
    power: 5390
    powerInverter: 10000
    inverterEfficiency: 0.9
    horizont: ""
  - name: dach_sud_west
    lat: 50
    lon: 8
    azimuth: 52
    tilt: 36
    power: 1540
    powerInverter: 1500
    inverterEfficiency: 0.9
    horizont: ""
  - name: garage_dach
    lat: 50
    lon: 8
    azimuth: 52
    tilt: 35
    power: 1400
    powerInverter: 1200
    inverterEfficiency: 0.9
    horizont: ""
  - name: garten_wand
    lat: 50
    lon: 8
    azimuth: 52
    tilt: 21
    power: 350
    powerInverter: 300
    inverterEfficiency: 0.9
    horizont: ""
  - name: garten_haus
    lat: 50
    lon: 8
    azimuth: -24
    tilt: 21
    power: 1200
    powerInverter: 1200
    inverterEfficiency: 0.9
    horizont: ""
  - name: lounge_zaun
    lat: 50
    lon: 8
    azimuth: -24
    tilt: 90
    power: 1050
    powerInverter: 1050
    inverterEfficiency: 0.9
    horizont: ""
  - name: terrasse
    lat: 50
    lon: 8
    azimuth: 52
    tilt: 9
    power: 2800
    powerInverter: 2800
    inverterEfficiency: 0.9
    horizont: ""
  - name: wand
    lat: 50
    lon: 8
    azimuth: -38
    tilt: 90
    power: 7500
    powerInverter: 7500
    inverterEfficiency: 0.9
    horizont: ""
inverter:
  type: fronius_gen24
  address: 192.168.1.132
  user: customer
  password: xxx
  max_grid_charge_rate: 9000
  max_pv_charge_rate: 10000
  max_bat_discharge_rate: 9000
evcc:
  url: http://192.168.1.100:7070
mqtt:
  enabled: true
  broker: localhost
  port: 1883
  user: mqtt
  password: xxxx
  tls: false
  ha_mqtt_auto_discovery: true
  ha_mqtt_auto_discovery_prefix: homeassistant
refresh_time: 6
time_zone: Europe/Berlin
eos_connect_web_port: 8081
log_level: debug

thecem avatar May 29 '25 14:05 thecem

This config hase some error and if starting w/o it throws an error "addi... is missing"

This should be not given - means if additional_load_1_sensor is not in config or param is given with null or empty - should be tolerated. Same for additional_load_1_runtime and additional_load_1_consumption. Can you please describe the setting/ constellation where you get this "error".

The fixed_24h_array must be without "[]" and in UI mode in quotation marks ""

This was intended -> see commit https://github.com/ohAnd/EOS_connect/commit/13417c58adcd0dd0d3f560d33ad5f3cc5126acc3 Unfortunately I forgot to update the config readme and default config build in this commit. (updated with last commits)

ohAnd avatar May 30 '25 16:05 ohAnd

If I hit save in Addon Congig I get this error.

Same config as above but with:

additional_load_1_sensor: null
additional_load_1_runtime: 0
additional_load_1_consumption: 0

thecem avatar May 30 '25 17:05 thecem

Ah... - you mean within HA addon config - not directly execution (or in a docker) - ok, I will check in detail...

from schema perspective in the current develop addon 0.1.0.76 the values are optional https://github.com/ohAnd/ha_addons/blob/a2b06793e32a618e04a550a550af420a18f8470b/eos_connect_develop/config.yaml#L116

ohAnd avatar May 30 '25 18:05 ohAnd

THX ! Prices are with this manual configurable!

thecem avatar May 31 '25 06:05 thecem

Hey, following up here on https://github.com/ohAnd/EOS_connect/issues/76 in regards to the prices:

For the base optimization the overlays of taxes and fees are not relevant, if all used price are on the same base as discussed.

The use of the real prices is only relevant for the displaying of expense and income.

If there is a need we can think about to configure additonally the parts for fix and dynamic costs - see for that the longer discussion here #51 Maybe we can discuss then in a new issue - and we can close here

One objection to your statement. It seems that EOS is blocking battery discharge when electricity prices get 0 or close to 0... which makes sense. The only problem though is, that it is only considering the net price. The gross price is not really 0 for me but about 14 cents. Therefore, it'd still make sense to discharge the battery in this case. That's a use case we need the real price for.

Image

nanoBit93 avatar Aug 01 '25 16:08 nanoBit93

Any update on this?

Today I asked at Tibber in hope sth changed whether the specific prices will be displayed on the API results or the price widget in the app. They told me it won't.

a8291 avatar Oct 06 '25 15:10 a8291