I haven’t done anything about the 7000 kr tax rule, since i really don’t expect me to have that amount of payback for my exported power.
My Nettopower_salg sensor is a template i created, using the nordpool integration to calculate the price.
This shows the current sales price to Nettopower, and also the sales price for the next 48 hours, as long as the nordpool sensor also has the next 48 hours (which it usually has)
- platform: template
sensors:
nettopower_salg:
value_template: '{{ (states("sensor.nordpool_kwh_dk2_dkk_5_10_0")|float - 0.00375 - 0.000875 - 0.04)|round(3, floor) }}'
friendly_name: "Nettopower salgspris"
unit_of_measurement: "DKK/kWh"
unique_id: nettopower_salg
attribute_templates:
today: >
{% if state_attr('sensor.nordpool_kwh_dk2_dkk_5_10_0', 'today') %}
{% set ns = namespace(prices=[]) %}
{% for h in range(24) %}
{% set ns.prices = ns.prices + [(float(state_attr('sensor.nordpool_kwh_dk2_dkk_5_10_0', 'today')[h]) - 0.00375 - 0.000875 - 0.04) | round(3, floor)] %}
{% endfor %}
{{ ns.prices }}
{% endif %}
tomorrow: >
{% if state_attr('sensor.nordpool_kwh_dk2_dkk_5_10_0', 'tomorrow') %}
{% set ns = namespace(prices=[]) %}
{% for h in range(24) %}
{% set ns.prices = ns.prices + [(float(state_attr('sensor.nordpool_kwh_dk2_dkk_5_10_0', 'tomorrow')[h]) - 0.00375 - 0.000875 - 0.04) | round(3, floor)] %}
{% endfor %}
{{ ns.prices }}
{% endif %}
Can you unpack the individual numbers and show the graphs to see where there is an inconsistency.
Multiplying the power (kW) by the variable cost ($/ KWh) gives you an instant savings value of how much you are saving at any point in time ($/h).
The Riemann sum is then used to calculate (add up) the integral over a period of time say one hour or one day, which gives you the total cost/ savings over that period
The integral is always adding a “unit_time” prefix to the sensor.
So in this case its an “h” as its the default, so its presented as “krh”
Been trying to get around this by playing with the “unit_time” variable but without success.
Any suggestions
edit: I mean without cheating and using the customizing function ofc…
Thanks for the solar benefit calculation and apexchart codes. It didi the trick.
To give a little back I saw that you limited the graph to show up to 50, because otherwise monthly number will raise it to 390 in your example. There a trick to avoid it and still use dynamic scaling. Use second y-axis, show: false and assign first axis to the daily data and second axis to the monthly data.
yaxis:
- id: first
decimals: 2
- id: second
show: false
series:
- entity: sensor.pv_own_usage_benefit_daily
yaxis_id: first
...
- entity: sensor.pv_to_grid_benefit_daily
yaxis_id: first
...
- entity: sensor.total_pv_monthly_benefit
yaxis_id: second
...
I’m using similar similar approach, but calculating solar energy own use saving (electricity price including VAT + nwtwork Tariffs) and sold to grid (electricity price without VAT). I live in Estonia and we have nordpool hour by hour pricices for electricity. Anyway, my outcome:
zeronounours is very much on the topic of LTS, he has published multiple components in HACS that help us create and show long term statistics ourselves like the Energy Dashboard does.
Using his components I was able to create the entities to keep track of cost of total energy usage and compensation for self-used energy. Together with cost of imported energy and compensation for exported energy already tracked by the Energy Dashboard this results in an overview like this:
The bottom two being what I didn’t have to pay for energy used by my household, and the money I got back for my over-produced energy. Together these are what I earned in one day towards my investments for my solar installation. Once I’ve got more data I will be able to select it for a longer period too.
@rrozema That’s nice, but since I do not want to hazzle around with HA, but stability is for me #1 priority, I do not use HACS. I only use the plain official standard HA. I think this missing cost saving should be added to the standard energy dashboard.
And then the next person wants to do similar things for their battery investment and needs even other entities tracked. Please aim for a more generic solution -alike zeronounours’- than just adding this one entity to the dashboard.
I think I’ve set the templates, reiman, and utility meters up correctly, but noticed that when my battery is charging at night the benefit goes negative. Does that line up with your logic?
My hope is to eventually get a countdown till the system has paid for itself, but given this is my first time using templates that may be overly ambitious.
When charging your battery there is a cost involved, so the benefit goes down. Hopefully you charge during the cheap times/ excess solar.
Then when you eventually discharge from your battery you make the benefits, hopefully when the price is higher, so overall your battery costs should be lower than the benefits for each day which means you are in front.
Your solar benefits should only ever increase, as you typically don’t pay for exports (although we do in Australia sometimes have negative feed in prices).
That makes total sense, my battery charges overnight at 7p per kWh and discharges during the 30p period so there should be some nice value there too offset the “cost”. Thanks again!