Energy Dashboard - Template

In this subforum you can show projects you have made, or you are busy with. Please create your own topic.

Moderator: leecollings

User avatar
McMelloW
Posts: 434
Joined: Monday 20 November 2017 17:01
Target OS: Raspberry Pi / ODroid
Domoticz version: V2024.1
Location: Harderwijk, NL
Contact:

Re: Energy Dashboard - Template

Post by McMelloW »

gizmocuz wrote: Monday 03 June 2024 15:37 @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
@gizmocuz Thanks for the explanation. I was thinking of making the Vitual Solar Battery visual. See this topic https://www.domoticz.com/forum/viewtopi ... al+battery But this does not have a fixed charge /discharge value.
Greetings McMelloW
User avatar
Sjonnie2017
Posts: 365
Joined: Wednesday 02 August 2017 19:43
Target OS: Linux
Domoticz version: Latest ß
Location: The Netherlands
Contact:

Re: Energy Dashboard - Template

Post by Sjonnie2017 »

McMelloW wrote: Wednesday 29 May 2024 11:29
Sjonnie2017 wrote: Wednesday 29 May 2024 6:09 That's the device I use (339) which gives me this result. Will investigate further later on this day.

Tx foor your reply!
Hi Sjonnie, my SolarEdge is connected to Domoticz with the SolarEdge Modbus TCP hardware. The values in Domoticz are directly from the inverter and change every 10 sec. The values in the app are from the SolarEdge website and change every 15 min. So the is some difference between Domoticz and the app.

The only thing I did is changed the index number for idP1Meter; idGas; idSolar. And works like a charm. Much succes in getting it working OK.
So I finally got the time to check my issue. As it turns out I had made changes to my network some time ago and as a result the SolarEdge got a new IP which I forgot to modify in Domoticz. Never noticed it because I use the values of my Youless on my dashboard :oops:

All working fine now.
ConBee II - TRÅDFRI lights + switches, loads of ChingLing dimmers and switches, Heiman and Xiaomi sensors
SolarEdge SE4000H (with active modbus_tcp)
YouLess Energy meter
Shelly 2.5 in roller shutter mode
Tuk90
Posts: 50
Joined: Thursday 04 January 2024 15:44
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Energy Dashboard - Template

Post by Tuk90 »

Nice functionality!

Will this be included as default functionality in a next release? If not is it possible for the owner/maintainer of this code to create a git for it?
User avatar
andreo
Posts: 45
Joined: Friday 07 August 2015 21:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.3
Location: Anna Paulowna, Netherlands
Contact:

Re: Energy Dashboard - Template

Post by andreo »

gizmocuz wrote: Monday 03 June 2024 14:34 @Kedi, thanks, missed that one, updated above file
Has the modified code been included in the above file?
The fDayHomeUsage value is still zero.

The water and gas meter values ​​still occasionally go to zero and then display the correct value again. (same as HansieNL)
Latest version of Domoticz and more running on Docker|Raspberry Pi 4-B 8GB Bookworm|RF-Link|Klik Aan Klik Uit|Nefit easy|ESPeasy|P1 power meter|S0PCM-5 through Ser2Net|Alecto WS5500|FrtizBox|Satel Integra|Solis
Greetz Andre.
User avatar
gizmocuz
Posts: 2537
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Energy Dashboard - Template

Post by gizmocuz »

New file with correct 'fDayHomeUsage '

The previous patch from @kedi was not 100% correct as he did some more and it needed only the 'fDayHomeUsage' calculation

Some answers below:

@HansieNL, best to debug the code. If you run Domoticz with the parameter -nocache nothing is cached and you can add some debug lines (like console.log(somevalue); or alert(somevalue)
Else clear your browser cache each time you make a change

@kedi, I think this was caused by your changes. Try the version in this post

There are now options to specify if your water meter reports in 'm3' or already in 'liters', and if it is m3, there is an option to convert it to 'liters' (*1000)

@HvdW, yes everything is cached, when making a change, see my answer to @HansieNL above

@Jan Jansen, It should now be possible to use a Custom Sensor for both Gas and Water values

@McMelloW, I think this is all virtual and not a real battery system? If it was a real battery you would need to charge/discharge it, so there would be s setpoint device

@Tuk90, maybe... But remember this @MeneerKlaas his work... Best if he also has a look at the changes I made

@andreo, Yes, but you need to clear your browser cache when there is a change made to this file (see reply to @HansieNL)
No idea why the gas goes to zero... maybe it's solved now (don't experience this here), but otherwise please do some debugging. It is javascript not rocket science. Everything is also cleaned up and should be easy to understand

