MTrab / energidataservice

Fetches spot prices from Energi Data Service
GNU General Public License v3.0
178 stars 27 forks source link

[FR]: Option to have both Import and Export prices (Users with Solar Panels) #203

Open Baldorian44 opened 1 year ago

Baldorian44 commented 1 year ago

First of all MTrab - what an awesome feature - simply love it, it's just getting better and better. Thank you for the hard work put into it - it is a true pleasure.

Is your feature request related to a problem? Please describe. Not a problem with the current code

Describe the solution you'd like As a happy user of the energidataservice I have a suggestion for making it even better. For those of us with Solar Panels we will at some point be both importing electricity but also exporting it. And as we know there are different prices for importing and exporting. So I think it would be great if an option could be selected to have both the import and export price(s). I guess it could be made the following two ways:

  1. Keep the setup as you have now and use it for import (The new tariff and fees are GREAT :) ). And add the raw spot price without VAT/Tax and make an additional cost template where we can put in the tariff fees + whatever the fee from those you sell your excess power to.
  2. Keep the setup as you have now and use it for import. And create another entity for export that also fetches the energinet prices + tariff fee from your provider and keep the additional cost to be used if further modification is needed to those you sell your excess power to.

Describe alternatives you've considered My alternative approach right now is to use your setup to only fetch the spot-price without VAT and then I have made 2 additional variables myself to calculate the import and export prices - but they require manual interaction when fees change.

MTrab commented 1 year ago

I'm not sure these fees are available in the API - it'll take som digging at lease. I can take a closer look, but as for now you need to just add an integration with your own additional cost template for this.

Baldorian44 commented 1 year ago

Thanks for swift reply. I am not sure I understand what you mean with "adding an integration with your own additional cost template". The issue is I need the raw spot price to calculate the total Import and Export separately. So now I use your raw price without VAT and have made template sensors to calculate both Import and Export. But with your recent update the total Import price is given (with VAT) when you allow it to fetch tariffs which is very neat. But If go ahead and do that, I need another integration to have the raw spot price (which is definitely possible) - but having the raw spot price outputted from energidataservice or even having an additional sensor cost for export would be cool :)

MTrab commented 1 year ago

If you add a 2nd instance of the energi data service integration, not adding cost template and not selecting tariffs to be added, then you'd have the raw spot price.

Baldorian44 commented 1 year ago

Oh man that never occurred to me - you are totally right - Thanks for that trick :)

bjornbak commented 1 year ago

I use the 2nd instance integration for solar too and calculate the selling fees/deductions a negative addtional_costs but the other day I noticed this isn't perfect since sometimes the spot-price is less that the deductions.. I don't think as private small producer I'm paying to sell power - just not getting paid... So a minimum 0 feature for the calculated price would be nice :)

woopstar commented 1 year ago

I use this template on additional instance of EDS:

{% set costs = {
    "energinets_indfodningstarif": -0.00375,
    "energinets_balancetarif": -0.000875,
    "vindstods_balancetarif": -0.0100, 
} 
%}
{{ costs.energinets_indfodningstarif + costs.energinets_balancetarif + costs.vindstods_balancetarif }}

It's based on Vindstød Solceller, you can find the prices here: https://www.vindstoed.dk/tilmelding-solcelle

It uses the raw spot price, and subtracts the above costs giving me the sales price for solar power.

bjornbak commented 1 year ago

Thank you @woopstar. I have the same calculation and I think you are missing some important fees - radius got two and you're using 2022 fees from energinet: https://energinet.dk/el/elmarkedet/tariffer/aktuelle-tariffer/ https://radiuselnet.dk/elnetkunder/tariffer-og-netabonnement/

My additional_costs is

{% set costs = {
    "radius_indfoedningstarif": -0.0114,
    "radius_raadighedstarif": -0.3229,
    "energinet_indfoedningstarif": -0.030,
    "energinet_balancetarif": -0.0016,
    "vindstoed": -0.01
} %}
{{ costs.radius_indfoedningstarif + costs.radius_raadighedstarif + costs.energinet_indfoedningstarif + costs.energinet_balancetarif + costs.vindstoed }}

Or -0.3759 DKK/kWh

This hour the fees are more than the raw price of 0,20 DKK/kWh but I don't think (as a private small time producer) I have pay to send in my excess production in the grid? How do you set raw price - fees to minimum 0?

madsdyd commented 1 year ago

@bjornbak I am pretty sure that you do not pay Radius both "Indfødningstarif" and "Rådighedstarif" -- only one of them.

I am a private customer with a plant with less than 50kW (12.15 kWp) and I just mailed them yesterday, and today got this mail:

Hej Mads Bondo

Tak for din e-mail.

Du er i kategorien ”Egenproducenter”

Du skal betale ”indfødningstarif”

Du skal endvidere betale et årligt rådighedsabonnement, som pt udgør 81,25 kr. inkl. moms.

If you read this page: https://radiuselnet.dk/elnetkunder/tariffer-og-netabonnement/ -- it would seem that this is conflicting information: "Rådighedstariffen anvendes for egenproducenter.". However, I asked about this, and got this short text:

