Correct.
Multiple sources in one graph
Moderators: leecollings, htilburgs, robgeerts
- clinkadink
- Posts: 417
- Joined: Tuesday 31 December 2019 1:15
- Target OS: Linux
- Domoticz version: 2020.2
- Location: Swindon, UK
- Contact:
Re: Multiple sources in one graph
"UI is the saddle, the stirrups, & the reins. UX is the feeling you get being able to ride the horse."
- EdwinK
- Posts: 1820
- Joined: Sunday 22 January 2017 21:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Rhoon
- Contact:
Re: Multiple sources in one graph
Going to read up on that then
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
- clinkadink
- Posts: 417
- Joined: Tuesday 31 December 2019 1:15
- Target OS: Linux
- Domoticz version: 2020.2
- Location: Swindon, UK
- Contact:
Re: Multiple sources in one graph
You just have to change this ...
Code: Select all
blocks[grafiek_gas]
Code: Select all
blocks["your_graph_name"]
Code: Select all
columns[1]['blocks'] = [ "your_graph_name" ]
"UI is the saddle, the stirrups, & the reins. UX is the feeling you get being able to ride the horse."
- Sjonnie2017
- Posts: 364
- Joined: Wednesday 02 August 2017 19:43
- Target OS: Linux
- Domoticz version: Latest ß
- Location: The Netherlands
- Contact:
Re: Multiple sources in one graph
I am sorry that my somewhat strange way of defining blocks causes you problems.
Maybe this will help:
At the start of the config.js I define all my blocks. So for the "grafiek_gas" I have:
Not sure if this will help but worth a try 
Greetz,
Sjonnie
Maybe this will help:
At the start of the config.js I define all my blocks. So for the "grafiek_gas" I have:
Code: Select all
var grafiek_gas = 'graph_200';

Greetz,
Sjonnie
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
SolarEdge SE4000H (with active modbus_tcp)
YouLess Energy meter
Shelly 2.5 in roller shutter mode
-
- Posts: 17
- Joined: Monday 25 April 2016 10:27
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Multiple sources in one graph
Something I noted when experimenting with multiple sources in one graph: They tend to be very slow in loading on Android.
On MacOS and iOS there is hardly any speed loss, but on Android devices (phone and tablet) they can take up to thirty seconds to load (independent of the browser choice). While loading, the interface is completely frozen. Even the clock doesn't run.
Does anyone has any clue as to what could be the issue here?
On MacOS and iOS there is hardly any speed loss, but on Android devices (phone and tablet) they can take up to thirty seconds to load (independent of the browser choice). While loading, the interface is completely frozen. Even the clock doesn't run.
Does anyone has any clue as to what could be the issue here?
-
- Posts: 118
- Joined: Saturday 21 December 2019 8:36
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Multiple sources in one graph
Is it possible to chose with a parameter if the sum or average calculation will be used for the GroupBy function? I think that there are lots of custom sensors where the sum of all values should be calculated instead of the average value.clinkadink wrote: ↑Sunday 23 February 2020 20:42 The GroupBy function will either:
- The “sum” of all values together for that group
It identifies what type of sensor it is to apply to appropriate calculation.
- Provide the “average” of all values for that group
- Counter, Rain – uses the “Add’ calculation
- Temperature, Custom Sensor and Percentage – uses the “Average” calculation
In my case I wanted to use groupBy to summarize the values per day and month for my smart meter (gas and electricity), but it seems that the average values are presented. In first instance I didn't understood why the total amounts were not in the graph, but your post explains the reason.
-
- Posts: 118
- Joined: Saturday 21 December 2019 8:36
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Multiple sources in one graph
I have created a graph to display the energy costs (Euro) which are calculated by a dzvents script and stored in a set of custom sensors.

