Multiple sources in one graph
Moderators: leecollings, htilburgs, robgeerts
- 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
I think I have too much time on my hands today
I have a number of buttons (blocks) beneath my electricity graph. If I press on of the buttons I get another graph than the one I defined in my config.js. Would be nice if they were the same graphs
Greetz,
Sjonnie
I have a number of buttons (blocks) beneath my electricity graph. If I press on of the buttons I get another graph than the one I defined in my config.js. Would be nice if they were the same graphs
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
- 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, understood. Please can you log this as a "Feature Request" with title "Graph - Sort Legend"? Otherwise this may "get lost the post".Sjonnie2017 wrote: ↑Friday 14 February 2020 15:49 The order of the legend is not a big issue. It's a "nice to have". I think focusing on the height issue is indeed more important.
https://www.domoticz.com/forum/viewforum.php?f=78
Ha, no. Like you, I am a Dashticz user, who likes graphsSjonnie2017 wrote: ↑Friday 14 February 2020 15:49 I am not sure if you are now the "lead developer" of the graphs in Dashticz. But if so I would like to propose something for the "roadmap" if I may?
I know what you mean. It sounds like it can be achieved. Please can you log this as a "Feature Request" with title "Graph - Custom Header"?Sjonnie2017 wrote: ↑Friday 14 February 2020 15:49 The graph for Electricity is showing the total usage of the current day in the header where the graph for Gas shows me the total usage of all time in the header. Would be a "nice to have" (also) if this was configurable. See my numerous screenshots for examples
https://www.domoticz.com/forum/viewforum.php?f=78
"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
This is only because in your main graph, you have a block defined with graphTypes limiting the data that is displayed. Popups are dynamically generated, and would not be able to limit the data. I.e. it will show all keys, which obviously changes the appearance, scale, amount of Y axes, of your popup.Sjonnie2017 wrote: ↑Friday 14 February 2020 16:07 I have a number of buttons (blocks) beneath my electricity graph. If I press on of the buttons I get another graph than the one I defined in my config.js. Would be nice if they were the same graphs
"UI is the saddle, the stirrups, & the reins. UX is the feeling you get being able to ride the horse."
- 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
Will add the feature request tomorrow. Thanks for the tip (and your support of course... but that's obvious )
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: 7
- Joined: Monday 10 February 2020 0:57
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Multiple sources in one graph
Hello,
I've just git clone the repo and retested but the maxTicksLimit seems still broken.
Do you wan't a sample of code for testing ?
I've just git clone the repo and retested but the maxTicksLimit seems still broken.
Do you wan't a sample of code for testing ?
- 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
I am using maxTicksLimit now. Also in the example posted with the latest beta (post below). I limit to 20 ticks.
https://www.domoticz.com/forum/viewtopi ... 20#p236733
Please can you share your code.
https://www.domoticz.com/forum/viewtopi ... 20#p236733
Please can you share your code.
"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
Made some progress this evening.
(1) have found the issue with the height parameter. Those who reported it, thank you. There was a significant code change in the last beta, 3.3.4, and consequently, I missed a few bits Users will be able to set the height of their graph manually. Example:
(2) The drawOrderLast, drawOrderDay and drawOrderMonth also stopped working. The same reason as above. Yet these are now also fixed. A few people have queried what these properties do. These properties now do 2 things - for each button, i.e last, day, month (or whatever range you use):
Even though the order of the legend object is Inside then Outside, the legend on the graph would always be added Outside, then Inside. This is because te_6 comes before te_72. But now it adds legend in the same order as specified in your block config.
(4) Minor updates:
Cheers
(1) have found the issue with the height parameter. Those who reported it, thank you. There was a significant code change in the last beta, 3.3.4, and consequently, I missed a few bits Users will be able to set the height of their graph manually. Example:
Code: Select all
height: '300px',
- Changes the order in which the datasets are drawn on to the graph (rendered on the canvas). This is only useful if you use lineFill, to prevent smaller datasets behind larger datasets.
- It changes the order of the Legend for each button (last, day, month)
Code: Select all
legend: {
'te_72': 'Inside',
'te_6': 'Outside'
}
(4) Minor updates:
- Gas devices (SubType = Gas) now display 'current day usage' instead of 'all time usage' in the header of the graph.
- Keys for c1, c2, c3, c4 with SubType = Energy, will display the unit 'kWh'
- Keys for c1, c2, c3, c4 with SubType = Gas, will display the unit 'm3'
- Tooltip graph values have been fixed to 2 decimal places
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
No needSjonnie2017 wrote: ↑Friday 14 February 2020 17:55 Will add the feature request tomorrow. Thanks for the tip (and your support of course... but that's obvious )
"UI is the saddle, the stirrups, & the reins. UX is the feeling you get being able to ride the horse."
- 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
And I thought I had too much time on my hands yesterdayclinkadink wrote: ↑Friday 14 February 2020 23:30No needSjonnie2017 wrote: ↑Friday 14 February 2020 17:55 Will add the feature request tomorrow. Thanks for the tip (and your support of course... but that's obvious )
Do you ever sleep I wonder
Anyway... thank you very much for the updated code. I'll start testing in a moment.
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
- 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
OK, I tested the graphs thoroughly I believe. I haven't changed my code apart for the legend for electricity which now indeed shows "Dag" before "Nacht". To paraphrase Neil Armstrong: A small step for Clinkadink but a huge leap for me
A few things I noticed:
EDIT: On some pictures I indicated the zoom button. I thought I had set the parameter to 0 but I didn't so please ignore these remarks on the pictures. (But it is too time consuming to recreate the pictures )
Dashboard Electricity and Gas (with interval):
I noticed that when I play with the popup graphs for Electricity for a while and then return to the dashboard and click on today or wait for the graph to refresh I get this:
Popup Gas ignoring interval:
Dashboard Gas showing incorrect unit:
Popup Electricity Month on first click (note that I filtered 'eu' in the block definition):
Popup Electricity Month on second click:
Popup Electricity on first click:
Popup Electricity on second click:
Popup Electricity showing wrong legend on first click:
Hope this helps!
Greetz,
Sjonnie
A few things I noticed:
- the multigraphs work like a charm!
- the popup graphs seem to ignore some parameters (like interval) and seem to render differently if I select a period (like today) more than once in the same session/popup. If I close the popup and open it again I get the same behavior. I hope I can clarify with some screenshots.
- the graphs do not always show the right unit of measurement; see pictures
- the popup graphs seem to ignore the graphTypes parameter on some occasions. Can't explain
EDIT: On some pictures I indicated the zoom button. I thought I had set the parameter to 0 but I didn't so please ignore these remarks on the pictures. (But it is too time consuming to recreate the pictures )
Dashboard Electricity and Gas (with interval):
I noticed that when I play with the popup graphs for Electricity for a while and then return to the dashboard and click on today or wait for the graph to refresh I get this:
Popup Gas ignoring interval:
Dashboard Gas showing incorrect unit:
Popup Electricity Month on first click (note that I filtered 'eu' in the block definition):
Popup Electricity Month on second click:
Popup Electricity on first click:
Popup Electricity on second click:
Popup Electricity showing wrong legend on first click:
Hope this helps!
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
- 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 for testing this and the detailed feedbackSjonnie2017 wrote: ↑Saturday 15 February 2020 13:15
- the multigraphs work like a charm!
- the popup graphs seem to ignore some parameters (like interval) and seem to render differently if I select a period (like today) more than once in the same session/popup. If I close the popup and open it again I get the same behavior. I hope I can clarify with some screenshots.
- the graphs do not always show the right unit of measurement; see pictures
- the popup graphs seem to ignore the graphTypes parameter on some occasions. Can't explain
- Glad to hear the multigraphs are working well.
- Popups do not use block config parameters such as interval, because there is no block config for popups. They are dynamically generated.
- I am guessing that your popups are not showing the correct unit of measure consistently, because the device changes the unit factor per range. For example, for electric with the range set to "hours", it looks like the unit of measure is watts. But when you switch to "day" or more, the unit changes to kWh. The code is not currently allowing for this. I will investigate what can be done. What would be helpful is if you can provide me a list of keys, for each range, for each device (electric and gas) including their unit of measure, e.g. W, kWh, m3, etc. As I don't have these devices, so it makes it very challenging for me to test this.
- Same reason as my second point, popups don't know graphTypes - because there is no block config for popups.
"UI is the saddle, the stirrups, & the reins. UX is the feeling you get being able to ride the horse."
- 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
I see a feature request coming up soonclinkadink wrote: ↑Saturday 15 February 2020 13:41 *snip**snip*
- Popups do not use block config parameters such as interval, because there is no block config for popups. They are dynamically generated.
- Same reason as my second point, popups don't know graphTypes - because there is no block config for popups.
By keys you mean c1 is kWh and v_200 is m³? I can provide a complete list of that.clinkadink wrote: ↑Saturday 15 February 2020 13:41
- I am guessing that your popups are not showing the correct unit of measure consistently, because the device changes the unit factor per range. For example, for electric with the range set to "hours", it looks like the unit of measure is watts. But when you switch to "day" or more, the unit changes to kWh. The code is not currently allowing for this. I will investigate what can be done. What would be helpful is if you can provide me a list of keys, for each range, for each device (electric and gas) including their unit of measure, e.g. W, kWh, m3, etc. As I don't have these devices, so it makes it very challenging for me to test this.
Greetz,
Sjonnie
Last edited by Sjonnie2017 on Saturday 15 February 2020 15:28, edited 1 time in total.
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
- 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 please. And don't forget, your keys change when pressing the buttons. The last button returns frequently more keys and sometimes changed key names. That is Domoticz behaviour, not Dashticz. For example, to be 100% sure, I need ...Sjonnie2017 wrote: ↑Saturday 15 February 2020 15:11 By keys you mean c1 is kWh and v_200 is m³? I can provide a complete list of that (it will be an edit to this post).
Last: Electric keys + unit, Gas Keys + unit
Today: Electric keys + unit, Gas Keys + unit
Month: Electric keys + unit, Gas Keys + unit
"UI is the saddle, the stirrups, & the reins. UX is the feeling you get being able to ride the horse."
- 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
OK, I think I have got all the keys and they unit of measure. Since I do not have solar panels or a wind turbine (but that one is coming ) I am not 100% sure about the "r"-keys and "c2" and "c4". But "logic dictates" that they are the same as the "v"-keys and the other "c"-keys.
Electricity
Last hours and today:
Last hours, Today and Last Month:
Greetz,
Sjonnie
Electricity
Last hours and today:
- eu_199 - W
- r1_199 - W
- r2_199 - W
- v_199 - W
- v2_199 - W
- c1_199 - kWh
- c2_199 - kWh
- c3_199 - kWh
- c4_199 - kWh
- r1_199 - kWh
- r2_199 - kWh
- v_199 - kWh
- v2_199 - kWh
Last hours, Today and Last Month:
- v_200 - m³
- c_200 - m³
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
- 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
Check your PM.
"UI is the saddle, the stirrups, & the reins. UX is the feeling you get being able to ride the horse."
- 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
Hi,
Thanks for the PM. I applied your solution as requested. I tested the dashboard graphs for electricity and the popup graphs for electricity. The gas graphs seem to work in both dashboard mode as well as popup mode.
Dashboard: if I click on Last month twice it shows me kWh (eg. 15kWh). If I then select last hours, on first click it shows me kWh (eg. 2000 kWh) and after the second click I get W (eg. 2000 W). Same applies for Today. If I select Last Hours it shows me W as unit of measurement. If I then select Last Month the first time it shows me W (eg. 20 W) and after the second click it shows me kWh (20 kWh). It looks like the unit of measurement is not immediately updated if I switch between different time measurements.
The pictures:
First load:
First click on Last Month:
Second click on Last Month:
First click on Today after Last Month:
Second click on Today after Last Month:
First click on Last Hours after Today (and after Last Month):
Popup: On first load it shows me Today and the unit of measrument is kWh. The Y-axis shows me values in thousands af Watts (eg. 16000 W). If I press Today after load nothing changes. If I press it the second time it changes UoM to W; the values remain the same. If I then press Last Month the UoM is W and the values range from 0 to 700. Press it again and the UoM changes to kWh; the values stay the same. If I subsequently press last hours the UoM stays(?)/is kWh; the values range from 0 to 7000. On second press the UoM changes to W; the values stay the same.
The pictures:
First load:
First click on Last Month after initial load:
Second click on Last Month:
First click on Today after Last Month:
Second click on Today:
First click on Last Hours:
Phew, there you have it
PS. As and added bonus I now have the barometer graph showing true values in the header. First it was 1.02 HPa, now it shows 995.00 HPa (yes it is stormy weather today )
Greetz,
Sjonnie
Thanks for the PM. I applied your solution as requested. I tested the dashboard graphs for electricity and the popup graphs for electricity. The gas graphs seem to work in both dashboard mode as well as popup mode.
Dashboard: if I click on Last month twice it shows me kWh (eg. 15kWh). If I then select last hours, on first click it shows me kWh (eg. 2000 kWh) and after the second click I get W (eg. 2000 W). Same applies for Today. If I select Last Hours it shows me W as unit of measurement. If I then select Last Month the first time it shows me W (eg. 20 W) and after the second click it shows me kWh (20 kWh). It looks like the unit of measurement is not immediately updated if I switch between different time measurements.
The pictures:
First load:
First click on Last Month:
Second click on Last Month:
First click on Today after Last Month:
Second click on Today after Last Month:
First click on Last Hours after Today (and after Last Month):
Popup: On first load it shows me Today and the unit of measrument is kWh. The Y-axis shows me values in thousands af Watts (eg. 16000 W). If I press Today after load nothing changes. If I press it the second time it changes UoM to W; the values remain the same. If I then press Last Month the UoM is W and the values range from 0 to 700. Press it again and the UoM changes to kWh; the values stay the same. If I subsequently press last hours the UoM stays(?)/is kWh; the values range from 0 to 7000. On second press the UoM changes to W; the values stay the same.
The pictures:
First load:
First click on Last Month after initial load:
Second click on Last Month:
First click on Today after Last Month:
Second click on Today:
First click on Last Hours:
Phew, there you have it
PS. As and added bonus I now have the barometer graph showing true values in the header. First it was 1.02 HPa, now it shows 995.00 HPa (yes it is stormy weather today )
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
- 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 Sjonnie, great detail there ... it will help track down the problem. Yes, it looks like its only getting the correct unit after displaying the graph. Which is why the second press is displaying the correct unit. Leave it with me.
"UI is the saddle, the stirrups, & the reins. UX is the feeling you get being able to ride the horse."
- 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
It is nice to be able to assist I have the coding skills of a Kangaroo so if I can contribute by testing I am more than happy to do so.
Greetz,
Sjonnie
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
- 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
There was an update to the latest beta this morning. It included tooltip styling.
Standard:
Tooltip Styling:
By default, this is disabled. To enable it, add this to your graph block config:
It is obviously still a beta, so any feedback is appreciated
Standard:
Tooltip Styling:
By default, this is disabled. To enable it, add this to your graph block config:
Code: Select all
toolTipStyle: true,
"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
I am relying on folks like you to test, so many thanks!Sjonnie2017 wrote: ↑Sunday 16 February 2020 13:58 It is nice to be able to assist I have the coding skills of a Kangaroo so if I can contribute by testing I am more than happy to do so.
"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