Hi team.I would like to down-sample my energy consumption from my database SensorData
I have two CQs to scale from continuous reading to daily and to monthly consumption:
DayGasQuery CREATE CONTINUOUS QUERY DayGasQuery ON SensorData RESAMPLE EVERY 1d BEGIN SELECT sum(power) AS DayGas INTO SensorData.a_month.MonthGasMeasurement FROM SensorData.defretmia.power WHERE time > now() - 1d GROUP BY time(1d) END
MonthGasQuery CREATE CONTINUOUS QUERY MonthGasQuery ON SensorData RESAMPLE EVERY 30d BEGIN SELECT sum(DayGas) AS MonthGas INTO SensorData.a_year.YearGasMeasurement FROM SensorData.a_month.MonthGasMeasurement WHERE time > now() - 30d GROUP BY time(10d) END
defretmia is a RP that discarge data every three days.
Notice that for energy saving purpose I shut down the server every night and I restart it at the morning but I can reconsider this if could help.
MonthGasQuery is launched as i can see in the log:
Oct 15 07:53:43 hassbian influxd: [I] 2017-10-15T05:53:43Z executing continuous query MonthGasQuery (2017-09-21 00:00:00 +0000 UTC to 2017-10-11 00:00:00 +0000 UTC) service=continuous_querier
Oct 15 07:53:43 hassbian influxd: [I] 2017-10-15T05:53:43Z SELECT sum(DayGas) AS MonthGas INTO SensorData.a_year.YearGasMeasurement FROM SensorData.a_month.MonthGMonthGasMeasurement WHERE time >= '2017-09-21T00:00:00Z' AND time < '2017-10-11T00:00:00Z' GROUP BY time(10d) service=query
Oct 15 07:53:44 hassbian influxd: [I] 2017-10-15T05:53:44Z finished continuous query MonthGasQuery (2017-09-21 00:00:00 +0000 UTC to 2017-10-11 00:00:00 +0000 UTC) in 400.285652ms service=continuous_querier
But DayGasQuery won’t start I don’t see it in the log and I have to fire the query by myself ,that works fine. (maybe is my firing the issue? I should wait more than one-two days for the CQ ?)
I have not made any modification in influx.conf.
Any help letting me know what I’m doing wrong is greatly appreciated.