I’m planning several energy meters where Openhab would regularly acquire the latest energy values in kWh.
Is there any easy way to get some energy charts in days/weeks/months/years calculated from the energy values.
I could sum up some items, but this would be a lot of items and would get quite complex.
As an example there is a very good implementation in Home Assistant where you have on the top daily/monthly/weekly/yearly buttons to select the right chart
In Domoticz there seem to be something similar.
What would be the best way for OH3?
(Stuart Hanlon, UK importer of Velbus hardware)
I think you’ll find that charting is on by default for most items in OH3.
Just hit the analyse button on an appropriate item.
You can save the view and include it in the side bar for quick access.
Just one addition: You might have a situation similar than mine, where your meter sends you total readings, but you might need incremental ones to graph consumptions properly. I know Grafana can do the transformation automatically, but since I wanted to stick to the OH graphing tool, I solved it with this.
Can you please update the link, seems not to work.
I also would like to stick to OH. Doing it incremental is getting quite complex, especially if you want to have the monthly consumption over several years. I think we need to have some buttons like Today, Week, Month, Year and basing on the consumption readings the charts are calculated.
To create this kind of chart, you cannot use pages->create chart. Instead you need to use the built-in analyzer for the item you want to create the chart for: Go to your item‘s page (e.g. on the „Properties“ page or through developer sidebar shift-alt-d, or Settings->Items), then click „Analyze“.
This opens a chart for this item only which you can modify to display the desired data and then save as a new chart page.
To display a monthly aggregate from an increasing counter (water meter or electric energy counter) open the drawer at the bottom of the screen, select tab „coords“ and select buttons „Fixed“ and „Aggregate“.
Change to tab „Series“ and on the right side select „Aggregation->Difference of firsts“.
You can change the appearance further using the other availabe options, but this is all that‘s necessary to show „per (day/month/…) view of a counter value. The save button at the top right creates a new chart page. Yes, it‘s confusing that the „create chart“ page in the settings menu has totally different options, but it‘s great to have all the options available somewhere. If all options were in one place it would probably be even more confusing.
Hope this helps, the screenshot some posts above shows almost everything, except how to get to the screen in the first place
You can still edit the page. Note that clicking an “Analyze” on the item page again will create a new (temporary) chart only! The “save” button will create a new chart page accessible though settings->Pages (where you can attach the chart to your sidebar)
The time interval cannot be changed after creation. However, you can still switch between the “current” interval (e.g. this year) and previous intervals (last year, the year before, …)
I need to correct myself: It certainly IS possible to create this kind of chart from Settings->Pages->Create Chart. Just select “Add Aggregate Series” instead of “Add Time Series” and the chart editor will show the relevant options when editing the series.
But personally I find the method to add the chart via the integrated analyzer to be easier. It is still possible to create a chart there and edit it in the Settings->Pages editor later.
The best way to workaround the missing day, week, month, year button is to use tabbed chart pages. Create a chart for day, week, month, year and put it into a tabbed page.
What I’m actually missing now is the time range “DECADES”. “YEAR” shows the charts for months. Can I define this time range “DECADES” somehow, so that I also see the total consumption of a year. Then I can also compare several years.
Thank you for the instructions how to create the aggregated charts. I created some pages following your instructions - with one exception: for me the values are calculated correctly when using “difference of lasts” instead of “difference of firsts”. I am using a weekly summary.
The issue I have is that the chart never shows values on a Monday. Any thoughts?