Calculate and display energy consumption data?

I’m a novice at Grafana but want to figure out how this is possible:

I’ve got an energy monitor that reports the current wattage consumed, the electricity rate tier, and the associated electricity rate in each tier. An example of the data:

I’d like to do the following:

  1. Display a chart that shows the total cost per day for X days, X being the number of days selected by the time range selection. Each day would be a vertical bar, with color separation based on the amount of money spent on a given. Cost is calculated by getting the amount of watts used in a tier, converting to kilowatts by diving by 1000, then multiply it by the rate for that tier. Note that weekday tiers is at a different rate than weekend tiers.
    image

  2. Provide some kind of semi-intelligent estimation for the amount of energy that will be used in the remainder of the billing cycle. My cycle is currently every 6th of the month. I would like to be able to calculate it differently based on the day of the week as I imagine my weekday usage is pretty different than the weekend usage.

This image has a few examples of what I’m after, just not sure how to get there.

you need to sum up for one day, or time range, from point to point

Again, I’m a novice. What does this mean and how do I achieve it?

can you show your query?

And what’s your data source? I’m doing mine with InfluxDB using a Python program that reads the meter.
The challenge is that your current wattage is a gauge, but for usage you need to factor in time. My smart meter provides also “counter” values where you take a reading when the tariff changes, and subtract to compute the usage against the previous tariff.
The approach I would take is to compute the mean wattage over a short period (say 1 minute) and multiply that with the rate for that interval (corrected for the time interval) and then sum those over reporting period. With InfluxDB you could do continuous queries to aggregate data into the same measurement so the math is easy. A lot depends on how the data is arranged in different measurements.

Electricity tier is
SELECT mean(“value”) FROM “input_number.rainforest_price_tier” WHERE $timeFilter GROUP BY time($__interval) fill(previous)

It also doesnt match what I’m getting on my utility metering dashboard. Below is grafana displaying data from a zigbee data collector that is gathering data from the utility meter, while the right is metering data from the utility website.

you have to multiply the price with the watts.