rafael_09
(Rafael Domitzk)
August 29, 2022, 11:28am
1
Hey!
i have created a page similart to the demo temp page .
Now if have adapted the configuration to my needs, but the diagram is missing monday stats.
my used persistence service is influxdb2. the data for all mondays exist in the database.
here is my code from the page:
config:
chartType: isoWeek
label: House Usage
period: W
sidebar: true
slots:
grid:
- component: oh-chart-grid
config: {}
legend:
- component: oh-chart-legend
config:
bottom: bottom
orient: horizontal
show: true
series:
- component: oh-aggregate-series
config:
aggregationFunction: diff_first
dimension1: isoWeekday
gridIndex: 0
item: SmartMeter_10180
lineStyle:
opacity: 0.5
type: dotted
markLine:
data:
- type: average
name: Verbrauch Woche zuvor
offsetAmount: 1
offsetUnit: week
service: influxdb
smooth: true
type: bar
xAxisIndex: 0
yAxisIndex: 0
- component: oh-aggregate-series
config:
aggregationFunction: diff_first
areaStyle:
opacity: 0.2
dimension1: isoWeekday
gridIndex: 0
item: SmartMeter_10180
lineStyle:
width: 3
markLine:
data:
- type: average
markPoint:
data:
- name: min
type: min
- name: max
type: max
name: Verbrauch aktuell
service: influxdb
smooth: true
type: bar
xAxisIndex: 0
yAxisIndex: 0
title:
- component: oh-chart-title
config:
show: true
subtext: Sampled every hour
text: Average Usage [Wh]
toolbox:
- component: oh-chart-toolbox
config:
presetFeatures:
- saveAsImage
- restore
- dataView
- dataZoom
- magicType
show: true
tooltip:
- component: oh-chart-tooltip
config:
confine: true
orient: vertical
show: true
xAxis:
- component: oh-category-axis
config:
axisPointer:
handle:
backgroundColor: blue
show: true
label:
backgroundColor: "#2196f3"
show: true
snap: true
categoryType: week
gridIndex: 0
monthFormat: default
weekdayFormat: default
yAxis:
- component: oh-value-axis
config:
gridIndex: 0
STSC
(STSC)
December 29, 2022, 6:43pm
2
Hello. Could you solve this issue?
wars
(Ward)
December 29, 2022, 7:17pm
3
I had the same issue and played with the offset unit. For displaying eg my monthly chart (1 bar for every day), I’ve set the offsetUnit
to hour . For daily charts, I use minute .
rafael_09
(Rafael Domitzk)
December 29, 2022, 10:45pm
4
No I didn’t solve the issue. I tried several configurations without success.
wars
(Ward)
December 30, 2022, 9:42am
5
I can solve it for the actual data, but not for data of the previous week:
changes for actual usage :
offsetAmount: 1
offsetUnit: hour
aggregationFunction: diff_last
Because the offsetAmount
is offcourse already in use for the graph of last week, this can’t be done twice here.
And this is working in the demo graph because they don’t use the aggregation function difference .
There are other topics about this subject, and this is not an OH issue, but a standard behavior.
STSC
(STSC)
December 30, 2022, 9:54am
6
Maybe just a checkbox use last data before time range would solve this issue.
At the moment the only way to resolve this issue is not to use the energy readings with diff_first but calculate consumptions over rules from the energy readings and sum them up in the graphs.
STSC
(STSC)
December 30, 2022, 6:25pm
7
Would it actually help if there would be an additional value at Monday, 00:01am?
STSC
(STSC)
January 3, 2023, 7:31am
8
Hello @crnjan . Could you take a look at this topic? For energy visualisation we really need a proper solution here. Thanks!
opened 08:46PM - 16 Feb 21 UTC
enhancement
main ui
<!--
Please DO NOT ERASE this template, but fill in the details as requested. T… his will ensure your issue is properly filed and will be considered. Otherwise, we may reserve the right to close it without further action.
-->
## The problem
Having a HP that logs usage time - incrementally, number of hours. Used this values to display number of hours HP was producing heat for either DHW or underfloor heating:
```
...
- component: oh-aggregate-series
config:
name: DHW
gridIndex: 0
xAxisIndex: 0
yAxisIndex: 0
type: bar
item: gBasement_BoilerRoom_HP_DHW_InOperation_HP
dimension1: date
aggregationFunction: diff_first
service: influxdb
...
```
result:
<img width="893" alt="Screenshot 2021-02-16 at 21 16 37" src="https://user-images.githubusercontent.com/3818211/108119978-dbd24180-70a0-11eb-9991-2bf5ef3c7e36.png">
All good, just first bar is missing. Looking at the code, this is expected.
<!--
Describe the issue you're having. In most cases it is appreciated to share screenshots or even animated GIFs of your issue.
To make screenshots:
* On Windows: use Win+Shift+S
* On macOS: use Cmd+Shift+4
To make animated GIFs we recommend:
* On Windows: ShareX - https://getsharex.com/
* On macOS: Giphy Capture - https://giphy.com/apps/giphycapture
* On GNU/Linux: Peek - https://github.com/phw/peek
-->
## Your suggestion
We could extend the period and fetch one item "before" first period and use that one for reference to calculate first diff - but might be problematic to define what time interval to use to fetch that item?
I used a bit different approach and introduced a new aggregator `diff` that just takes first and last value from within the group itself.
```
case 'diff':
aggregate = arr[1][arr[1].length - 1] - arr[1][0]
```
result:
<img width="872" alt="Screenshot 2021-02-16 at 21 23 08" src="https://user-images.githubusercontent.com/3818211/108120577-c873a600-70a1-11eb-9799-2543a8d5233a.png">
I look forward to any feedback or comments - and if `diff` aggregator makes sense to others as well, I can prepare a PR ...
crnjan
(Crnjan)
January 5, 2023, 3:33pm
9
splatch
(Łukasz Dywicki)
January 5, 2023, 3:37pm
10
If you use diff_last then you need 2 entries for calculation. Assuming you draw a day chart you need to query wider data range - that day + some time before that day (depending on data density), otherwise your first entry have no reference to calculate diff.
crnjan
(Crnjan)
January 5, 2023, 3:43pm
11
yes, that is now being solved with boundary=true
when requesting datapoints in case of diff_last
, more details should be avail in git issue above …
STSC
(STSC)
January 7, 2023, 4:22pm
12
@crnjan Thank you very much for the fix!
@cweitkamp Can you please check the fix and compare it with your Volkszaehler values.
I will try to check it next week as I do not have enough data yet, as I have set up everything from scratch last week.
cweitkamp
(Christoph Weitkamp)
January 10, 2023, 5:26pm
13
I tested the changes. See my results here .
1 Like