Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I want to do something with ioT and connected my air compressor to some sensors. Now I want to monitor the time the compressor is on (and off) and if there is any change over time. I have data like:
time compressor airpressure
26-09-2020 12:00 True 6.0
26-09-2020 12:02 6.7
26-09-2020 12:05 7.2
26-09-2020 12:06 7.8
26-09-2020 12:08 False 8.0
26-09-2020 12:10 6.5
26-09-2020 12:13 True 6.1
and so on..
Any hints how I can determine the time between a True and False statement ?
Regards,
PBRM
Try something like this.
Load time, compressor, airpressure, if(compressor='True', time, peek('time')) as TmpStartTim,
If(compressor ='True', 0, time-peek('TmpStartTime' )) as Duration
From DataSource ;
Drop field TmpStartTime;
Try something like this.
Load time, compressor, airpressure, if(compressor='True', time, peek('time')) as TmpStartTim,
If(compressor ='True', 0, time-peek('TmpStartTime' )) as Duration
From DataSource ;
Drop field TmpStartTime;
Hi Vegar, thanks for the tip!. The script with the temporary field 'TmpStartTime' and 'time-peek(..' did the job. Thanks!