Diagram from hourly values

There are several bindings that list hourly values (p.ex. temperatures, prices). How can I put these values into one diagram showing the values for a specific period (day, months).

As an example, here the awattar binding:

First off, none of those values will even exist until you link each channel you want to an item.

Then if you want the display to be a graph, you will have to make sure those items values are persisted (they will be by default via rrd4j in OH3 unless you have manually disabled that). And then you can use the chart wizard to build the chart you want to see and save that as a new chart page.

If, instead, you wan to see those values in a table then you will have to create a custom widget, or page with components that display the values you want.

Many thanks. The thing with persisting the data and linking the channels was clear to me.

I tried to work with the chart wizard, but failed. Read the docs, but still could not figure it out.
This is my code, but it shows the value from the item at the time I received the data from the binding (kind of timestamp), but does not “link” it to hour 7-8:00 of the day.

config: {}
    - component: oh-chart-grid
      config: {}
    - component: oh-time-axis
        gridIndex: 0
    - component: oh-value-axis
        gridIndex: 0
    - component: oh-time-series
        name: Today07
        gridIndex: 0
        xAxisIndex: 0
        yAxisIndex: 0
        type: bar
        item: aWATTar_Stundenpreise_Today07_Marketnet

Right, the OH charting only works with historical data. With persistence, OH only knows when it last received the information from the binding. It has no way of knowing that you want that data point to represent a particular arbitrary point in time. This is closer to the table usage that I mentioned, in that you really need to custom build something where you are manually correlating the data with the time point. Such as building a widget where each item state is listed in order with a label that indicates the time window.

If you really want to have this non-historical information in a graph form it will require a good deal of advanced custom work on your part. Off the top of my head I’d say you could:

  1. create that graph in some external service (such as grafana) and import it to OH
  2. lookup more advanced usage of the charts (which use the apache echarts backend) to see how to provide your own data array
  3. fake a chart using widgets with html or svg elements (e.g., a bar chart where the “bars” are just div blocks of dynamic height based on the item state).

Many thanks. That sounds difficult. For Home-Assistant, there is a widget whic is quite nice:

I tought there is something similiar with openhab.

When I say “advanced custom work” that is not the same as “difficult”. It just means you probably have to learn a few things you haven’t worked with yet. All the information you need is here in the forums and help docs (even if it isn’t laid out in the best possible format for this particular question), and of course lots of people willing to chip in here and there to help you along with answers to questions that come up.

Just because there is not one for OH doesn’t mean there can’t be. All it means is that no one has wanted one enough to make it yet. If you’d really like to see something like this, then taking the time to make it would be a great way to get what you want and give back to the community. If you want it premade for you, you could consider putting a bounty up for it.

You may find this new widget addition useful. It’s not a chart but would allow you to easily tabulate your values:

So there is really no chance to link data to specific point in time? So to set the date/time manually, also not in a binding? And there is only historical data possible?
This seems to me a major weekness in OH charting.

Don’t confuse “no built-in way” for “no way”. There are solutions, as laid out above; they just include more manual work and/or some outside software, or some “off-label” use of OH. The fact of the matter is that this appears to not be a particularly common use case, at least among people willing to commit code to the software.

That’s a perfectly legitimate opinion. Just laying that opinion out there, however, isn’t going to change anything. If it means enough to you and you want it fixed, get involved: file a feature request, make a proposal for how such a feature would work, or, best of all submit your own code,

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.