Energy_Dashboard.zip
(6.42 KiB) Downloaded 63 times
Quality outlives Quantity!
Kedi
Posts: 575
Joined: Monday 20 March 2023 14:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Somewhere in NL
Contact:

Re: Energy Dashboard - Template

Post by Kedi »

Sorry, in a hurry I just copied the code from previous source. Did not check at that moment the real values.
It works almost perfect now. somethimes the rounding is not done. I work with a Raspberry Pi 4b
Logic will get you from A to B. Imagination will take you everywhere.
User avatar
gizmocuz
Posts: 2537
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Energy Dashboard - Template

Post by gizmocuz »

@kedi, I just noticed this myself, here a new version (Also updated post above)

Updated 4/6/2024, Added option to disable Watermeter, making sure 'rest' grid goes to solar
Energy_Dashboard.zip
(6.76 KiB) Downloaded 44 times
Quality outlives Quantity!
User avatar
McMelloW
Posts: 434
Joined: Monday 20 November 2017 17:01
Target OS: Raspberry Pi / ODroid
Domoticz version: V2024.1
Location: Harderwijk, NL
Contact:

Re: Energy Dashboard - Template

Post by McMelloW »

@gizmocuz
Tried out you latest dashboard upload. I just noticed you removed the sLocales = 'nl-NL';

Further I see the odd situation have a negative usage (156 watt) going from my home towards the grid. How is this possible?
Grid = -1085 Watt, Solar = 929 Watt (no battery used)

Edit: (By GizMoCuz) Don't just post an image if there is no need for it... It is flooding my forum disk usage !.... :geek:
Greetings McMelloW
User avatar
gizmocuz
Posts: 2537
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Energy Dashboard - Template

Post by gizmocuz »

@McMelloW, I have explained this before. Your Solar kWh sensor is not updating in the same interval as your Grid.
You can do the Math... 929 From Solar, Grid = -1085 ... we miss -156 .... has to come from somewhere

An option is to tweak the code:

a) If you have no battery, we must assume it comes from the Solar panels ..
b) If you have a battery, it could come from the battery, or from the Solar panels... Probably because of the battery setpoint, it's still from the Solar Panels

So, the option would be to add 156 to the Solar Panel value

Probably users are going to make comments on this as well, but it seems logical.
Quality outlives Quantity!
User avatar
McMelloW
Posts: 434
Joined: Monday 20 November 2017 17:01
Target OS: Raspberry Pi / ODroid
Domoticz version: V2024.1
Location: Harderwijk, NL
Contact:

Re: Energy Dashboard - Template

Post by McMelloW »

@gizmocuz
Thanks for the explanation. The Solar kWh senor interval is definitely not in sync with the P1 Smart Meter. No battery is in use.
Greetings McMelloW
User avatar
gizmocuz
Posts: 2537
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Energy Dashboard - Template

Post by gizmocuz »

@McMelloW, I updated the dashboard in the post above, and now the 'rest' grid is added to the Solar
Yes, I removed the 'local' mombojumbo stuff, it is not used anywhere in Domoticz, it was also done on some none-number items
Quality outlives Quantity!
User avatar
McMelloW
Posts: 434
Joined: Monday 20 November 2017 17:01
Target OS: Raspberry Pi / ODroid
Domoticz version: V2024.1
Location: Harderwijk, NL
Contact:

Re: Energy Dashboard - Template

Post by McMelloW »

gizmocuz wrote: Tuesday 04 June 2024 15:40 @McMelloW, I updated the dashboard in the post above, and now the 'rest' grid is added to the Solar
Yes, I removed the 'local' mombojumbo stuff, it is not used anywhere in Domoticz, it was also done on some none-number items
Thanks, loooks nice this way.
Greetings McMelloW
User avatar
gizmocuz
Posts: 2537
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Energy Dashboard - Template

Post by gizmocuz »

New template:

- Rebuild to AngularJS, needed later to add it as default in the system
- The template is now dynamically sized based on the sensors enabled
- It is now possible to disable Gas, enable Water, and the two will be swapped.
If you are not using a battery, the height of the template will still be small

