Multiple sources in one graph

Dashticz, alternative dashboard based on HTML, CSS, jQuery

Moderators: leecollings, htilburgs, robgeerts

Post Reply
User avatar
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

Post by clinkadink »

renerene wrote: Friday 24 January 2020 8:13 Can you explain the data structure of custom?
se is not inthe documentation but I found out it is for 'setpoint'
what are the numbers at the end of d.te1? How do they relate to the 'devices:' declaration?
Custom data structure remains unchanged from the standard graph. More information can be found in the help documentation.
https://dashticz.readthedocs.io/en/beta ... tom-graphs

"se" is the key within the data that is returned from Domoticz for "setpoint". You can view the data being returned from Domoticz via these urls:

Data for a "day":
http://127.0.0.1:8080/json.htm?type=gra ... y&method=1
Data for a "month":
http://127.0.0.1:8080/json.htm?type=gra ... h&method=1

Note: the month data returns more keys than the day, as the month includes min, max and average for each dataset (e.g. temp and setpoint).

You have "d" for date/time (in all devices data), then key value pairs; in this case "se" (setpoint) and the value, then "te" (temp) and the value.

Code: Select all

{
   "result" : [
      {
         "d" : "2020-01-23 10:25",
         "se" : 22.0,
         "te" : 21.5
      },
      {
         "d" : "2020-01-23 10:30",
         "se" : 22.0,
         "te" : 21.5
      },
     // etc ....
}
When comparing the same device types in multigraphs, the data for each device typically has the same keys, e.g. "te", "se", etc.
Graphs and multigraphs are created using JSON data, which does not allow duplicate keys in the same time object. If the multigraph code just added all data from all devices, the resulting data would result in duplicate keys - which is invalid JSON, and therefore, would not work.

For example, this would never work due to duplicate keys "se" and "te":

Code: Select all

      {
         "d" : "2020-01-23 10:25",
         "se" : 22.0, <---- device 1 setpoint
         "te" : 21.5, <---- device 1 temperature
         "se" : 24.0, <---- device 2 setpoint
         "te" : 22.5, <---- device 2 temperature
      },
To get round this, any duplicate key is suffixed by a sequential number ...

Code: Select all

      {
         "d" : "2020-01-23 10:25",
         "se1" : 22.0, <---- device 1 setpoint
         "te1" : 21.5, <---- device 1 temperature
         "se2" : 24.0, <---- device 2 setpoint
         "te2" : 22.5, <---- device 2 temperature
      },
So these number, se1, te1, relates to the first device in your devices array, se2, te2 relates to the second device ... and so on.

Hope that makes sense.
"UI is the saddle, the stirrups, & the reins. UX is the feeling you get being able to ride the horse."
ykuijs
Posts: 19
Joined: Saturday 30 December 2017 20:36
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Multiple sources in one graph

Post by ykuijs »

clinkadink wrote: Wednesday 22 January 2020 9:17
ykuijs wrote: Monday 20 January 2020 23:34 I see something strange with the order
Please try the latest update using the new setting:

Code: Select all

sortDevices: false
Yes, this solves the issue! Great!
User avatar
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

Post by clinkadink »

ykuijs wrote: Friday 24 January 2020 21:24 Yes, this solves the issue! Great!
At last, some good news :lol:
"UI is the saddle, the stirrups, & the reins. UX is the feeling you get being able to ride the horse."
renerene
Posts: 317
Joined: Wednesday 03 August 2016 11:36
Target OS: -
Domoticz version:
Contact:

Re: Multiple sources in one graph

Post by renerene »

Sorry, hate to bring the bad news.

There is definitly something not good. The relation between color, legend, lines and devices is unpredictable.
When pressing the buttons, the lines and legends change; the changes make no sense. Also: after initial loading (refresh browser) and clicking back and forward to the initial view, dashticz shows other lines the second time. Same as in previous post

It takes few seconds before the graph is visible, after refresh. I assume Dashticz is collecting data. Maybe the mixup is because not all data is collected in the given time and therefor sensors are being skipped = different numbering te1, te2,... (Pure guess)

Here is my code. Please note how I want different senors to be visible at different time scales.

Code: Select all

  legend: {
    'bi'	: 'binnen',	  
	  'bu'	: 'buiten',
	  'sp'	: 'setpoint',
     'cv' : 'cv',
     'vl' : 'vloer'
   },
   //spanGaps = true,
   custom : {
    "8 uur binnen": {
            range: 'day',
            filter: '8 hours',
            data: {
                vl: 'd.te1', 
                bi: 'd.te2',
                sp: 'd.te3',
//                bu: 'd.te4',
                cv: 'd.te5'
            }
        },
     "24 uur": {
            range: 'day',
            filter: '24 hours',
            data: {
                vl: 'd.te1', 
                bi: 'd.te2',
                sp: 'd.te3',
//                bu: 'd.te4',
                cv: 'd.te5'
            }
        },
    "maand": {
            range: 'year',
            filter: '1 month',
            data: {
                bi: 'd.te2',
                bu: 'd.te4',
            }
    },
     "jaar": {
            range: 'year',
            filter: '12 months',
            data: {
                bi: 'd.te2',
                bu: 'd.te4',
            }
     }
  }
Lokonli
Posts: 2262
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Multiple sources in one graph

Post by Lokonli »

In case of a multigraph with custom data, then a default scenario is selected, not a custom scenario. So only after clicking on a button the correct graph is shown.

This will be fixed within a few days.
User avatar
Sjonnie2017
Posts: 361
Joined: Wednesday 02 August 2017 19:43
Target OS: Linux
Domoticz version: Latest ß
Location: The Netherlands
Contact:

Re: Multiple sources in one graph

Post by Sjonnie2017 »

Need a little help here :oops:

I am having a hard time to get a multigraph showing up the way I want it. What I would like: one graph showing the temperature, humidity and pressure of my Xiaomi Aqara multisensor. The values show up fine when I use individual graphs for each value but I can't get them combined into one graph.

I have defined one graph (multigraph_145) and try to get it to show up on two screens. The below pictures give you an idea of how they look right now

Image

Image

Image

Image

Image

Note that the graph is sort of showing in column 18 and not showing in column 22 and that the colors of the graphs change per view type :|

Definitions of variables:

Code: Select all

// Temperatuur, Vochtigheid en Luchtdruk (binnen!)
var temp_woonkamer			   = 145;         //ZigBee
var grafiek_temp_woonkamer     = 'graph_145'; //ZigBee
var hum_woonkamer			   = 146;         //ZigBee
var grafiek_hum_woonkamer	   = 'graph_146'; //ZigBee
var druk_woonkamer			   = 147;         //ZigBee
var grafiek_druk_woonkamer     = 'graph_147'; //ZigBee
Definition of multigraph:

Code: Select all

// Multigraphs voor binnensensoren

//blocks['multigraph_145'] = {}
//blocks['multigraph_145']['title'] = 'Woonkamer'
//blocks['multigraph_145']['width'] = 12;
//blocks['multigraph_145']['devices'] = '145, 146, 147'
//blocks['multigraph_145']['datasetColors'] = 'Red', 'Yellow', 'Blue'
//blocks['multigraph_145']['legend'] = {'te': '℃', 'hu': '%', 'baro': 'hPa'}

blocks['multigraph_145'] = {
	title: 'Woonkamer',
    devices: [ 145, 146, 147],
	datasetColors: ['Red', 'Yellow', 'Blue'],
	graph: 'line',
	legend: true,
	legend: {
				'te1': '℃',
				'hu2': '%',
				'ba3': 'hPa'
			}
}
Definition of screens:

Code: Select all

screens[max_resolution_desktop][5] = {}
screens[max_resolution_desktop][5]['background'] = 'img/bg15.jpg';
screens[max_resolution_desktop][5]['columns'] = [18,19,20,21]

screens[max_resolution_desktop][6] = {}
screens[max_resolution_desktop][6]['background'] = 'img/bg15.jpg';
screens[max_resolution_desktop][6]['columns'] = [22]
Definitions of columns:

Code: Select all

// Screen 5 voor desktop, screen 7 voor tablet
columns[18] = {}
columns[18]['blocks'] = [temp_woonkamer, grafiek_temp_woonkamer, hum_woonkamer, grafiek_hum_woonkamer, druk_woonkamer, grafiek_druk_woonkamer, 'multigraph_145']
columns[18]['width'] = 3;

// Screen 6 voor desktop
columns[22] = {}
columns[22]['blocks'] = ['multigraph_145']
columns[22]['width'] = 6;
It is probably something simple but I just can't get my head around it :(

Hope you can help!

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
User avatar
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

Post by clinkadink »

Hi Sjonnie,

For my Aeotec Multisensors (temp, humidity, etc.), I don't need to use multigraphs. A standard graph will display multiple data series - if the data is returned from the same device. I.e. I can use 'graph_16' to show a single graph with temp and humidity.

If you want to combine multiple devices data, i.e. 2 devices (or more), then yes, you need to use the multigraph.

So do you have (a) one device with 3 datasets (te, hu, baro) ... or (b) three devices with 3 datasets?

The multigraph code merges each devices data into a single set of data. If there are only certain keys (e.g. hu, ba, te, etc ...) that you want to be included, you need to use the multigraphTypes property. The example below will only bring back te, hu and ba data - ignoring everything else. I am mentioning this in case one of your devices (shown in your config.js) may also provide other keys. It could this that is confusing things.

Code: Select all

multigraphTypes: ['te', 'hu', ba'], 
It is easier to check if you just use "legend = true" for now. And then can you show me what the legend shows in the graph. You will then know what keys to use in order to create a custom legend. As I am not sure if your custom legend is correct.

This is you current custom legend ...

Code: Select all

legend: {
	'te1': '℃',    <---- this will fetch the temp from device 1
	'hu2': '%',     <---- this will fetch the humidity from device 2
	'ba3': 'hPa'   <---- this will fetch the pressure from device 3
}
Is this ^^^^^ what you want to do? This is only adding one different key from 3 separate devices.

If you are trying to add a custom legend for one device, for te, hu and ba ... change the legend to this ...

Code: Select all

legend: {
	'te1': '℃',    
	'hu1': '%',     
	'ba1': 'hPa'  
}
Please try this and post your results.

Code: Select all

blocks['multigraph_145'] = {
	title: 'Woonkamer',
        devices: [ 145, 146, 147],
	datasetColors: ['red', 'yellow', 'blue'],
	graph: 'line',
	legend: true
}
If you see line breaks in your data, you can use spanGaps property to fix it.

Code: Select all

spanGaps: true
There has been quite a bit of feedback provided with this beta with multigraphs. I am very grateful for it ;)
"UI is the saddle, the stirrups, & the reins. UX is the feeling you get being able to ride the horse."
User avatar
Sjonnie2017
Posts: 361
Joined: Wednesday 02 August 2017 19:43
Target OS: Linux
Domoticz version: Latest ß
Location: The Netherlands
Contact:

Re: Multiple sources in one graph

Post by Sjonnie2017 »

Hi,

Tx for your elaborate explanation. I added the code you posted and this is the result:

Image

The sensor is a Xiaomi Aqara multi sensor. It is recognized in Deconz and imported into Domoticz as three separate devices; each with it's own IDX. That's why I would like to use your multigraph.

I will experiment a bit more with the spangaps option to see how that works.

Weirdest thing is that the barometer value is translated into temperature values. Also worth noting is that the legend changes depending on the time slots i choose (last hours, today, last month):

Image

Hope you can make any sense of this :)

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
User avatar
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