"Den nævnte forhåndsgodkendelse skal forstås i sammenhæng med ansøgning om ”pristillæg”. Men du har ikke noget pristillæg."

I honestely find the communication and information from Radius to be very very hard to follow. But the statement that I need to pay "Indfødningstarif" only, is consistent with other information on the net.

madsdyd commented 1 year ago

To follow up on this. As a Radius private customer with a plant with less than 50 kW, I believe a suitable "additional cost" template for an additional energidataservice integration instance (without vat and tarif), and prices in "øre" should be something like this:

{% set costs = {
    "radius_indfoedningstarif": -0.01,
    "energinet_indfoedningstarif": -0.003,
    "energinet_balancetarif": -0.0016,
    "vindstoed_balancetarif": -0.01
} %}
{{ costs.radius_indfoedningstarif + costs.energinet_indfoedningstarif + costs.energinet_balancetarif + costs.vindstoed_balancetarif }}

Note, that VAT is applied on the tarifs "we pay", but not for the prices "we get".

Sources: Radius tarifs: https://radiuselnet.dk/elnetkunder/tariffer-og-netabonnement/ Energinets tarifs: https://energinet.dk/el/elmarkedet/tariffer/aktuelle-tariffer/ Vindstøds tarif: https://www.vindstoed.dk/tilmelding-solcelle

woopstar commented 1 year ago

Just a followup. So here is the same one Mads is using, but for Vores Elnet, based on 1st of Juli 2023 prices

{% set costs = {
    "vores_elnet_indfoedningstarif": -0.0033,
    "energinet_indfoedningstarif": -0.003,
    "energinet_balancetarif": -0.0016,
    "vindstoed_balancetarif": -0.01
} %}
{{ costs.vores_elnet_indfoedningstarif + costs.energinet_indfoedningstarif + costs.energinet_balancetarif + costs.vindstoed_balancetarif }}

Source: https://www.voreselnet.dk/priser/decentrale-producenter

pvprodk commented 1 year ago
"vores_elnet_indfoedningstarif": -0.33,

This one looks a bit to high ☺️ (or low depending on how its read

woopstar commented 1 year ago
"vores_elnet_indfoedningstarif": -0.33,

This one looks a bit to high ☺️ (or low depending on how its read

Ah yes. its 0,33 øre / kWh... so it should equal to 0.0033, right :)

pvprodk commented 1 year ago

Ah yes. its 0,33 øre / kWh... so it should equal to 0.0033, right :)

Yeah :)

noerremark commented 1 year ago

@MTrab - How many cups of coffee do you need to implement this? :-D

pvprodk commented 1 year ago

@MTrab - How many cups of coffee do you need to implement this? :-D

I agree that this would be a nice addition, however creating a separate instance for selling prices works just as well:

image

MTrab commented 1 year ago

Can't really see what there is to implement here 🤷🏼‍♀️ The solution is already supported.

I haven't been able to find the values in the Data hub for this, so until I do that I can't do much.

noerremark commented 1 year ago

I haven't been able to find the values in the Data hub for this, so until I do that I can't do much.

Oh, I thought they were somewhere in Data hub already. My problem is keeping up to date whenever mine are changed, so having something would have been nice.

image

Maybe we could crowd source them with PRs in some sneaky format in this repo? Or somewhere else and input them from here.

MTrab commented 1 year ago

Wouldn't rule out that they are in the data hub. I do not have solar panels or anything, and have absolutely no idea of how this works 🤷🏼‍♀️

Just haven't found anything indicating this in the data hub

pvprodk commented 1 year ago

Oh, I thought they were somewhere in Data hub already.

There are quite a lot of variables in order to get the total cost of exporting 1kWh. Here is an example from my internal calculation: image

noerremark commented 1 year ago

Wouldn't rule out that they are in the data hub.

Seems you are right, they're not there. So, we're left with either manually keeping things updated, or some kind of crowd sourcing?

tobenski commented 9 months ago

I don't think as private small producer I'm paying to sell power - just not getting paid... So a minimum 0 feature for the calculated price would be nice :)

Are you sure about this? and what about the Tarifffs? du we still pay them even tho the sell price is less than zero?

example: if the sell price is -1.00 (effectivly 0) then the calculation woul dbe something like: 0 - (N1 indfødningstariff) 0,0150 - (energinets indfødningstariff) 0.0030 - (enierginet balance tarrif) 0.0016 - (vindstød) 0.0100 = -0,0296

or is there no "indfødnings tarrif" when the price is below zero?

Peethiplatsch commented 1 month ago

There are quite a lot of variables in order to get the total cost of exporting 1kWh. Here is an example from my internal calculation:

I just wanted to have a look about my indfødningstariffen and then I saw on energinet.dk, that this will be set to 0 from 01.07. So I think you can remove this from your calculation.

https://energinet.dk/om-nyheder/nyheder/2024/05/30/energinet-nedsaetter-indfodningstariffen-for-elproducenter-til-0-kroner-i-resten-af-2024/#:~:text=Nye%20afregningstal%20for%20indf%C3%B8dningstariffen%20betyder%2C%20at%20Energinet%20nu,afh%C3%A6ngig%20af%20hvilket%20geografisk%20omr%C3%A5de%20anl%C3%A6gget%20ligger%20i.