How to track on/off duration?

I would like to achieve kind of same functionality as HA has (no flame pls) which shows timeline of when something has been ON/OFF or whatever state it is etc.
this:
Screenshot_1

So in OH, I guess I need to persist state of the item, but do we have something like timeline module as same as Graphs are? eg. I can probably put persisted ON/OFF to the graph, but it’s not really nice solution.

Has anybody some tips or working solution I can start with?
Would be great. Thanks!

1 Like

Click the magnifying glass on top of the page and enter ‘timeline’.

yes, I did, everything is over 2yrs old, if those are still the only ones, I’ll take that way

From my understanding persistence is the solution to keep the data.

I just translate the On/Off states to 0 & 10 for persisting, then graph the results.

1 Like

I havn´t tried yet, but isn´t it possible to persist on/off ?

Maybe the solution is a combination between standard sitemaps and Grafana with the discrete plugin.

OH tends to be a bit more stable than HA. You can go back five years in some cases and still have valid information in a tutorial. The challenge is figuring out what is still relevant and what isn’t. Usually the best approach is to just try it and see and then ask a question if it doesn’t work.

Depends on the database. You can in InfluxDB but not in RRD4J.

This is probably the best approach. There really isn’t anything built into OH to generate a chart like that.

There might be some custom widgets for HABPanel though which can get you there.

Personally, I use InfluxDB to persist the data and Grafana to chart the values. Here is my temperature chart showing when the house fan is ON (the blue line at the bottom shows when the fan is ON). I definitely had some sort of hick-up last night around 20:15 it appears.

You can do this in Grafana or set up a separate y-axis range for the on/off states if you are charting them with other data like I’m doing above.

am persisting on/off just fine (using influx) basically I was looking for something which will draw timeline as graphs are.
Grafana is good, but not really sure if I want to manage several platforms to make data usable.

probably you’re right, will do

I already use Influxdb and Grafana, but I have never tried a on/off item.

HABPanel has a time-line widget built-in. You can display multiple series in one widget and you can set the colors for the different states.

Here is the official announcement: New standard widget: Timeline

1 Like

yep, discovered that while ago. Since I’m not yet fully like habpanel I wanted something for basicUI.
But time for habpanel is near … :smiley:

thanks anyway!