I have a table in my InfluxDB for a parking sensor which sends a state for occupied (1) and vacant (9). Now I want to create a query which shows me the time period between the status changes so that I can create a report for the time the parkingslot was occupied and free. The data is generated by the parking sensor and inserted via node-red into the influxdb. The data is located in InfluxDB version 1.8.10 on Ubuntu 20.04. The table data has actually the following structure:
name: parkinginfo | time | statusnumbered | | -------- | -------------- | | 1646302488500839186 | 1 | | 1646302488500203666 | 1 | | 1646302488499932866 | 2 | | 1646302488499826263 | 1 |
statusnumbered: 1 = vacant, 2 = occupied
Can someone help me for creating a query for this? Thanks!