Utility Meter power graph

Do you have it flasher with tasmota ? I need these connected to ewelink to be able to access them from outside of my wifi because my internet provider does not provide any type of public IP so I cant use duckdns etc.

How do you browse the internet without an IP Address?
What happens when you go to https://www.whatismyip.com/

I have a private IP its really common in EU and I know that for others it may seem like weird but it’s like that unfortunately.

This shows the same IP my 50 neighbors have.

That’s the new scam ISPs use for some time, using shared IP numbers. I give it to IPv4 numbers are exhausted, so the ISP shares one IP with multiple clients. That basically means, you can almost never access your network from outside with port forwarding.

Most of the ISPs offer dedicated IP adresses for a small monthly fee. That’s how i solved it.

I experience the same behavour. The energy values of the Utility Meter jump after a HA restart. The increase corresponds with the value on the incoming sensor (Shelly 2.5). I am using HA v0.106.5.
I just started using the Utility Meter so I cannot say if in older HA versions it was different.

I am using v106.4 now and it has been the same for a long time with the older HA versions.

Hi
Thanks, I’ve been using the utility meter with an Emporia Vue for 2 months now and have not seen that issue. My Hassio reboots nightly and I am running v106.4.

I’m still trying to figure out how to sync my utility’s billing cycle with a monthly utility meter. My billing starts on the 15th day of the month so I set the offset day to 15. Still testing, but after reviewing the code it looks like you 14 as the offset if you want the 15th. Anyone else’s two cents?

5310

What you are missing is the algorithm used for integration (default trapezoidal):

Check https://en.wikipedia.org/wiki/Riemann_sum too

I would try your setup with left or right methods.

Doesn’t look like your jumps are related to HA restarts as others have reported.
They are clearly related to when your device turns ON - unless your server restarts every time that happens due to power fluctuations at your home :wink:

I wonder if this could be an issue with data points: The initial jump in Wh appears larger based on the time it has been turned off prior to the event. On the chart it actually looks as if the increase is proportional to that off-time period.
This clearly a very wild guess but might be worth considering.

What might be happening here is that the integration component does not receive any additional data points after Power (Watt) drops to zero because there is no change in value - it remains at 0W.
Then, when the device turns on and Watt goes to 2300 Watt, it calculates an average for that entire time period since that first data point (when the device was turned off, 0 Watt), and the current data point (2300W). Adding a consumption of 1150W * x hours (where x is the time the device was turned off and power was at 0W).

This is, for example, an optimization that the MQTT sensor has enabled by default. (see MQTT Sensor - Home Assistant)

I can’t find any indication in the docs for the ewelink component that it is doing this though. is it possible that Home Assistant is doing this?

Anyway, a possible way around this might be to set the “method” of the integration component to use the “Left Rieman Sum”.

  - platform: integration
    source: sensor.sonoff_power
    name: nove
    method: left

see Integration - Riemann sum integral - Home Assistant

From Riemann sum - Wikipedia

image

2 Likes

You are genius, thank you!


Wow, look at that nice-looking graph.

The problem must be with the sensor not sending the “0” W consumption, the appliance connected to the sensor is boiler so it is either on or off, so when it was off it consumed 0 W and the sensor provided just 0 at the moment it turned off. If it was turned off for 6 hours, it told me that the sensor had 0W 6hours ago as the last state.
I also think it may be with the HA restarts, that the integration tries to do the same with the off-time of HA, right? So it can help others I hope.

Thank you so much!

Hey, guys try what mistaecko advised to me.
It can be the same, that the integration probably tries to calculate the consumption in the gap with no data from the sensor (when the HA is off/restarting).
Just add to your integration the “method: left” and see what will happen.

Thanks for the suggestion but I am not using the integration component. I get the consumed energy (kWh) directly from my sensor (Shelly 2.5) and the sensor stays always on.

Hi,

I am using HA 0.107.7 and facing the same issue. Has anyone been able to fix this?

I want to report that I use since a few weeks the Integration component to compute the total energy as input for the utility meter component (instead of kWh coming directly from my shelly) and this is working fine for me.

May I ask what the verdict of the discussion is here? I just found out utilitymeter and want to get accurate readings for my power sensors. How do I get that? I have current Wattage and Total kWh for my devices. As I understood the way to go is with the kWh total? and the utility meter just records the difference each cycle? or should I use the integration component instead? This is still a bit confusing :smiley:

The solution that allows maximum precision and accuracy and definitively avoids all spikes problems is to add to each new point acquired a very small value that changes sign each time (say +0.0001 and -0.0001) thus forming an average square wave zero added to the acquired values which does not affect the integral or even the data itself and forces Home Assistant to fill in the blanks of data in the database that lead to the accuracy of the integral itself. Also, trapezoidal integration is more accurate than right or left rectangular integration, so it is always preferable when used with this solution. To implement this solution, a template sensor can be used which adds the value saved in a global variable to each new point acquired by the sensor and, each time, multiplies the variable by -1, thus changing its sign.

1 Like

Hi guys, I settet up some ultility meter. All of them are working flawlessly except one. This UM should count energy metering from my house and look what it did tonight:

Did anyone of you encountered the same behavior?