Multiple sources in one graph
Moderators: leecollings, htilburgs, robgeerts
-
- Posts: 19
- Joined: Saturday 30 December 2017 20:36
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Multiple sources in one graph
I was using 3.2.1 beta. Just tested 3.3.1 beta and there all works well.
The missing color variables were indeed the issue. Changed this to HTML values and now no error is displayed. However the graphs in the right column are still missing and the multigraph (which is using the same devices) are all missing.
Tested to move the graphs from the right to the middle column, but no luck there.
Tested to use other devices (temperature devices) for the multigraph, no luck here as well.
The missing color variables were indeed the issue. Changed this to HTML values and now no error is displayed. However the graphs in the right column are still missing and the multigraph (which is using the same devices) are all missing.
Tested to move the graphs from the right to the middle column, but no luck there.
Tested to use other devices (temperature devices) for the multigraph, no luck here as well.
-
- Posts: 19
- Joined: Saturday 30 December 2017 20:36
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Multiple sources in one graph
Just noticed that for the three missing graphs, I did not have any blocks declared (so it would render using default settings). I declared a block for one graph and after a refresh, that graph is now displayed.
So it looks like the graph is no longer rendered using default settings in 3.3.1 beta.
So it looks like the graph is no longer rendered using default settings in 3.3.1 beta.
- 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
Thanks @ykuijs. Glad the colors part is solved.
Yes, the graph blocks was my fault. Basically, with my code it meant that all "graph" blocks need to be declared first (which isn't ideal). This has already been fixed this already in the multigraph branch last night. Apologies.
Yes, the graph blocks was my fault. Basically, with my code it meant that all "graph" blocks need to be declared first (which isn't ideal). This has already been fixed this already in the multigraph branch last night. Apologies.
"UI is the saddle, the stirrups, & the reins. UX is the feeling you get being able to ride the horse."
-
- Posts: 19
- Joined: Saturday 30 December 2017 20:36
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Multiple sources in one graph
Yes, that was it. Got the new bits from the multigraph branch, removed the declarations and the graphs display just fine.
This just leaves the multigraph not showing. How can I troubleshoot?
This just leaves the multigraph not showing. How can I troubleshoot?
- 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
Any chance you can post your graph/multigraph blocks and column assignments of your config.js? You can PM me if you prefer. This may help with debugging. Thanks.
"UI is the saddle, the stirrups, & the reins. UX is the feeling you get being able to ride the horse."
Re: Multiple sources in one graph
Thank you!
Just started testng and tried to copy the CPU example.
Problem: dataset 2 = dataset 1 --> 2 lines shown as 1 line

Just started testng and tried to copy the CPU example.
Problem: dataset 2 = dataset 1 --> 2 lines shown as 1 line


Code: Select all
blocks['multigraph_460'] = {
title: 'CPU, Memory & HDD',
//devices: [ 456, 456, 458 ],
devices: [ 460, 456 ],
//datasetColors: [colourRed, colourOrange, colourBlue, colourGreen, colourBlueLight, colourAqua, colourYellow, colourPurple, colourPink],
//datasetColors: ['red', 'yellow', 'blue', 'orange', 'green', 'purple', 'orange', 'lightblue', 'lightred'],
datasetColors: ['red', 'yellow'],
cartesian : 'linear',
graph: 'line',
fill: true,
width: 5,
}
- 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
"fill" was changed to "lineFill". Maybe that's the reason.
The full list of properties are in this post:
https://www.domoticz.com/forum/viewtopi ... 45#p233460
Also, see if there are any errors in the developer console. You can view it by pressing F12 on the keyboard.
The full list of properties are in this post:
https://www.domoticz.com/forum/viewtopi ... 45#p233460
Also, see if there are any errors in the developer console. You can view it by pressing F12 on the keyboard.
"UI is the saddle, the stirrups, & the reins. UX is the feeling you get being able to ride the horse."
Re: Multiple sources in one graph
Got my first multi temp working. Found out that the IDX device numbers have to be in ascending order
OKAY:
NOT OKAY:
NOT OKAY:
OKAY:
Code: Select all
blocks['multigraph_1348'] = {
devices: [ 1348, 1352 ],
}
Code: Select all
blocks['multigraph_1348'] = {
devices: [ 1352, 1348 ],
}
Code: Select all
blocks['multigraph_1352] = {
devices: [ 1352, 1348 ],
}
Re: Multiple sources in one graph
also:
1) gas (P1 smart meter) and temperature does not work, no show, no error under F12
2) problem with dummy inside/outside average temperature sensor on Firefox and Chromium:
logarithmic = ok:

linear = not ok / only 1 sensor visible:

update: on my android tablet both lines are visible on linear, sort of:
oh, and now I also see it om my laptop?! Long uptime / load time apparantly
Update2: No, after switching back and forth from today to last hours the scale is correct
3) in that same graphic with logartithmic scale: in 'laatste uren' en 'vandaag' there are 2 lines. In 'afgelopen maand' there are 6 (?) lines: ta1, te1, tm1, ta2, te2, tm2
1) gas (P1 smart meter) and temperature does not work, no show, no error under F12
2) problem with dummy inside/outside average temperature sensor on Firefox and Chromium:
logarithmic = ok:

linear = not ok / only 1 sensor visible:

update: on my android tablet both lines are visible on linear, sort of:

oh, and now I also see it om my laptop?! Long uptime / load time apparantly
Update2: No, after switching back and forth from today to last hours the scale is correct
3) in that same graphic with logartithmic scale: in 'laatste uren' en 'vandaag' there are 2 lines. In 'afgelopen maand' there are 6 (?) lines: ta1, te1, tm1, ta2, te2, tm2
Last edited by renerene on Wednesday 15 January 2020 23:26, edited 1 time in total.
- 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
@renerene, thanks for letting me know.
1. The P1 has lots of datasets on its own. I don't have one, so I really need some sample output to test. You can access it on your network like this:
Example:
http://127.0.0.1:8080/json.htm?type=gra ... &range=day
2. Not sure why this is happening. Sounds like its device dependant.
3. When you set "month", you also get a minimum, maximum and average for each dataset.
Cheers.
1. The P1 has lots of datasets on its own. I don't have one, so I really need some sample output to test. You can access it on your network like this:
Code: Select all
http://127.0.0.1:8080/json.htm?
type=graph
&sensor={counter|Percentage|temp|rain|fan|wind|uv}
&idx={_ID_}
&method={int}
&range={day|week|month|year}
http://127.0.0.1:8080/json.htm?type=gra ... &range=day
2. Not sure why this is happening. Sounds like its device dependant.
3. When you set "month", you also get a minimum, maximum and average for each dataset.
Cheers.
"UI is the saddle, the stirrups, & the reins. UX is the feeling you get being able to ride the horse."
- 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
Yes, I have fixed this issue this evening ... I think

