wingrunr21 / hassio-xcel-itron-mqtt

Bridge for Xcel Energy's iTron Gen 5 Riva smart meters and MQTT
54 stars 8 forks source link

Sensor Cost Resets when home assistant resets #16

Open JHarding86 opened 3 months ago

JHarding86 commented 3 months ago

Problem: When HAOS restarts, the sensor "xcel_itron_5_current_summation_delivered_value_cost" resets.

Expected Behavior: When HAOS is running without reboots, this value is accumulated. I expect that the value is retained between restarts.

Maybe I have the wrong impression about what this variable is...

WedHumpDay commented 2 months ago

Can confirm this as well. Have to restart the Xcel iTron MQTT add-on but this doesn't always resolve. Additionally, the following two entities seem to disable themselves frequently which I believe are needed to leverage cost.

wingrunr21 commented 3 weeks ago

I'd need to look but I believe my meter doesn't provide any data for those (despite them being in the spec). It would be nice as it would allow time of use pricing to be applied.

JHarding86 commented 3 weeks ago

My main issue is with "xcel_itron_5_current_summation_delivered_value_cost".

Yesterday I updated HAOS and a restart was forced. This made that variable reset:

image

wingrunr21 commented 3 weeks ago

That's likely going to be an issue with the upstream project vs this integration. I'll have to take a look at that and see if I can see if there's a data type that's coded incorrectly. I don't even have that sensor. Is that created when you add cost to the HASS energy dashboard?

JHarding86 commented 3 weeks ago

I just found this while searching for the variable as I was having a tough time finding it as well. Apparently this is hidden by the integration?

image

wingrunr21 commented 3 weeks ago

Ya, there isn't a cost sensor exposed this addon. Do you have cost tracking enabled in the Hass energy dashboard (Settings->Dashboards->Energy->Grid consumption->edit settings)?

JHarding86 commented 3 weeks ago

It appears as though I may have cost tracking enabled: image

wingrunr21 commented 3 weeks ago

Can you click that pencil icon and see what your cost setting is? Here's what mine looks like:

image

JHarding86 commented 3 weeks ago

image

wingrunr21 commented 3 weeks ago

So, looks like this has been reported for a few different energy integrations:

home-assistant/core#124167 home-assistant/core#79638

In both instances the upstream MQTT integration was blamed.

@JHarding86 do you have a Utility Meter integration created for you? It appears there's a periodically_resetting config option that could be the culprit?

JHarding86 commented 3 weeks ago

@wingrunr21 Those issues were very helpful, thank you. I ended up creating a "Utility Meter" helper and tied it to the Xcel Itron variable. Then I associated my Utility Meter to my grid consumption. Now when my HAOS reboots, I don't lose the cost.