Graphing Energy

that is the point I am struggling with right now.

I can group my weekly counters by date but that will only show me daily increasing bar even though I need a grouping based on weeks or months.

But the only option mentioned that might fit is called “interval” but without any example on github nor here and even google did not find an example for interval and how to use it for grouping by week or month.

But maybe you have an idea for that issue here
image

created by this

type: 'custom:mini-graph-card'
name: COUCH
smoothing: false
hours_to_show: 336
points_per_hour: 1
line_width: 2
line_color: orange
animate: true
height: 80
entities:
  - sensor.kwh_2_3_weekly
font_size: 70
show:
  graph: bar
  points: true
  icon: false
  labels: true
  name: true
group_by: date
aggregate_func: max
decimals: 3
lower_bound: 0
upper_bound: 2

On github I foud that group_by: date can also be hour or interval but not how or where is inverval can be defined ?

Thx for your support.

1 Like

@
typxxi
Never mind. Found the sensor after a restart and waiting for 5 hours. It was located under as

sensor.today_consumption

and

sensor.ten_days_consumption

Actually found it accidentally while adding a graph. I am just getting my feet wet using sonoff, but will obviously try to find some calibrated energy meter and shelly devices.

@tom_l please move all relevant discussion here. So that any future user can easily follow our discussion.

Isn’t AC power slightly different from DC power? Power in AC Circuits

I am not sure at all cause this is now a POW R2 - at least the second release we had gotten back then to measure solarroof production where it was working right while the first was not really working.

I am not sure if a shelly would really help a lot or a tuya might be better cause cheaper and everywhere available but the SonOff figures are looking like a lottery or gamble.
224 Volt x 0,51 A must end at least in a 112 Watt figure, for sure not in 70,6 W unless there would be something going on what we know from DC as pwm.

You simply need to measure Voltage and I guess that this figure will be quite right .
The second point will be the current. Both can be achieved by a multimeter easily but it does not really help cause you might only need the right calibration.

That power meter will deliver a Wh measurement that you can crosscheck first by measuring a device you can be sure that it has such power consumption like an old OSRAM bulb with 80W or so. After running such a bulb for a quarter hour you should see a 20,x Wh figure just to make sure what your power meter is measuring. All claim to be accurate but it needs a proof like this or a water kettle running 6 minutes with its 2000W which will mean 6 / 60 hours x 2000 W = 1 / 10 x 2000 Wh = 200 Wh

And from there on you can then start to measure what the aquarium socket will use in parallel while the SonOff plug is plugged into that device and reports its own figures.

You can then compare live figures in the sensor pane with the figures of such power meter and I hope you will get a kind of constant factor as deviation.

The black box for you is the algorithm the sonoff sensor uses for the Wh calculation locally and how accurate this is.

I would try to get my own Watt calculation and let the rieman integrall do the math or measurement over time better known as consumption. And this figure can be compared with the power energy meter.

Cause such aquarium would here be called a power or energy monster considering the 110 W power in a 247 use case which would simply mean roughly factor 9 to get the annual kWh consumption: 990 kWh p.a.

that would cause a 300€ bill here … or a third of a ususal house hold consumption of 2,x persons

And therefore it is more important to get this figure right than what most of our 10 plugs measure which are about 100 - 300 kWh a year except that one that powers the EV with usually 2,3 kW

At least you seem to have the pow2 type as the sensor says which was far more accurate than the previous version cause we had back then both types in use.

The longer you check your values the more questions might occure cause the 4,47 kWh figure for 10 days does not really fit to the sensor screenshot where you could see a most likely daily consumption of 0,94 kWh - 0,87 kWh per day or roughly 4 kWh in 4 days.

What do you power through that POW R2 ?
a pump and a water heating / cooling … if so then that would show a smaller constant consumption for the 247 running pump while the heating or cooling would kick in only from time to time which would show a different pattern like a fridge.

But there is a huge gap between the Watts in your screenshot and the consumption except you would always have created a screenshot during heating / cooling phase cause based on the watts calculated by Volt x Ampere = 112 W over 24 hours the consumption would be a lot higher than just ~ 1 kWh as the sensor had shown.

Here you can get ELV energy master basic that will measure the figures quite accurate but I guess that his energy meter is product you might only get in the EU.
My tuya base figures like V and A do not fit together too but at least the W are right and Watts over Riemann integral deliver a figure which is 100,5% of the power meter figure so the HA reported consumption is about 0,5% higher.

Maybe you find a different device where you can start easier than such a combined use case where at least 2 or more consumers are powered through the POW R2 I guess cause an aquarium usually needs light, warm and a water pump which are running independently and at least warm is controlled by sensor I guess, while light might be running in a time schedule and water pump too or even constantly.

I would try to measure 1 device at a time like that bulb just to get behind what values might be right and what are wrong. It took me back then about 2 months to get behind that whole mess how far off these plugs can be till I found the tuya being accurate and also across the batch in a usual use case where max. 1000 Watt consumers turn on / off cause in spikey use cases the accuracies goes down too, I mean a lot of 1000 W on / off switches per day you usually find when micro waves are running a programm of heating rice.

I was able to add Sonoff Pow2 using Alexxit’s SonoffLan control to Energy dashboard Orginal idea presented here Integration Solar inverter huawei 2000L - #587 by bigcheese GitHub - AlexxIT/SonoffLAN: Control Sonoff Devices with eWeLink (original) firmware over LAN and/or Cloud from Home Assistant
Steps are simple

  1. configuration
  2. Scroll down to Customizations
  3. select your entity
  4. select device class as “energy”
  5. select state class as " measurement"
  6. Select other
  7. Attribute name “last_reset”
    8 attribute value “1970-01-01T00:00:00+00:00”
  8. click save
  9. Now your sensor will show up in energy dashboard.

Home Assistant: 10$ WiFi Energy plug meters with ESPhome (Grafana) part - 3 - YouTube very helpful video he uses the intergral method.