Page 3 of 6
Re: Energy Dashboard - Template
Posted: Saturday 01 June 2024 19:47
by FireWizard
@McMellow,
Thanks for the link.
I will have a look.
Regards
Re: Energy Dashboard - Template
Posted: Saturday 01 June 2024 21:40
by gizmocuz
My template adjustments are only for users with a battery, do not use it if you have no battery
The code needs adjustedments if you want disable the battery
I posted it here as as is... Will do some more work
Cache is still an issue, will look at it later...
Re: Energy Dashboard - Template
Posted: Saturday 01 June 2024 22:31
by FireWizard
Good evening @gizmocuz,
Thanks for your response.
I did not know, that it was only intended for users with a battery.
Regards
Re: Energy Dashboard - Template
Posted: Sunday 02 June 2024 8:23
by gizmocuz
No worries... But... please find here a version that you can also use without a battery, please see inside the file how to use it
I also added the option for a Water meter

- EnergyDashboardBattery.jpg (108.97 KiB) Viewed 1591 times
Edit: New dashboard where items are placed aligned, and changed the icons
Re: Energy Dashboard - Template
Posted: Sunday 02 June 2024 16:03
by HvdW
Three things
- wonderfull, I like it
- I changed the background color to #48597f which comes near to the simple-gray color I'm using in my domoticz (which # is the simple-gray?)
- It does update in Edge, in Firefox it's the basic display without the input being displayed. How come?
Re: Energy Dashboard - Template
Posted: Sunday 02 June 2024 16:26
by gizmocuz
@HvdW, which version are you using? Did you try mine? Does that work in Firefox?
You can open the browsers developers console to check for errors
Edit: Just checked, it works in Firefox as well, so have a look at the browsers error console
Re: Energy Dashboard - Template
Posted: Sunday 02 June 2024 16:34
by HansieNL
@HvdW You can find the simple-gray color in the domoticz/www/styles/simple-gray/custom.css file. The simple-gray color seems to be #606c88.
Re: Energy Dashboard - Template
Posted: Sunday 02 June 2024 16:40
by FireWizard
Hi @gizmocuz
i tested your latest version. looks nice. but I have also a couple of things.
I tested with Firefox and Chrome browser
1.
If I start the "Custom" page in Firefox it does not update the data.
It starts updating after I loaded the first version (1.1) of MeneerKlaas.
Returning to your latest version updates the values, but the calculation is not correct.
To show the correct picture with updating values and animation of have to refresh the page by pressing F5.
I do not know, if this is caused by the updated cache functionality.
See:

- Screenshot_Energy Dashboard.png (60.45 KiB) Viewed 1587 times
The values in the "Solar circle" and the "P1 circle" are correct.
Therefore I don't see any animation from the Solar panels to the grid.
Sometimes I notice negative values in the "Home circle". This is not expected.
2.
As I receive the water value in Liters and not in m3, I changed the script to display L instead of m3.
See the screenshot
3. If I change the viewBox:
Notes:
When not using a battery and/or water meter, set the viewBox of the SVG object below to viewBox="0 0 60 40" to remove the empty space below
I did that, because I do not have a Battery yet. (Perhaps we can use the battery of my car)
In this case the screen does not show the lower circles in landscape mode. It is okay in portrait.
I do not see, why the calculations are wrong, as they are correct in version 1.1
Regards
Re: Energy Dashboard - Template
Posted: Sunday 02 June 2024 18:12
by HansieNL
Hello @gizmocuz
When I try your version the P1 Gas correct value is shown for 1 second and then it shows 0 m3. If I use the latest MeneerKlaas version I see the correct value.
I tried different browsers and a new installed portable Firefox version. I don't see an error in the log for the gas idx. Status 200 OK.
Code: Select all
let idP1Meter = 274; // Change this value to be your ID for the Electricity Meter (P1)
let idGas = 320; // Change this value to be your ID for the Gas meter. Set to -1 when not used.
let idWater = -1; // Change this value to be your ID for the Water meter. Set to -1 when not used.
let idSolar = -1; // Change this value to be your ID for your Solar Power. Set to -1 when not used.
let idBattSetpoint = -1; // Change this value to be your ID for your Battery Watt. Set to -1 when not used.
let idBattSoc = -1; // Change this value to be your ID for your Battery SOC. Set to -1 when not used.
let sLocales = 'nl-NL'; // Update your locales. For more information see: https://www.w3schools.com/jsref/jsref_tolocalestring.asp
Re: Energy Dashboard - Template
Posted: Sunday 02 June 2024 19:07
by Kedi
Lastest from @gismocuz Animation and figures are not completely correct.

