Duration of value ; a database query question

Pop your questions regarding Home automation software here.....

Duration of value ; a database query question

Postby Jeffrey » Fri Oct 18, 2019 12:37 pm

I have a question about getting the duration of a value, which I can’t wrap my head around. It’s probably a simple thing for seasoned query guru’s, but please spare me ; I’m just leaning to use it all.

Ik have a table as attached in the picture.
This table records values whenever the state changes of a sensor (“Vrij” means “Free” and “Bezet” means “Occupied”).

What I want to do, is to get the average duration in which the state is “Bezet”. The question is: How does the query looks like to accomplish this?

(btw. I'm using InfluxDB with Grafana for visualization)
table-values.png (57.8 KiB) Viewed 5348 times
Posts: 136
Joined: June 2009
Location: Netherlands

Return to Questions & Discussions Forum

Who is online

Users browsing this forum: No registered users and 1 guest