I am querying solar production for specific hours in each day. I can query for 1 hour like this:
SELECT first("integral") FROM ( SELECT integral("kW",1h) FROM "solar" WHERE TIME >'2019-10-04 16:00:00' GROUP BY time(1h)) WHERE TIME >'2019-10-04 16:00:00' GROUP BY time(24h,16h) tz('America/Los_Angeles')
Extending this time span to 2h should be straight forward. However, something breaks, because I think in UTC I am starting the query at 23:00 and if I query 2h then it goes into the next day. So the following should work but doesnt:
SELECT first("integral") FROM ( SELECT integral("kW",1h) FROM "solar" WHERE TIME >'2019-10-04 16:00:00' GROUP BY time(2h)) WHERE TIME >'2019-10-04 16:00:00' GROUP BY time(24h,16h) tz('America/Los_Angeles')