Post by clinkadink »

Sjonnie2017 wrote: Monday 03 February 2020 18:49 Weirdest thing is that the barometer value is translated into temperature values. Also worth noting is that the legend changes depending on the time slots i choose (last hours, today, last month)
Thanks for the info about the 3 devices.

So it looks as if device 1 has temp data, device 2 has humidity data, but device 3 has temp and barometric data.

Regarding the barometer unit showing as a temp unit, are you referring to across the top, or on the Y axis? The top bar just shows the value for each device and the adds the unit of the first device (℃). I compare data with the same unit, e.g. inside temp vs outside temp, profit vs cost, etc. But I guess there is a need for your use case. I will have a look and see what can be done.

The legend will often change when changing the range to month (or more). Some devices report additional data when using a large range. For example, in your case with device 1, for day range (first 2 buttons), it will only report "te", the temperature. But when you request a month range, it will return "te", max temperature, "ta", average temperature, and "tm", minimum temperature. Your device 2 does not provide additional data, but your 3rd device does (same as device 1 with barometric pressure). This is standard Domoticz behaviour, not Dashticz or multigraphs. If you don't want this extra data, you can use the multigraphTypes parameter to specify which data to provide, e.g. ['te', 'hu', 'ba'] will remove extra data. More info here: https://www.domoticz.com/forum/viewtopi ... 40#p234146