- 02.06.2024_19.04.05_REC.png (64.16 KiB) Viewed 1570 times
Re: Energy Dashboard - Template
Posted: Sunday 02 June 2024 22:05
by FireWizard
Hi @Kedi,
I see you have the same issue with the calculation of the power at home, as I have.
Now, when the solar panels stop producing, it is correct.
And how is your screen?
Also, you used a lot of water

.
You can change that to L, like I did, or you can divide it by 1000.
Regards
Re: Energy Dashboard - Template
Posted: Sunday 02 June 2024 23:07
by HvdW
gizmocuz wrote: ↑Sunday 02 June 2024 16:26
@HvdW, which version are you using? Did you try mine? Does that work in Firefox?
You can open the browsers developers console to check for errors
Edit: Just checked, it works in Firefox as well, so have a look at the browsers error console
Did a restart of Firefox and now it's there.
After every change of code for a Custom page I always do a <sudo service domoticz restart> anyway. Many Ctrl-F5 didn't help.
Same problem occured to other Custom pages as well.
Changes in a page take a long time to be displayed.
@HansieNL thanks for the color tip. Didn't know where to search inside Domoticz.
I like the square forms from the first versions more than the round forms, that why I am using that.
Domoticz may be less sophisticated than HomeAssistent but the way one can manipulate all kinds of things make it far more attrictive for me.
Thanks everyone for the nice contributions lately like those of JanPep f.i.
Re: Energy Dashboard - Template
Posted: Monday 03 June 2024 7:01
by Kedi
FireWizard wrote: ↑Sunday 02 June 2024 22:05
Hi @Kedi,
I see you have the same issue with the calculation of the power at home, as I have.
Now, when the solar panels stop producing, it is correct.
And how is your screen?
My screen is also fine when the solar panels stop producing.
Also, you used a lot of water

.
You can change that to L, like I did, or you can divide it by 1000.
Regards
On my widget it is L(iters). I did not notice that that was not transfered. I change that.
Re: Energy Dashboard - Template
Posted: Monday 03 June 2024 7:40
by gizmocuz
When you make a change in the custom template, you do not need to restart Domoticz, just clear your browser cache and press F5
I will (try to fix my code... A battery makes it rather complicated.....
Re: Energy Dashboard - Template
Posted: Monday 03 June 2024 9:31
by gizmocuz
New version, calculation is a lot simplified....
@kedi, this version should display correct values
One thing to note: If you are polling an inverter every 30 seconds, and polling the P1 meter or Battery every 5 seconds, it can happen that value's won't match.
For Instance, your Solar inverter reports 100 Watt, your grid reports -200 Watt ....
This means that in reality your Solar panels product 200 Watt or more...
A reason why I will install a Shelly EM with a CT clamp to measure it in real-time...
Re: Energy Dashboard - Template
Posted: Monday 03 June 2024 11:09
by Kedi
Tnx, The return now works now as I expected.

I already use the Shelly EM with a CT clamp
I see 0 kWh at my house now. Is that correct?
I think fDayHomeUsage is never calculated, is that correct?
Edit (again):
Got it, I think. Added
Code: Select all
// Home usage: Calculated
fDayHomeUsage = fDayNetUsage + fDaySolar - fDayNetDeliv;
fActualHomeUsage = fActualSolar;
if (fActualNet > 0) {
fActualHomeUsage += fActualNet;
}
to the getPower function.
Re: Energy Dashboard - Template
Posted: Monday 03 June 2024 14:34
by gizmocuz
@Kedi, thanks, missed that one, updated above file
Re: Energy Dashboard - Template
Posted: Monday 03 June 2024 15:21
by McMelloW
Thanks for all the work you lot have put in it.
For my understanding. What are idBattSetpoint and idBattSoc values stand for?
Re: Energy Dashboard - Template
Posted: Monday 03 June 2024 15:37
by gizmocuz
@McMelloW , If you have a battery at home, you need to charge/discharge it. You do this via a Setpoint device, like a thermostat setpoint.
You set it to 300, and it will charge with 300 Watt. Setting it to -300 it will discharge with 300 Watt
SOC (State of Charge) is a device that tells you how full a battery is, 0=empty, 100=100% full
Re: Energy Dashboard - Template
Posted: Monday 03 June 2024 16:31
by Jan Jansen
Thanks for this very nice addition!!
In any case, it's a shame that I have to use district heating. But in this case it is extra unfortunate. In my case, the daily use is shown by a custom sensor (GJ, 3 decimal places). Hopefully this can be added.