Energy_Dashboard.zip
(7.21 KiB) Downloaded 46 times
Quality outlives Quantity!
HvdW
Posts: 612
Joined: Sunday 01 November 2015 22:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Twente
Contact:

Re: Energy Dashboard - Template

Post by HvdW »

Thank you for the new version.

There's an unintended drop of water in the view.
Bugs bug me.
User avatar
gizmocuz
Posts: 2537
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Energy Dashboard - Template

Post by gizmocuz »

@HvdW, please do not post screenshots, as explained above this is polluting my forum disk size.
Should be fixed in the file above (just updated)
Also, the animation speed should be more consistent, so the dashed lines are not restarting by a small change in wattage.

It has no use to change the background yet... Do not modify it as there will be a dozen more updates until it is finalized.
If it is going to be added into Domoticz it needs to be styled in stylesheets and not in the SVG
Patiance... And nothing wrong with a white background for now
Quality outlives Quantity!
User avatar
HansieNL
Posts: 964
Joined: Monday 28 September 2015 15:13
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Energy Dashboard - Template

Post by HansieNL »

@gizmocuz Values for gas are correct now :-)
The solar panel is shown now with 0 values but setting is -1. Should it be removed if setting is -1?
Blah blah blah
User avatar
gizmocuz
Posts: 2537
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Energy Dashboard - Template

Post by gizmocuz »

@HansieNL, great!

New version (1.5):
- Dynamic battery icon
- Keep animation consistent if speed does not change
- Added Text SVG object
- Now hiding all solar objects if idSolar equals -1

Energy_Dashboard.zip
(7.75 KiB) Downloaded 62 times
Quality outlives Quantity!
eddieb
Posts: 335
Joined: Wednesday 04 July 2018 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Energy Dashboard - Template

Post by eddieb »

Just upgraded from 1.1 to 1.5 !
Looking fine
RPI4 Beta / Tasmota / ZigBee2MQTT / P1meter / Haier AC with Node-Red and MQTT / SolarEdge SE3500H modbus_tcp / Opentherm gateway / Plugwise Anna/Smile / ObserverIP weatherstation thru WuDirect
Feeding ADSB https://adsb.im/home
User avatar
McMelloW
Posts: 434
Joined: Monday 20 November 2017 17:01
Target OS: Raspberry Pi / ODroid
Domoticz version: V2024.1
Location: Harderwijk, NL
Contact:

Re: Energy Dashboard - Template

Post by McMelloW »

Just upgraded to 1.5 The idTextObj works OK too. I use the status of my inverter to display this way.
Greetings McMelloW
User avatar
Xenomes
Posts: 416
Joined: Tuesday 27 November 2018 19:05
Target OS: Linux
Domoticz version: 2025.1
Location: Netherlands
Contact:

Re: Energy Dashboard - Template

Post by Xenomes »

Very need!

Did made a script to add to the customstart.sh for the docker users.

Code: Select all

#link to version 1.10
wget https://www.domoticz.com/forum/download/file.php?id=32760 -O download.zip
unzip -o download.zip
rm download.zip
declare -A replacements=(
    ["idP1Meter"]=1
    ["idGas"]=2
    ["idWater"]=3
    ["bWaterMeterInM3"]=true
    ["convertWaterM3ToLiter"]=true
    ["idSolar"]=4
    ["idBattSetpoint"]=-1
    ["idBattSoc"]=-1
    ["idTextObj"]=-1
    ["lblCurrency"]="\"€"\"
    ["bEnableServerTime"]=true
    ["idItemH1"]=-1
    ["fieldH1"]="\"Usage"\"
    ["iconH1"]="\"car"\"
    ["idItemH2"]=-1
    ["fieldH2"]="\"Data"\"
    ["iconH2"]="\"heater"\"
    ["idItemH3"]=-1
    ["fieldH3"]="\"Data"\"
    ["iconH3"]="\"other"\"
)

for key in "${!replacements[@]}"; do
    value=${replacements[$key]}
    sed -i "s/\(\$scope\.$key = \).*\+;/\1$value;/" Energy_Dashboard.html
done
Last edited by Xenomes on Saturday 08 June 2024 16:05, edited 6 times in total.
HP T630 (256GB SSD/8GB Mem) - Ubuntu 24.04.2 LTS (64Bit) - Domoticz 2025.1 (Docker) Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
Locked

Who is online

Users browsing this forum: No registered users and 1 guest