Another thing to consider with your graph, is the scale. You are comparing temp with pressure. Temp value is around 20 and pressure value is around 1000. This means your temp line will always be flat and at the bottom close to 0 on the Y axis. That is because the default scale is 'linear'. When comparing data with a massive delta, it is often better to use 'logarithmic' scale. I have updated your block to use this below, including adding your custom legend and spanGaps (to solve line breaks where there is NaN data). I have also added extra colors for each item in your legend.

Code: Select all

blocks['multigraph_145'] = {
	title: 'Woonkamer',
        devices: [ 145, 146, 147],
	datasetColors: ['red', 'yellow', 'blue' 'green', 'orange', 'brown', 'pink', 'aqua'],
	spanGaps: true,
	cartesian: 'logarithmic',
	graph: 'line',
	legend: {
          'te1': 'D1 Temp',	  
	  'ta1': 'D1 Temp (avg)',
	  'tm1': 'D1 Temp (min)',
	  'hu2': 'D2 Humidity',
	  'te3': 'D3 Temp',
	  'ta3': 'D3 Temp (avg)',
	  'tm3': 'D3 Temp (min)',
	  'ba3': 'D3 Pressure'
    }
}
Cheers ;)
"UI is the saddle, the stirrups, & the reins. UX is the feeling you get being able to ride the horse."
User avatar
Sjonnie2017
Posts: 361
Joined: Wednesday 02 August 2017 19:43
Target OS: Linux
Domoticz version: Latest ß
Location: The Netherlands
Contact:

Re: Multiple sources in one graph

Post by Sjonnie2017 »

Thanks again! Much appreciated:)

I gave the code a shot but Dashticz became stubborn and refused to load.

Will have a look at it again tomorrow. Gotta run now :mrgreen:

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
User avatar
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

Post by clinkadink »

My fault, I missed a comma between blue and green! :oops:

Code: Select all

blocks['multigraph_145'] = {
	title: 'Woonkamer',
        devices: [ 145, 146, 147],
	datasetColors: ['red', 'yellow', 'blue', 'green', 'orange', 'brown', 'pink', 'aqua'],
	spanGaps: true,
	cartesian: 'logarithmic',
	graph: 'line',
	legend: {
          'te1': 'D1 Temp',	  
	  'ta1': 'D1 Temp (avg)',
	  'tm1': 'D1 Temp (min)',
	  'hu2': 'D2 Humidity',
	  'te3': 'D3 Temp',
	  'ta3': 'D3 Temp (avg)',
	  'tm3': 'D3 Temp (min)',
	  'ba3': 'D3 Pressure'
    }
}
"UI is the saddle, the stirrups, & the reins. UX is the feeling you get being able to ride the horse."
User avatar
Sjonnie2017
Posts: 361
Joined: Wednesday 02 August 2017 19:43
Target OS: Linux
Domoticz version: Latest ß
Location: The Netherlands
Contact:

Re: Multiple sources in one graph

Post by Sjonnie2017 »

Darn! I should have seen that;-) Checked all the ending lines for a comma and that was OK. Will let you know tomorrow.

Greetz,
Sjonnie
Sent from my phone. Apologies for any typo's
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
Sjonnie2017
Posts: 361
Joined: Wednesday 02 August 2017 19:43
Target OS: Linux
Domoticz version: Latest ß
Location: The Netherlands
Contact:

Re: Multiple sources in one graph

Post by Sjonnie2017 »

Well... the comma did it :mrgreen:

Image

Image

I suppressed the temperature readings from the third device by changing the code to this:

Code: Select all

blocks['multigraph_145'] = {
	title: 'Woonkamer',
    devices: [ 145, 146, 147],
	datasetColors: ['red', 'yellow', 'blue', 'green', 'orange', 'brown', 'pink', 'aqua'],
	spanGaps: true,
	cartesian: 'logarithmic',
	exclude: [ 'te3', 'ta3', 'tm3'], 
	graph: 'line',
	legend: {
      'te1': '℃',	  
	  'ta1': '℃(avg)',
	  'tm1': '℃(min)',
	  'hu2': '%',
	  'ba3': 'hPa'
    }
}
Which resulted in this:
Image
Not bad at all :)

Noticed that I can only place the graph on one screen or in one column (I am not sure) and also noticed that loading of Dashticz takes considerably longer. Could the last be caused by the additional coding?

And if I may be so bold as to post a wish: I would really like to have labels for temperature and humidity on the Y-axis. Preferably to scale

If that's beyond the scope of the project, I can always decide to create three separate graphs: one showing the temperature of all the multi-sensors, one for the humidity and one for pressure.

Anyway... really impressed with the new multi-graphs. They are a great addition to Dashticz (at least I think so :mrgreen: )

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
User avatar
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

Post by clinkadink »

Sjonnie2017 wrote: Tuesday 04 February 2020 19:01 Anyway... really impressed with the new multi-graphs. They are a great addition to Dashticz (at least I think so :mrgreen: )
Thanks Sjonnie .. we are making progress ;)

Incidentally, I am actually working on the Y axis bug now. So hopefully, it won't be too long to wait before you can have temp on the left Y axis, and hPa on the right.

Cheers.
"UI is the saddle, the stirrups, & the reins. UX is the feeling you get being able to ride the horse."
User avatar
Sjonnie2017
Posts: 361
Joined: Wednesday 02 August 2017 19:43
Target OS: Linux
Domoticz version: Latest ß
Location: The Netherlands
Contact:

Re: Multiple sources in one graph

Post by Sjonnie2017 »

Hi ,

Thanks. No hurry. I am grateful for the multi-graphs as it is. Will be experimenting with a multi-graph for temp and one for humidity etc. See if that is useful for my use-case scenario :lol:

Greetz,

Sjonnie

[EDIT: Grinding beans as we speak :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
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

Post by clinkadink »

Sjonnie2017 wrote: Tuesday 04 February 2020 19:15 [EDIT: Grinding beans as we speak :mrgreen: ]
I am now :lol:
Cheers Sjonnie!
"UI is the saddle, the stirrups, & the reins. UX is the feeling you get being able to ride the horse."
User avatar
Sjonnie2017
Posts: 361
Joined: Wednesday 02 August 2017 19:43
Target OS: Linux
Domoticz version: Latest ß
Location: The Netherlands
Contact:

Re: Multiple sources in one graph

Post by Sjonnie2017 »

It is starting to look good:

Image

Note that the pressure is somehow divided by 1000 in the header of the graph :roll:

I only need to fiddle a bit with the line colors and then I am good to go (although I still would appreciate the possibility to use multi-graphs per sensor ;) )

