Duration of value ; a database query question

Pop your questions regarding Home automation software here.....
Post Reply
Jeffrey
Member
Member
Posts: 136
Joined: Tue Jun 09, 2009 3:34 pm
Location: Netherlands

Duration of value ; a database query question

Post by Jeffrey »

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)
Attachments
table-values.png
table-values.png (57.8 KiB) Viewed 7649 times
Post Reply

Return to “Questions & Discussions Forum”