There are some strange things in the graph which I do not understand:
1. In the day graph no data is presented at all
2.The sum values that are displayed on top of the graph are all '0.00 Euro'
3. The month and year graphs display the correct values, but (I believe this happened after the update to v3.4.8-beta) the values in the popo-up are rounded to whole numbers. The graph itself displays the correct values.
Code: Select all
blocks['graph_energiekosten'] = { devices: [164, 165, 166, 167, 168], title: 'Energiekosten', graph: ['line','line','bar','bar', 'line'], datasetColors:['red','yellow','#FF8A33','#FFBD33','green'], legend: true, custom : {
"Dag": {range: 'day', data: { Gebruik: 'd.v_max_168', Netto: 'd.v_max_166', Stroom: 'd.v_max_164', Gas: 'd.v_max_165', Solar: '-d.v_max_167' } },
"Maand": {range: 'month', data: { Gebruik: 'd.v_max_168', Netto: 'd.v_max_166', Stroom: 'd.v_max_164', Gas: 'd.v_max_165', Solar: '-d.v_max_167' } },
"Jaar": {range: 'year', data: { Gebruik: 'd.v_max_168', Netto: 'd.v_max_166', Stroom: 'd.v_max_164', Gas: 'd.v_max_165', Solar: '-d.v_max_167' } } } }

