Hi,
i’m running openhab 2.5 M1 with influxdb persistance on a different server. Storing values work as I can query them via Chronograf or Grafana.
My problem is that I want to use the sumSince function for a switch item and I found out that there seems to be a problem digesting the results of influxdb.
The relevant part of the rule is
var eventCount = SchlafzimmerFensterRechtsStatus.sumSince(now.minusDays(10), "influxdb") logInfo( "Rules", "event count: " + eventCount.toString )
The log output is
2019-06-20 20:04:27.937 [INFO ] [eclipse.smarthome.model.script.Rules] - event count: 0
The query to influxdb is
ts=2019-06-20T18:01:16.741087Z lvl=info msg="Executing query" log_id=0G92UeUW000 service=query query="SELECT value FROM openhab_db.autogen.SchlafzimmerFensterRechtsStatus WHERE time > 1560189676s LIMIT 2147483647"
and the HTTP response is
"okhttp/2.4.0" 6647858e-9385-11e9-9978-0242ac150002 52077
So the query gets sent to influx db the 52k size response is returned to openhab, but openhab still thinks there were 0 events
A slightly modified query to influxdb returning the sum is
SELECT **sum(value)** FROM openhab_db.autogen.SchlafzimmerFensterRechtsStatus WHERE time > 1560189676s LIMIT 2147483647
and the result is 10986.00.
There are duplicate events, but the expected result in the log is definately > 0
Any idea why? Any help is appreciated.
BTW. As far as I understand it should be possible to delegate the aggregation to influxdb