p1 usage and delivery stacked Topic is solved

Dashticz, alternative dashboard based on HTML, CSS, jQuery

Moderators: leecollings, htilburgs, robgeerts

Post Reply
pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

p1 usage and delivery stacked

Post by pvklink »

I have made a dial for my new P1 and new solars which shows delivery and usage:
this dial works wonderful!

blocks['p1_electra'] = {
idx: 3079,
type: 'dial',
width: 4,
title: 'Electra gebruik',
subtype: 'usage', // to show actual power instead of daily energy counter
inverted: true, // Value is positive if energy leaving the house is higher than energy consumption
isSetpoint: false, // waare instellen via de needle
isNeedle: true, // needle follows main value
showring: true,
showunit: true,
shownumbers: true,
showvalue: true, // show mainvalue
values: [
{idx: 3089, label: 'Gebruik', unit: 'Watt'}, // of Data0 unit kwh Watt
{idx: 3090, label: 'Levering', unit: 'Watt'}, // of Data0 unit kwh Watt
],
color: 'white',
flash: false,
last_update: true,
decimals: 0,
animation: false,
fixed: false, // removes needle and data
hide_data: true,
min: -5000,
max: 5000,
}

Now i want to make a graph with stacked colums, per live data, hour, day, month,year
one part of the colums must be the delivery the other usage both stacked.
I tried myself and had about 10 variants that dont work..
Here my last trial... but this graph (my last) is way to complex

blocks['p1'] = {
title: 'My Power',
devices: [3079],
stacked: true,
tooltiptotal: true,
graph: ['bar','bar'],
custom : {
"last day": {
range: 'day',
groupBy: 'hour',
aggregate: 'sum',
data: {
usage: 'd.v_3079+d.v2_3079',
generation: '-d.r1_3079-d.r2_3079'
}
},
"last 2 weeks": {
range: 'month',
groupBy: 'day',
aggregate: 'sum',
data: {
usage: 'd.v_3079+d.v2_3079',
generation: '-d.r1_3079-d.r2_3079'
}
},
"last 6 months": {
range: 'year',
groupBy: 'month',
aggregate: 'sum',
data: {
usage: 'd.v_3079+d.v2_3079',
generation: '-d.r1_3079-d.r2_3079'
}
}
},
legend: true,
datasetColors:['red','green']
}
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

Re: p1 usage and delivery stacked

Post by pvklink »

Little bit further,...
Only data part is not ok...
When the graph is started , it showing live usage, thats ok!
But when i click 'live' , this should be the same as when the graph is initial starting up (the part that was ok) , but it is not..

Code: Select all

blocks['p1'] =	{
    		title: 'My Power',
    //graphTypes: ['v'],
		devices: [3079],
		stacked: true,
		tooltiptotal: true,
		graph: ['bar','bar'],
		legend: true,
		datasetColors:['red','teal'],
		custom :	{
				"live":	{
						data:	{
							usage: 'd.v_3079',
							generation: '-d.r1_3079'
							}
        					},
				"per dag":	{
						range: 'week',
						filter: '7 days',
						data:	{
							usage: 'd.v_3079+d.v2_3079',
							generation: '-d.r1_3079-d.r2_3079'
							}
        					},
				"per maand": 	{
						range: 'month',
						filter: '4 weeks',
						data:	{
							usage: 'd.v_3079+d.v2_3079',
							generation: '-d.r1_3079-d.r2_3079'
							}
	        				}
        			}
    		},
also the other parts, per day(show 24 hours), per month(show all days ) are not ok yet... but it is a clean domoticz install so perhaps data is missing ?
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

Re: p1 usage and delivery stacked

Post by pvklink »

Think i got it,,,

Cant check it , dont have more data then two days...
But no errors

Code: Select all

blocks['p1'] =	{
    		title: 'My electra verbruik',
    		//graphTypes: ['v'],
		devices: [3079],
		stacked: true,
		tooltiptotal: true,
		graph: ['bar','bar'],
		legend: true,
		datasetColors:['red','green'],
		range:'last',
		custom :	{
				"last":	{
							data:	{
								usage: 'd.v_3079',
								generation: '-d.r1_3079'
								}
		        				},
				"afgelopen 24 uur":	{
							range: 'last',
							groupBy: 'hour',
							filter: '24 hours',
							data:	{
								usage: 'd.v_3079',
								generation: '-d.r1_3079'
								}
		        				},
				"per dag":		{
							range: 'month',
							groupBy: 'week',
							filter: '8 weeks',
							data:	{
								usage: 'd.v_3079+d.v2_3079',
								generation: '-d.r1_3079-d.r2_3079'
								}
        						},
				"per week":		{
							range: 'month',
							groupBy: 'day',
							filter: '14 days',
							data:	{
								usage: 'd.v_3079+d.v2_3079',
								generation: '-d.r1_3079-d.r2_3079'
								}
        						},
				"per maand": 		{
							range: 'year',
							groupBy: 'month',
							filter: '12 months',
							data:	{
								usage: 'd.v_3079+d.v2_3079',
								generation: '-d.r1_3079-d.r2_3079'
								}
	        					},
				"per jaar": 		{
							range: 'year',
							groupBy: 'month',
							filter: '60 month',
							data:	{
								usage: 'd.v_3079+d.v2_3079',
								generation: '-d.r1_3079-d.r2_3079'
								}
	        					}
        			}
    		},


Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest