chpro / fronius-grafana-dashboard

Setting up and visualizing data from your Fronius Symo GEN24 10.0 inverter and Smart Meter TS 65A-3 using InfluxDB and Grafana.
MIT License
34 stars 2 forks source link

Storage Values/Solar Energy per Timeframe #8

Open robotnikz opened 3 months ago

robotnikz commented 3 months ago

Hey @chpro,

sorry to bother you. I have two additional questions.

  1. How is it possible there is a higher value for "from Storage" than "to Storage". Am I making a mistake here? I am exactly using you json for the Dashboard and I also saw this on your readme example.

grafik

compared to my HomeAssistant what is exactly like the SolarWeb Application says. grafik

  1. How can I make an additional panel for "Solar Energy produced" for the Dashboard timeframe? I tried to figure out via expression and math etc. but I cant make it work. May I ask you for your help? For my understanding it must be something like Home Usage - From Grid - From Storage + To Grid + To Storage. Do you have a code snippet for that by a chance :) ?

Thank you. :)

chpro commented 3 months ago
  1. Form Storage and To Storage are currently calculated from the power values via an integral function which is only an approximation of the energy used. I have not had time to document this and did not find the value which represents the energy as for local energy production. Currently 1 measurement a minute is in influx, I assume a lower deviation when the data is collected more frequently.
  2. I was also struggling with that that's why currently the Local Energy Production incorporates both from battery and solar panels (which is the provided value by the API) and it is also related to the inaccuracies of the From/To storage calculation. When the From/To Storage values would reflect the real values more accurately the calculation can easily be done within the transformation tab in Grafana. You would then have 5 queries which return the above mentioned values and do the calculation in transformation tab.
robotnikz commented 3 months ago
  1. I see, I've changed every interval (except solar forecast ofc) to 10s yesterday. Just trying it out.
  2. OK I'll try to figure out further on that at the Weekend.

Thanks for your fast response

robotnikz commented 3 months ago

Hi again, In my opinion, reducing the interval does not result in any improvement but I am not sure. I still have differneces in from Storage but Home Usage looks quite good.

HA: grafik

Grafana: grafik

I'll keep following it and look for a way to get more accurate values. After all, the Fronius integration of Home Assistant with the same API manages to get fairly accurate values. I don't yet understand the difference.

Thank you very much for your great work. Very much appreciate that.

BTW: Today was a niiice day for PV :-P

chpro commented 3 months ago

Thanks for the praise and input. I will try to improve the accuracy and investigate how HA does the calculation. Have some time in summer to investigate that further. When there is an improvement I will post an update.

chpro commented 3 months ago

@robotnikz Had some time to take a look at the queries for From Storage and To Storage there is a Group By clause which may have a negative effect on the precision if you still have the data available you may want to remove GROUP BY time(1s) fill(0) and change select clause to integral("P_Akku", 1h) in these queries and check if the situation improves. Thank you for your help.

Queries would look like for from storage

SELECT integral("P_Akku", 1h) FROM "autogen"."powerflow" WHERE ("P_Akku"::field >= 0) AND $timeFilter tz('${tz:raw}')

and for to storage

SELECT abs(integral("P_Akku", 1h)) FROM "autogen"."powerflow" WHERE ("P_Akku"::field <= 0) AND $timeFilter tz('${tz:raw}')

Here are some hints https://community.grafana.com/t/different-integral-results-by-changing-time-range/41007/11

robotnikz commented 3 months ago

@chpro Thanks! Will try that out and give feedback.

robotnikz commented 3 months ago

This is the situation at 4p.m. today

Grafana: grafik

Home Assistant: (same as mentioned in Fronius SolarWeb) grafik

From/To Grid is great. From Storage is always too high in Grafana, so from Storage.

robotnikz commented 2 months ago

Hey again @chpro,

I tried to figure out how to solve the gap between Home Assistant and the Grafana queries but at the end I came back to your last proposed solution since I was unable to find a more accurate way to read all the data.

Update from yesterday.

Home Assistant: grafik

Grafana: grafik

Think that wont help you here, just as a last update here from my side. Will report back if I found a better solution. Thanks for your work again. Enjoy the sun! :)