[EDIT]: For the temperature graph I need 12 different colors. Could anybody point me to a list of usable color names?

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
User avatar
HansieNL
Posts: 957
Joined: Monday 28 September 2015 15:13
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Multiple sources in one graph

Post by HansieNL »

Blah blah blah
User avatar
Sjonnie2017
Posts: 361
Joined: Wednesday 02 August 2017 19:43
Target OS: Linux
Domoticz version: Latest ß
Location: The Netherlands
Contact:

Re: Multiple sources in one graph

Post by Sjonnie2017 »

Been experimenting with line colors for the various graphs. I reduced the number of graph lines to keep it simple.

I have three multi-graphs: temperature, humidity and pressure (barometer). Each multi-graph showing the input/data from 4 separate devices.

I would like to have the line colors identical regardless of which time period I choose. For instance: the living room temperature should be shown as a red line regardless if I choose "last hours", "last day", or "last month". At this point the colors for "last hours" and "last day" are the same but when I select last month the colors change making it difficult to identify in the blink of the eye what is what.

I have experimented with datasetColors but have not been successful. Tried expanded datasetColors, 4 datasetColors and no setting for datasetColors at all. All without desired result.

Some pictures to show you what I mean:

Image

Image

Image

The code:

Code: Select all

blocks['multigraph_144'] = {
	title: 'Temperatuur Binnen',
    devices: [ 144, 145, 152, 158],
//	datasetColors: ['red', 'yellow', 'blue', 'green', 'orange', 'brown', 'pink', 'aqua'],
//	datasetColors: ['red', 'yellow', 'blue', 'green'],
	spanGaps: true,
//	cartesian: 'logarithmic',
	exclude: [ 'hu', 'ba'], 
	graph: 'line',
	legend: {
      'te1': '℃ K',	  
//	  'ta1': '℃ K(avg)',
//	  'tm1': '℃ K(min)',
      'te2': '℃ W',	  
//	  'ta2': '℃ W(avg)',
//	  'tm2': '℃ W(min)',
	  'te3': '℃ V',	  
//	  'ta3': '℃ V(avg)',
//	  'tm3': '℃ V(min)',	
	  'te4': '℃ S',	  
//	  'ta4': '℃ S(avg)',
//	  'tm4': '℃ S(min)',  
    }
}
Any tips?

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
User avatar
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

Post by clinkadink »

The exclude was replaced with multigraphTypes after the first beta.

Code: Select all

exclude: [ 'hu', 'ba'],

Code: Select all

multigraphTypes: [ 'hu', 'ba'],
You can also try sortDevices, this was added in the last update. The code sorts the devices by default to make sure the X axis (time) caters for all data. As some devices do not report after a certain amount of zero data (e.g. solar). You can try adding ...

Code: Select all

sortDevices: false
The last hours and last day uses the same range, and returns the same data. I.e. range=day. Except last hours then filters this data for a specific time period, e.g. last 6 hours. The last month uses a different range; i.e. range=month. Because of this, the keys in the data (what you see in you legend, are often different than what you see in range=day.

For example, te for day, is actual temperature ... but te for month is maximum temperature. This is Domoticz behaviour, not Dashticz.

From what i can see in your third graph, is that you have more keys being returned in your data, than you have colors in yours datasetColors. This is evident because you have 2 dark grey lines. Basically, Dashticz has no color defined for this key, so adds a dark grey line.

To test, I would ...

1. Add some more colors to the datasetColors
2. Don't limit the data (keys) being returned, i.e. remove exclude/multigraphTypes for now
2. Comment out the custom legend, and just use "legend: true"

This will then show all keys being returned and display them in legend. I reckon these are different to what you currently have in your custom legend.

Cheers.
"UI is the saddle, the stirrups, & the reins. UX is the feeling you get being able to ride the horse."
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest