1

I am using influx 1.8 to monitor my photovoltaik. I want to get much more informations out of the gathered data: everything is there, it must "only" be selected ;)

I have a measurement "battery" with a field "soc". soc is a value that can in theora run from 0 to 100, in reality it runs from ~15 to 100. 100 is the time of the day the battery is fully loaded - more solar energy cannot be saved. I want to get this time of a day in one single data query but at this moment I am stuck. I can get ALL times where soc is 100, bunt not the first one... Is it possible to modify the query to only deliver the first match of each day (e.g. yesterday)?

select Kapazitaet from Batterie where Kapazitaet = 100 and time > now() - 1d

At the moment I get hundreds of lines which all show 100 - because battery was full at ~ 12:00 and sun shined up to 18:00...

DF8OE
  • 33

1 Answers1

1
select Kapazitaet from Batterie where Kapazitaet = 100 and time > now() - 1d
ORDER BY time LIMIT 1;
stoney
  • 1,055