"UI is the saddle, the stirrups, & the reins. UX is the feeling you get being able to ride the horse."
Re: Multiple sources in one graph
Ok, here is the output of the gas metrclinkadink wrote: ↑Wednesday 15 January 2020 23:19 1. The P1 has lots of datasets on its own. I don't have one, so I really need some sample output to test. You can access it on your network like this
I've noticed that it is a spiky output, just one sum value per hour
http://192.168.0.xxx:8080/json.htm?type ... &range=day
Code: Select all
{
"ValueQuantity" : "",
"ValueUnits" : "",
"result" : [
{
"d" : "2020-01-12 16:55",
"v" : "0.00"
},
{
"d" : "2020-01-12 17:00",
"v" : "0.00"
},
{
"d" : "2020-01-12 17:05",
"v" : "0.26"
},
{
"d" : "2020-01-12 17:10",
"v" : "0.00"
},
{
"d" : "2020-01-12 17:15",
"v" : "0.00"
},
{
"d" : "2020-01-12 17:20",
"v" : "0.00"
},
{
"d" : "2020-01-12 17:25",
"v" : "0.00"
},
{
"d" : "2020-01-12 17:30",
"v" : "0.00"
},
{
"d" : "2020-01-12 17:35",
"v" : "0.00"
},
{
"d" : "2020-01-12 17:40",
"v" : "0.00"
},
{
"d" : "2020-01-12 17:45",
"v" : "0.00"
},
{
"d" : "2020-01-12 17:50",
"v" : "0.00"
},
{
"d" : "2020-01-12 17:55",
"v" : "0.00"
},
{
"d" : "2020-01-12 18:00",
"v" : "0.00"
},
{
"d" : "2020-01-12 18:05",
"v" : "7.03"
},
{
"d" : "2020-01-12 18:10",
"v" : "0.00"
},
{
"d" : "2020-01-12 18:15",
"v" : "0.00"
},
{
"d" : "2020-01-12 18:20",
"v" : "0.00"
},
etc.
{
"d" : "2020-01-16 16:50",
"v" : "0.00"
}
],
"status" : "OK",
"title" : "Graph counter day"
}
Code: Select all
{
"ValueQuantity" : "",
"ValueUnits" : "",
"result" : [
{
"d" : "2020-01-09",
"v" : "7.814"
},
{
"d" : "2020-01-10",
"v" : "9.236"
},
{
"d" : "2020-01-11",
"v" : "11.322"
},
{
"d" : "2020-01-12",
"v" : "10.529"
},
{
"d" : "2020-01-13",
"v" : "8.506"
},
{
"d" : "2020-01-14",
"v" : "9.981"
},
{
"d" : "2020-01-15",
"v" : "8.857"
},
{
"d" : "2020-01-16",
"v" : "4.271"
}
],
"status" : "OK",
"title" : "Graph counter week"
}
See update above in original post: the graph is correct after swtching from day to week, back to day2. Not sure why this is happening. Sounds like its device dependant.
3. it would be great to have a simple on/off switch also in the graph. I've tried it, but it doesn't work. Perfect way to fine tune my heating system and see how the temperature reacts to turning on the heating device.
- 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
1. Thanks but I was after your P1 energy meterrenerene wrote: ↑Thursday 16 January 2020 16:56 Ok, here is the output of the gas metr
http://192.168.0.xxx:8080/json.htm?type ... &range=dayCode: Select all
{ "ValueQuantity" : "", "ValueUnits" : "", "result" : [ { "d" : "2020-01-12 16:55", "v" : "0.00" }, // --- truncated --- // { "d" : "2020-01-16 16:50", "v" : "0.00" } ], "status" : "OK", "title" : "Graph counter day" }

2. I discovered the same issue with just one of my many multigraphs. I updated the code last night (locally), it seems to be working fine now.
3. I don't quite understand what you mean in your third point.
Do you mean you want a button in the graph header to control the device's state? E.g. switch on, switch off? What have you tried that doesn't work? Immediate thoughts are that you would need multiple buttons for multiple devices. Not all devices are switchable, e.g. counters, percentages are not interactive so buttons would be pointless (in this case). Can you explain if this is what you mean?
"UI is the saddle, the stirrups, & the reins. UX is the feeling you get being able to ride the horse."
Re: Multiple sources in one graph
I want the state of simple on/off devices to be seen in the graph. Did a short test yesterdam, i did not work. I guess the graphs only works for domoticz under tab temperature, wheather, utility. I also want them to work for tab 'switches'I don't quite understand what you mean in your third point.
- 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
Yes, pretty much. The current graph/multigraph calls Domoticz using the 'graph' url, e.g.:
Code: Select all
http://127.0.0.1:8080/json.htm?type=graph&sensor=counter&idx=1&method=1&range=day
That's not to say it can't be done. There is a url for binary devices such as switches, lights, motion sensors and contact sensors.
Code: Select all
http://127.0.0.1:8080/json.htm?idx=xxx&type=lightlog

Code: Select all
"result" : [
{
"Data" : "On",
"Date" : "2020-01-16 21:10:11",
"Level" : 255,
"MaxDimLevel" : 100,
"Status" : "On",
"idx" : "1234066"
},
{
"Data" : "Off",
"Date" : "2020-01-16 20:16:25",
"Level" : 0,
"Status" : "Off",
"idx" : "1233986"
},
// ---- truncated --- //
{
"Data" : "On",
"Date" : "2020-01-16 19:55:48",
"Level" : 255,
"Status" : "On",
"idx" : "1233919"
}
]
"UI is the saddle, the stirrups, & the reins. UX is the feeling you get being able to ride the horse."
Re: Multiple sources in one graph
No not boring, but interesting. Don't forget we are nerds 
Thank you for explanation. I will make a shadow dummy switch for the heating device switch, to make it visible in the graph.

Thank you for explanation. I will make a shadow dummy switch for the heating device switch, to make it visible in the graph.
- 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
Just exported a 1 day's worth of data from my contact sensor, which is a binary device (open/closed). I knocked up a graph in Excel just to see how the data looks.

When I tried the same with all data for the last 3 weeks, things get really busy ...

I guess this is the type of detail you are looking for?

When I tried the same with all data for the last 3 weeks, things get really busy ...

I guess this is the type of detail you are looking for?
"UI is the saddle, the stirrups, & the reins. UX is the feeling you get being able to ride the horse."
-
- Posts: 744
- Joined: Saturday 30 May 2015 22:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Contact:
Re: Multiple sources in one graph
Indeed, the multi graphs will save the time to export boiler temperature, room temperature and switch data to Excel for analysis
- 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
Yes, the multigraphs will do this for all "sensor" devices (e.g. counter|Percentage|temp|rain|fan|wind|uv).
The question @renerene is asking, is whether this can be extended to include "binary" devices (e.g. switch, socket, motion sensor, contact sensor, etc.). As these output completely different data, and only measure a binary state; e.g. off/off, open/closed, state.
"UI is the saddle, the stirrups, & the reins. UX is the feeling you get being able to ride the horse."
- 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
The multigraph branch has been updated following all the feedback (thanks!).
https://github.com/Dashticz/dashticz/tree/multigraph
It includes several fixes including ... you now no longer have to sort the device IDs in the block's multigraphs.devices array.
There still seems to be an issue where device won't show as a graph "and" a multigraph. E.g. graph_1 and multigraph_1. I noticed it only matters if its the primary device id, and not any others in the multigraph.devices array.
Example:
This will not work (currently) - as their block ID ends in the same number.
This will work - and displays the same data, just by switching the multigraph's block ID to another device. Its a workaround for now, whilst I fix it.
Obviously, I can only test with my devices. You may get different results. This is very much 'work in progress', so please keep all the feedback coming 
https://github.com/Dashticz/dashticz/tree/multigraph
It includes several fixes including ... you now no longer have to sort the device IDs in the block's multigraphs.devices array.
There still seems to be an issue where device won't show as a graph "and" a multigraph. E.g. graph_1 and multigraph_1. I noticed it only matters if its the primary device id, and not any others in the multigraph.devices array.
Example:
This will not work (currently) - as their block ID ends in the same number.
Code: Select all
blocks['graph_17'] = {
legend: true
}
blocks['multigraph_17'] = {
devices: [ 189, 17, 18 ],
legend: true
}
Code: Select all
blocks['graph_17'] = {
legend: true
}
blocks['multigraph_189'] = {
devices: [ 189, 17, 18 ],
legend: true
}

"UI is the saddle, the stirrups, & the reins. UX is the feeling you get being able to ride the horse."
Who is online
Users browsing this forum: No registered users and 1 guest