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

MeneerKlaas
Posts: 11
Joined: Monday 25 September 2017 17:50
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: Energy Dashboard - Template

Post by MeneerKlaas »

Hi eddieb, this was my choose, since you now can also disable Solar (and Gas). Then the values align more nicely.
But I agree with you. The purple line on top is nicer. With the next version I will change it back.
Klaas

Raspberry Pi 3: Domoticz, RFXtrx433, Zigbee2MQTT, MQTT, P1 meter, SMA Solar Inverter (modbus TCP/IP)
My Hobby Page about Domoticz & ESP8266
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 »

I have been experimenting with this dashboard and could use some help getting things to work. I get the readings for gas but not for electricity. The IDX for my (YouLess) P1 meter Electricity is 199.
2024-05-20_15-54.png
2024-05-20_15-54.png (13.09 KiB) Viewed 2106 times
The result for this code:

Code: Select all

$.getJSON('/json.htm?type=command&param=getdevices&rid=199', function(data){
  console.log('CounterToday: ' + parseFloat(data["result"][0]["CounterToday"].slice(0, -4).replace(',','.')));
  console.log('CounterDelivToday: ' + parseFloat(data["result"][0]["CounterDelivToday"].slice(0, -4).replace(',','.')));
  console.log('Usage: ' + parseFloat(data["result"][0]["Usage"].slice(0, -5).replace(',','.')));
  console.log('UsageDeliv: ' + parseFloat(data["result"][0]["UsageDeliv"].slice(0, -5).replace(',','.')));
});
is

Code: Select all

