Hello all,
I am trying to make a graph with my yearly gas usage, measured with a P1 device.
The last snag is that I want to subtract the c value of last year.
I checked and I can subtract a constant value from the graph.
data: {
G: 'd.c_3-11140.85',
}
The value is available. It is in the title even: 11.140.85
But how can I access this in the graph definition?
The value is stored in the counter field of the device. Is it possible to use that in the calculation?
Kind regards,
Bert
Offset in Graph with counter data
Moderators: leecollings, htilburgs, robgeerts
-
- Posts: 56
- Joined: Wednesday 06 December 2017 16:42
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
-
- Posts: 56
- Joined: Wednesday 06 December 2017 16:42
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Offset in Graph with counter data
Hello all,
Sorry for bumping this question.
But it is the last remaining item on my list that I haven't been able to fix or circumvent in Dashticz.
Is there a way to get a counter or sensor value as a variable into the graph to subtract from the data?
I can do:
But I need the offset values to come from a variable.
Sorry for bumping this question.

But it is the last remaining item on my list that I haven't been able to fix or circumvent in Dashticz.
Is there a way to get a counter or sensor value as a variable into the graph to subtract from the data?
I can do:
Code: Select all
"last year": {
range: 'year',
filter: '12 months',
data: {
G: 'd.c_3-11152.95',
E: 'd.c1_1-d.c3_1+d.c2_1-d.c4_1+301.98',
L: 'd.c1_1-d.c3_1-1867.56',
H: 'd.c2_1-d.c4_1+2183.53',
},
ylabels: ['m³ or kWh'],
}
-
- Posts: 56
- Joined: Wednesday 06 December 2017 16:42
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Offset in Graph with counter data
Hello all,
I assume based on the lack of replies till now, that there is currently no way to create the behavior I am looking for.
I opened a new issue for this in github.
https://github.com/Dashticz/dashticz/issues/1003
Maybe someone can find (or can point me) at a way to include this. it would make the graphs way more flexible.
Regards,
Bert
I assume based on the lack of replies till now, that there is currently no way to create the behavior I am looking for.
I opened a new issue for this in github.
https://github.com/Dashticz/dashticz/issues/1003
Maybe someone can find (or can point me) at a way to include this. it would make the graphs way more flexible.
Regards,
Bert
-
- Posts: 2290
- Joined: Monday 29 August 2016 22:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Offset in Graph with counter data
ok, some undocumented feature...
You can access the Domoticz variable values with:
where 123 is the Domoticz variable ID that you want to use.
You can use this in your custom graph data as follows:
Enjoy 
You can access the Domoticz variable values with:
Code: Select all
Domoticz.getAllDevices()["v123"].Value
You can use this in your custom graph data as follows:
Code: Select all
E: 'd.c1_1-d.c3_1+d.c2_1-d.c4_1+Domoticz.getAllDevices()["v123"].Value',

-
- Posts: 56
- Joined: Wednesday 06 December 2017 16:42
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Offset in Graph with counter data
Hi Lokonli
Wow! I love undocumented features!! Thank you very much for your pointer. This was exactly what I was looking for.
With this tip, I was able to finish the graphs I was working on!
I can now plot my daily usage and the cumulative usage over 1 year.
In domoticz I created a dZvents script to collect last years usage in a couple of user variables. (One for low/night tariff and one for high/day tariff)
With your tip I subtract those values from the counter data of my p1 meter to get to the yearly view.
Shouldn't this be added to the documentation? Or is there a reason to leave this undocumented?
Bert
Wow! I love undocumented features!! Thank you very much for your pointer. This was exactly what I was looking for.
With this tip, I was able to finish the graphs I was working on!
I can now plot my daily usage and the cumulative usage over 1 year.
In domoticz I created a dZvents script to collect last years usage in a couple of user variables. (One for low/night tariff and one for high/day tariff)
With your tip I subtract those values from the counter data of my p1 meter to get to the yearly view.
Shouldn't this be added to the documentation? Or is there a reason to leave this undocumented?
Bert
Who is online
Users browsing this forum: No registered users and 1 guest