Advertisement
KirboWnz

Total daily consumption from TimescaleDB LTSS

Mar 16th, 2023 (edited)
827
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT
  2.   time_bucket_gapfill('1 minutes', "time") AS "time",
  3.   entity_id,
  4.   MAX(state::float) as "value"
  5. FROM ltss
  6. WHERE
  7.   $__timeFilter("time")
  8.   AND entity_id like '%consumptio%_daily%'
  9.   AND state NOT IN ('unknown', 'unavailable')
  10. GROUP BY time_bucket_gapfill('1 minutes', "time"), 2
  11. ORDER BY 1,2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement