Power use, task to save daily, weekly, monthly?

I am very new to influxdb and I am using it to monitor power use in watts, every 10 seconds I get a reading and to save space in the bucket I would like to only keep 7 days of 10 second data and after 7 days keep a daily total (I assume mean * 24 would give me a reasonable daily total), save this to a bucket and delete from main bucket, same for weekly/monthly.

I have been able to get the mean but can’t seem to work out how to multiply it by 24 (I am sure it’s simple but can’t seem to work out how to do it).

This is the query I have at the moment: (I may be way of track!)

from(bucket: "power")
|> range(start: -1d)
|> filter(fn: (r) => r["_measurement"] == "supply")
|> filter(fn: (r) => r["_field"] == "value")
|> aggregateWindow(every: 1d, fn: mean, createEmpty: false)
|> yield(name: "mean")

Any help would be appreciated.

Gordon

I’ll let someone else more familiar with Flux Query Language than I am answer
your actual question, but I would simply observe that power is measured in
Watts, whereas Watt-hours is a measure of energy (3.6 kiloJoules).

You might want to make sure that your units (and especially any display
output) are labelled correctly so that you know which is which.

Antony.

Sorry typo, should have been watts!, I’ll correct the question