There are some strange things in the graph which I do not understand:
1. In the day graph no data is presented at all
2.The sum values that are displayed on top of the graph are all '0.00 Euro'
3. The month and year graphs display the correct values, but (I believe this happened after the update to v3.4.8-beta) the values in the popo-up are rounded to whole numbers. The graph itself displays the correct values.
-
- Posts: 2287
- Joined: Monday 29 August 2016 22:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Multiple sources in one graph
Since beta 3.4.7 you can use the block parameter 'aggregate' for this, which can have value 'sum' or 'avg'.JanvdW wrote:Is it possible to chose with a parameter if the sum or average calculation will be used for the GroupBy function? I think that there are lots of custom sensors where the sum of all values should be calculated instead of the average value.clinkadink wrote: ↑Sunday 23 February 2020 20:42 The GroupBy function will either:
- The “sum” of all values together for that group
It identifies what type of sensor it is to apply to appropriate calculation.
- Provide the “average” of all values for that group
- Counter, Rain – uses the “Add’ calculation
- Temperature, Custom Sensor and Percentage – uses the “Average” calculation
In my case I wanted to use groupBy to summarize the values per day and month for my smart meter (gas and electricity), but it seems that the average values are presented. In first instance I didn't understood why the total amounts were not in the graph, but your post explains the reason.
Sent from my SM-A320FL using Tapatalk
-
- Posts: 118
- Joined: Saturday 21 December 2019 8:36
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Multiple sources in one graph
I had missed this info; exactly what I was looking for. Thanks!Lokonli wrote: ↑Thursday 21 May 2020 22:53Since beta 3.4.7 you can use the block parameter 'aggregate' for this, which can have value 'sum' or 'avg'.JanvdW wrote:Is it possible to chose with a parameter if the sum or average calculation will be used for the GroupBy function? I think that there are lots of custom sensors where the sum of all values should be calculated instead of the average value.clinkadink wrote: ↑Sunday 23 February 2020 20:42 The GroupBy function will either:
- The “sum” of all values together for that group
It identifies what type of sensor it is to apply to appropriate calculation.
- Provide the “average” of all values for that group
- Counter, Rain – uses the “Add’ calculation
- Temperature, Custom Sensor and Percentage – uses the “Average” calculation
In my case I wanted to use groupBy to summarize the values per day and month for my smart meter (gas and electricity), but it seems that the average values are presented. In first instance I didn't understood why the total amounts were not in the graph, but your post explains the reason.
Sent from my SM-A320FL using Tapatalk
-
- Posts: 2287
- Joined: Monday 29 August 2016 22:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Multiple sources in one graph
Graphs with range day probably dont have a max value, only the actual measurements. If you add debug:true to the graph block definition you get a debug button via which you can check the data.JanvdW wrote:I have created a graph to display the energy costs (Euro) which are calculated by a dzvents script and stored in a set of custom sensors.Code: Select all
blocks['graph_energiekosten'] = { devices: [164, 165, 166, 167, 168], title: 'Energiekosten', graph: ['line','line','bar','bar', 'line'], datasetColors:['red','yellow','#FF8A33','#FFBD33','green'], legend: true, custom : { "Dag": {range: 'day', data: { Gebruik: 'd.v_max_168', Netto: 'd.v_max_166', Stroom: 'd.v_max_164', Gas: 'd.v_max_165', Solar: '-d.v_max_167' } }, "Maand": {range: 'month', data: { Gebruik: 'd.v_max_168', Netto: 'd.v_max_166', Stroom: 'd.v_max_164', Gas: 'd.v_max_165', Solar: '-d.v_max_167' } }, "Jaar": {range: 'year', data: { Gebruik: 'd.v_max_168', Netto: 'd.v_max_166', Stroom: 'd.v_max_164', Gas: 'd.v_max_165', Solar: '-d.v_max_167' } } } }
There are some strange things in the graph which I do not understand:
1. In the day graph no data is presented at all
2.The sum values that are displayed on top of the graph are all '0.00 Euro'
3. The month and year graphs display the correct values, but (I believe this happened after the update to v3.4.8-beta) the values in the popo-up are rounded to whole numbers. The graph itself displays the correct values.
Ill check the decimals.
Sent from my SM-A320FL using Tapatalk
-
- Posts: 2287
- Joined: Monday 29 August 2016 22:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Multiple sources in one graph
Probably you have to add the block parameter 'decimals'
Sent from my SM-A320FL using Tapatalk
Sent from my SM-A320FL using Tapatalk
-
- Posts: 118
- Joined: Saturday 21 December 2019 8:36
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Multiple sources in one graph
Fixed the issue with the values at the top of the graph with
But decimals are still gone.
One additional question: the default graph is the first one (in my case it's 'Dag'). When I want to start with the month graph I have to change the button order in month, day, year. Which works, but is somewhat illogical. Can I define the default graph without changing the button order?
Code: Select all
format: false
One additional question: the default graph is the first one (in my case it's 'Dag'). When I want to start with the month graph I have to change the button order in month, day, year. Which works, but is somewhat illogical. Can I define the default graph without changing the button order?
-
- Posts: 2287
- Joined: Monday 29 August 2016 22:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Multiple sources in one graph
In the latest beta I've created a little fix. You should be able to set the number of decimals via the 'decimals' block parameter.JanvdW wrote: ↑Friday 22 May 2020 0:37 Fixed the issue with the values at the top of the graph withBut decimals are still gone.Code: Select all
format: false
One additional question: the default graph is the first one (in my case it's 'Dag'). When I want to start with the month graph I have to change the button order in month, day, year. Which works, but is somewhat illogical. Can I define the default graph without changing the button order?
See:
https://dashticz.readthedocs.io/en/beta ... st-changes
You can change the default graph by setting the 'range' parameter, which can be 'last', 'day' or 'month', or one of the custom graph names you have defined.
-
- Posts: 118
- Joined: Saturday 21 December 2019 8:36
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Multiple sources in one graph
Thanks for the update: that fixes the decimal issue!
I don't understand how I can change the default graph with the range parameter, without changing the button order. I have now the following code:
What do I need to change to make the month graph the default one?
I don't understand how I can change the default graph with the range parameter, without changing the button order. I have now the following code:
Code: Select all
blocks['graph_energiekosten'] = { devices: [168, 166, 164, 165, 167], title: 'Energiekosten', graph: ['line','line','bar','bar', 'line'], datasetColors:['red','yellow','#FF8A33','#FFBD33','green'], format: false, legend: true, custom : {
"Dag": {range: 'day', debug: true, data: { Gebruik: 'd.v_168', Netto: 'd.v_166', Stroom: 'd.v_164', Gas: 'd.v_165', Solar: '-d.v_167' } },
"Maand": {range: 'month', data: { Gebruik: 'd.v_max_168', Netto: 'd.v_max_166', Stroom: 'd.v_max_164', Gas: 'd.v_max_165', Solar: '-d.v_max_167' } },
"Jaar": {range: 'year', groupBy: 'week', aggregate: 'sum', data: { Gebruik: 'd.v_max_168', Netto: 'd.v_max_166', Stroom: 'd.v_max_164', Gas: 'd.v_max_165', Solar: '-d.v_max_167' } } } }
-
- Posts: 2287
- Joined: Monday 29 August 2016 22:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Multiple sources in one graph
By adding range:'Maand' to the block definition, like this:
Code: Select all
blocks['totenergy3'] = {
range:'Maand',
devices: [168, 166, 164, 165, 167],
title: 'Energiekosten',
graph: ['line', 'line', 'bar', 'bar', 'line'],
datasetColors: ['red', 'yellow', '#FF8A33', '#FFBD33', 'green'],
format: false,
legend: true,
custom: {
Dag: {
range: 'day',
debug: true,
data: {
Gebruik: 'd.v_168',
Netto: 'd.v_166',
Stroom: 'd.v_164',
Gas: 'd.v_165',
Solar: '-d.v_167',
},
},
Maand: {
range: 'month',
data: {
Gebruik: 'd.v_max_168',
Netto: 'd.v_max_166',
Stroom: 'd.v_max_164',
Gas: 'd.v_max_165',
Solar: '-d.v_max_167',
},
},
Jaar: {
range: 'year',
groupBy: 'week',
aggregate: 'sum',
data: {
Gebruik: 'd.v_max_168',
Netto: 'd.v_max_166',
Stroom: 'd.v_max_164',
Gas: 'd.v_max_165',
Solar: '-d.v_max_167',
},
},
},
};
-
- Posts: 118
- Joined: Saturday 21 December 2019 8:36
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Multiple sources in one graph
Super; this works; thanks!
-
- Posts: 118
- Joined: Saturday 21 December 2019 8:36
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Multiple sources in one graph
I noticed that there's a difference between the numbers in the graph and the numbers at the top as visualized in the graph below. I don't know why this happens. It seems that the numbers in the graph are lacking behind


-
- Posts: 2287
- Joined: Monday 29 August 2016 22:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Multiple sources in one graph
Domoticz sends/stores the graph data with some delay, normally every 5 minutes. Dashticz requests the graph data with a certain interval. This will give some additional delay.
The numbers in the top are the actual data, which are updated almost instantaneous.
-
- Posts: 118
- Joined: Saturday 21 December 2019 8:36
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Multiple sources in one graph
I have some problems with one of my graphs. This graph displays the gas usage (bar) and the outside temperature (line) to see the correlation between gas usage and outside temperature. I work with the latest Domoticz (2020.2 (build 12705)) and Dashticz (3.7.1) versions. This is the block definition in Dashticz:
1. The value for 'd.te_63' is shown till November 29th, but starting from the 30th nothing is shown for temperature. In Domoticz the correct value is still there... So, I am lost.
2. For the day graph the gas value is far to high. When I divide this value by 12, it gives more or less the right value. I don't understand the reason why this happens.
3. For the year value I have used the aggregate parameter, but I can't choose for different operations per dataset. For the short term I have chosen to sum the values (which is right for gas) and divide the temp value by 30. I would like to choose the aggregate parameter per dataset. Is that possible?
Code: Select all
blocks['graph_gas_gebruik'] = { range: 'Maand', devices: [127,63], title: 'Gasgebruik', graph: ['line','bar'], datasetColors: ['yellow','red',], legend: false, beginAtZero: [false, true] ,custom: {
"Dag": { range: 'day', data: { Temperatuur: 'd.te_63', Gas: 'd.v_127/12' } },
"Maand": { range: 'month', data: { Temperatuur: 'd.te_63', Gas: 'd.v_127', } },
"Jaar": { range: 'year', groupBy: 'month', aggregate: 'sum', data: { Temperatuur: 'd.te_63/30', Gas: 'd.v_127' } } } }
2. For the day graph the gas value is far to high. When I divide this value by 12, it gives more or less the right value. I don't understand the reason why this happens.
3. For the year value I have used the aggregate parameter, but I can't choose for different operations per dataset. For the short term I have chosen to sum the values (which is right for gas) and divide the temp value by 30. I would like to choose the aggregate parameter per dataset. Is that possible?
-
- Posts: 2287
- Joined: Monday 29 August 2016 22:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Multiple sources in one graph
1)
Is that the case for all three graph types? (dag, maand, jaar)
2) That is indeed a bug.
Should be fixed in latest beta. Could you check?
It relates how data is requested from Domoticz for usage devices which are updated with a low frequency (like gas).
Other device types may be impacted as well (water usage?)
3)
I'll add an option to set aggregation per dataset.
Is that the case for all three graph types? (dag, maand, jaar)
2) That is indeed a bug.
Should be fixed in latest beta. Could you check?
It relates how data is requested from Domoticz for usage devices which are updated with a low frequency (like gas).
Other device types may be impacted as well (water usage?)
3)
I'll add an option to set aggregation per dataset.
Who is online
Users browsing this forum: No registered users and 1 guest