$.getJSON('/json.htm?type=command&param=getdevices&rid=199', function(data){
  console.log('CounterToday: ' + parseFloat(data["result"][0]["CounterToday"].slice(0, -4).replace(',','.')));
  console.log('CounterDelivToday: ' + parseFloat(data["result"][0]["CounterDelivToday"].slice(0, -4).replace(',','.')));
  console.log('Usage: ' + parseFloat(data["result"][0]["Usage"].slice(0, -5).replace(',','.')));
  console.log('UsageDeliv: ' + parseFloat(data["result"][0]["UsageDeliv"].slice(0, -5).replace(',','.')));…
Object { readyState: 1, getResponseHeader: getResponseHeader(e), getAllResponseHeaders: getAllResponseHeaders(), setRequestHeader: setRequestHeader(e, t), overrideMimeType: overrideMimeType(e), statusCode: statusCode(e), abort: abort(e), state: state(), always: always(), catch: catch(e)
, … }

CounterToday: 8.233 debugger eval code:2:11
CounterDelivToday: 4.447 debugger eval code:3:11
Usage: 1481 debugger eval code:4:11
UsageDeliv: 0
Which looks OK but nothing shows in the dashboard.

I can't get any result for my SolarEdge inverter. The hardware ID is 18 but that generates no results:

Code: Select all

$.getJSON('/json.htm?type=command&param=getdevices&rid=18', function(data){
  console.log('CounterToday: ' + parseFloat(data["result"][0]["CounterToday"].slice(0, -4).replace(',','.')));
  console.log('Usage: ' + parseFloat(data["result"][0]["Usage"].slice(0, -5).replace(',','.')));
});
Object { readyState: 1, getResponseHeader: getResponseHeader(e), getAllResponseHeaders: getAllResponseHeaders(), setRequestHeader: setRequestHeader(e, t), overrideMimeType: overrideMimeType(e), statusCode: statusCode(e), abort: abort(e), state: state(), always: always(), catch: catch(e), … }

Uncaught TypeError: data.result is undefined
    <anonymous> debugger eval code:2
    jQuery 8
    <anonymous> debugger eval code:1
debugger eval code:2:45
Uncaught TypeError: data.result[0].CounterToday is undefined
    getSolar http://192.168.xxx.190:2080/#/Custom/Energy Dashboard v1.1 line 2 > injectedScript:39
    jQuery 8
    updatePower http://192.168.xxx.190:2080/#/Custom/Energy Dashboard v1.1 line 2 > injectedScript:38
    <anonymous> http://192.168.xxx.190:2080/#/Custom/Energy Dashboard v1.1 line 2 > injectedScript:127
192.168.xxx.190:2080:39:27
Uncaught TypeError: document.getElementById(...) is null
    updatePower http://192.168.xxx.190:2080/#/Custom/Energy Dashboard v1.1 line 2 > injectedScript:117
    jQuery 8
    updatePower http://192.168.xxx.190:2080/#/Custom/Energy Dashboard v1.1 line 2 > injectedScript:115
    <anonymous> http://192.168.xxx.190:2080/#/Custom/Energy Dashboard v1.1 line 2 > injectedScript:127
192.168.xxx.190:2080:117:69
Uncaught TypeError: data.result[0].CounterToday is undefined
    getSolar http://192.168.xxx.190:2080/#/Custom/Energy Dashboard v1.1 line 2 > injectedScript:39
    jQuery 8
    updatePower http://192.168.xxx.190:2080/#/Custom/Energy Dashboard v1.1 line 2 > injectedScript:38
    <anonymous> http://192.168.xxx.190:2080/#/Custom/Energy Dashboard v1.1 line 2 > injectedScript:127
192.168.xxx.190:2080:39:27
Uncaught TypeError: document.getElementById(...) is null
    updatePower http://192.168.xxx.190:2080/#/Custom/Energy Dashboard v1.1 line 2 > injectedScript:117
    jQuery 8
    updatePower http://192.168.xxx.190:2080/#/Custom/Energy Dashboard v1.1 line 2 > injectedScript:115
    <anonymous> http://192.168.xxx.190:2080/#/Custom/Energy Dashboard v1.1 line 2 > injectedScript:127
192.168.xxx.190:2080:117:69
I have tried a number of Device ID's but none of the give any results. These devices are available in Domoticz:
2024-05-20_16-00.png
2024-05-20_16-00.png (228.2 KiB) Viewed 2106 times
Would appreciatie some guidance :)
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
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 »

did you try 339 for your solaredge ?
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
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 »

eddieb wrote: Monday 20 May 2024 16:45 did you try 339 for your solaredge ?
Thanks for your support!

Yes, I did use that IDx but no result. I even restarted Domoticz to be sure.

Just to add: I use my SolarEdge through the Modbus TCP plugin from IronWolf (iirc). My Domoticz installation is running in a Docker environment (with the templates folder exposed to the system as per the Wiki).

EDIT: You rock! I forgot that I had to remove the cookies :lol: Silly me! :mrgreen:
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
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 »

@Meneer Klaas

Thanks for this template. It works OK.
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 »

Just to add: The dashboard allways shows 497,2 Watt production. Rain or shine, day or night, it never changes. Anyone any clue how to get the proper value?

Tx!
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
akamming
Posts: 368
Joined: Friday 17 August 2018 14:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Energy Dashboard - Template

Post by akamming »

This is really nice. And easy to set up. ... and great improvement for the UI. Would be really nice if you click on the P1 meter that you then get this view.

Can't you create a PR to have it included as a regular feature?
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 »

Sjonnie2017 wrote: Tuesday 28 May 2024 17:20 Just to add: The dashboard allways shows 497,2 Watt production. Rain or shine, day or night, it never changes. Anyone any clue how to get the proper value?
My production is the same as it is in the SolarEdge app.
Greetings McMelloW
DiaDomo
Posts: 37
Joined: Saturday 28 March 2020 13:55
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

Re: Energy Dashboard - Template

Post by DiaDomo »

Very nice! This was on my wish list!
One request ;) : I would like to add my water meter to this dashboard. I'm not very familiar with the coding, so maybe you can help me.
The watermeter is of type: General, Counter incremental. It shows in the right top corner the amount of today (in m3) and
in the box the total amount of used water m3.
Also I have a device called Waterflow - Type General, Waterflow, showing the waterflow in liter per minute. This could maybe also be added to the dashboard.
I would appreciate your help very much.
Attachments
Waterflow.png
Waterflow.png (18.76 KiB) Viewed 1941 times
Watermeter.png
Watermeter.png (34.54 KiB) Viewed 1955 times
Last edited by DiaDomo on Tuesday 28 May 2024 19:25, edited 2 times in total.
Raspberry PI 2 & 3 & 4 | RFlink | MySensors | ESP32 | Homebridge | Tasmota Sonoff | Zigbee2Mqtt | ADS-B
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: Tuesday 28 May 2024 18:10 My production is the same as it is in the SolarEdge app.
Great! So it should work with a SolarEdge converter :) Could you show me which Domoticz device you used? Might be that I am using the wrong one :roll:
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
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 »

Sjonnie2017 wrote: Tuesday 28 May 2024 19:04
McMelloW wrote: Tuesday 28 May 2024 18:10 My production is the same as it is in the SolarEdge app.
Great! So it should work with a SolarEdge converter :) Could you show me which Domoticz device you used? Might be that I am using the wrong one :roll:
idP1 = Power - (Energy subtype)
idSolar = Total Energy (General subtype) - kWh

In your picture, use 339
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: Tuesday 28 May 2024 22:06
idP1 = Power - (Energy subtype)
idSolar = Total Energy (General subtype) - kWh

In your picture, use 339
That's the device I use (339) which gives me this result. Will investigate further later on this day.

Tx foor your reply!
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
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 »

