Monthly self-consumption percentage for solar energy.

Dashticz, alternative dashboard based on HTML, CSS, jQuery

Moderators: leecollings, htilburgs, robgeerts

Post Reply
pat44
Posts: 9
Joined: Saturday 23 September 2023 12:19
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Monthly self-consumption percentage for solar energy.

Post by pat44 »

Hi all,

I'm currently using the custom graph function to display information regarding my solar energy equipment.
It works pretty well. Please see the picture.
In yellow : solar production
In red : solar injection in the grid (negative value). It corresponds to the "surplus"
In blue : consumption from the grid (EDF as I reside in France).
What I want is to automatically calculate and display my self-consumption percentage (see the black line).
self-consumtion = (solar_prod + solar_injection) / solar_prod (solar_injection is negative so that's OK).

Graph display works well for Daily report since Dashticz makes the calculation based on the CounterToday information I believe.
However, I'm struggling to have a good monthly report.

What I want is just to display the self-consumption line based on accumulated energy : (Sum_SolarProd + Sum_SolarInjection)/Sum_SolarProd
So simply it corresponds to (YellowBox + RedBox)/YellowBox
But Dashticz is calculating the self-conso percentage for each day, and make the average for the entire month.
In other words, Dashticz calculates this value: avg((SolarProd/SolarInjection)/SolarProd)). avg stands for "average of".
But I would like this calculation : (Sum_SolarProd + Sum_SolarInjection)/Sum_SolarProd

If someone could help me. Thanks in advance.
Attachments
simplified_config.js
(849 Bytes) Downloaded 92 times
Capture_autoconso.JPG
Capture_autoconso.JPG (85.38 KiB) Viewed 3557 times
Last edited by pat44 on Sunday 24 September 2023 19:39, edited 1 time in total.
pat44
Posts: 9
Joined: Saturday 23 September 2023 12:19
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Monthly self-consumption percentage for solar energy.

Post by pat44 »

See the json code here:
Attachments
Capture_autoconso_code.JPG
Capture_autoconso_code.JPG (46.42 KiB) Viewed 3536 times
pat44
Posts: 9
Joined: Saturday 23 September 2023 12:19
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Monthly self-consumption percentage for solar energy.

Post by pat44 »

Please see below the picture showing the issue I have for August.
Self-consumption (also called auto-consumption) should be "100*(833,74-196,56)/833,74 = 76,4 %"
But Dashticz is returning 79,81% because it calculates the average of daily percentage for all the days in August.

The problem seems to be very straighforward and easy to solve.
But I think Dashticz is simply not appropriate to make such a calculation. It would require something as an intermediate function to make a monthly calculation and return this value to the custom graphic function. I dont' know if this is possible ? Or maybe I'm missing a simpler solution ?
However, I love very much Dashticz for its infinite possiblities, it is a very nice domoticz extension.
Attachments
Capture_autoconso_code_august.JPG
Capture_autoconso_code_august.JPG (27.03 KiB) Viewed 3487 times
Lokonli
Posts: 2290
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Monthly self-consumption percentage for solar energy.

Post by Lokonli »

I understand the issue.

Probably I can add something to compute results from the aggregated data.
Like:

Code: Select all

   data: [
      SolarInj: 'd.v_277',
      SolarProd: 'd.v_274',
      GridConso: 'd.v_278'
   ],
   data_aggr: [
      AutoConso: '(aggr.SolarProd + aggr.SolarInj)*100/aggr.SolarInj'
  ]
Would this fulfill your needs? Additional suggestions?
pat44
Posts: 9
Joined: Saturday 23 September 2023 12:19
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Monthly self-consumption percentage for solar energy.

Post by pat44 »

Yes it would fully satisfy my needs.
Is this "data_aggr" method already present or you plan to add it ?
Thanks so much for your quick answer.
Lokonli
Posts: 2290
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Monthly self-consumption percentage for solar energy.

Post by Lokonli »

pat44 wrote: Friday 29 September 2023 9:37 Yes it would fully satisfy my needs.
Is this "data_aggr" method already present or you plan to add it ?
Thanks so much for your quick answer.
I plan to add it before the end of the year.
pat44
Posts: 9
Joined: Saturday 23 September 2023 12:19
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Monthly self-consumption percentage for solar energy.

Post by pat44 »

Perfect, thanks!
pat44
Posts: 9
Joined: Saturday 23 September 2023 12:19
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Monthly self-consumption percentage for solar energy.

Post by pat44 »

Hi @Lokonli, did you have time to work on this issue ?
Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest