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 11:37 am

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 1850 times
Jeffrey
Member
Member
 
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

cron