works fine with solaredge here, no issues
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 »

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.
Greetings McMelloW
User avatar
FireWizard
Posts: 1886
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: Energy Dashboard - Template

Post by FireWizard »

Hello @MeneerKlaas

Great job, looks good.

Using it with P1 Electricity/Gas and Enphase micro inverters.
Operational in 5-10 minutes, however do not forget to clear your browser cache.

Thank you very much for this application.

Regards
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 »

Looking great!! Maybe something to add by default (or as example)

Would be great if a Battery could be implemented.
As a battery can import/export (like the P1), maybe it is best to use a Usage/Electric (Watt) device for this?
I am sure 'heggink' is able to tweak his two sensors into one that puts in into a Watt device
But it would also be nice to display the capacity of the battery (like 2.4 kWh)

Maybe we need two templates, one without and one with battery?

Is it possible you can check this into a Github project?

Edit: I modified your file to include the support for a battery, I'm no expert in SVG !
(And the code is not correct/finished yet)
EnergyDashboardBatt.png
EnergyDashboardBatt.png (42.15 KiB) Viewed 1749 times
Please feel free to use/modify it

Maybe you can place all in groups and position the groups differently when a battery is used
Attachments
EnergyDashboardBatt.zip
(3.9 KiB) Downloaded 96 times
Quality outlives Quantity!
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 »

@FireWizard, in the upcoming beta browser caching will be disabled for all custom template related items (page/images etc)

@MeneerKlaas, I am cooking something at the moment and optimized the SVG as well. Not sure if you are using a editor for this, but I am using a text editor now in combination with https://www.svgviewer.dev/
This is keeping everything tidy.

Adding a battery makes things a bit more complicated... some solar power can go into the battery as well

I also made the item outline a circle... It starts to look a lot like HASS this way...
Question, did you took these icons from HASS? Or did you found them on a website and are they free to use?
(For example, my battery icon is a found one)
Otherwise, it is not so nice to use them. For example, the Solar Panel icon looks like a combination of two icons specifically made for this
I know the home, gas are free to use

https://www.svgrepo.com/vectors/solar/

If I got the code right for the battery I will post the custom page here
Quality outlives Quantity!
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 »

I think it's working. At the top of 'UpdateScreen' you can enable some debugging to test
Attachments
EnergyDashboard.zip
(4.72 KiB) Downloaded 66 times
Quality outlives Quantity!
User avatar
FireWizard
Posts: 1886
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: Energy Dashboard - Template

Post by FireWizard »

Hi, @gizmocuz

I tested your latest version of the Energy Dashboard.

Unfortunately I'm not able to test a Battery, as I do not own it.
So I inserted -1 for idBattSetpoint and idBattSoc.

In this case the custom page displays a default value of 80%. Is that as intended?

You wrote:
@FireWizard, in the upcoming beta browser caching will be disabled for all custom template related items (page/images etc)
It has not been a problem for me to clear the cache, i mentioned it, because other users might experience the same.

One issue I discovered, compared with the first release of @MeneerKlaas.

I upgraded to the latest beta 16027 and at the same time I installed the version 1.2 of this template, followed by a restart of Domoticz.
After the restart Domoticz, I have to refresh the screen (by pressing F5) before I will see the actual values (sometimes multiple times).
Did someone noticed the same?

I'm not sure if it is caused by the new template (version 1.2) or the removal of the cache functionality in the latest beta.

Please allow me to suggest a few other changes.

1.
I also made the item outline a circle...
I prefer the circle over the rectangular shape, but that is personal
It starts to look a lot like HASS this way...
We should not copy a HASS functionality, but it is not bad if we take an idea and improve it.

So, why not take the suggestion of @DiaDomo an add a "watermeter" to this dashboard.
I.m.h.o. it is not that complicated, as the functionality is the same as the that of the "gasmeter".

Also the EV car can be added, as suggested by someone else.
The charging of a Battery is exactly the same as charging the EV The difference is probably that the car will not discharge (to your Home)

The only thing is that we have to rearrange the picture a little bit.

Someone :) suggested even to add it to Domoticz by default
Looking great!! Maybe something to add by default (or as example)
Move it from the "Custom" tab to the "Dashboard" tab is in my opinion a good place.

Regards, Good job
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 »

FireWizard wrote: Saturday 01 June 2024 17:06 I tested your latest version of the Energy Dashboard.

Unfortunately I'm not able to test a Battery, as I do not own it.
So I inserted -1 for idBattSetpoint and idBattSoc.

In this case the custom page displays a default value of 80%. Is that as intended?
@FireWizard
Have a look at this at this topic https://www.domoticz.com/forum/viewtopi ... al+battery about a Virtual Solar Battery
Greetings McMelloW
Locked

Who is online

Users browsing this forum: No registered users and 1 guest