p1 usage and delivery stacked
Posted: Thursday 04 May 2023 22:09
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']
}
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']
}