Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Live Consumption using the kW instead of kWh #24

Open
Megabytemb opened this issue Apr 12, 2023 · 7 comments
Open

Live Consumption using the kW instead of kWh #24

Megabytemb opened this issue Apr 12, 2023 · 7 comments

Comments

@Megabytemb
Copy link

Version of the custom_component: 0.3.0

Describe the bug

It looks like in the latest update, we've accidentally changed the PowerpalLiveConsumptionSensor to use UnitOfPower.KILO_WATT instead of UnitOfEnergy.KILO_WATT_HOUR

return UnitOfPower.KILO_WATT

This has caused the below error, and home assistant is now no longer calculating statistics.

As stated in a previous issue, live consumption should be WattHours, not Watts.

Does that seem correct? or am i missing something here.

Debug log


2023-04-11 14:10:10.366 WARNING (Recorder) [homeassistant.components.sensor.recorder] The unit of sensor.powerpal_live_consumption (kW) cannot be converted to the unit of previously compiled statistics (kWh). Generation of long term statistics will be suppressed unless the unit changes back to kWh or a compatible unit. Go to https://my.home-assistant.io/redirect/developer_statistics to fix this

@mindmelting
Copy link
Owner

Hmm, let me look into this

@Megabytemb
Copy link
Author

any update on this? i'm sill getting the errors

@mindmelting
Copy link
Owner

I had an initial look - I think in hindsight that although this is the proper metric - it's actually a breaking change.

Going to look into a bit more soon

@mindmelting
Copy link
Owner

Ok - I have looked into this a bit more.

The last release as mentioned previously is a semi-breaking change (but might be recoverable)

The live consumption sensor, is using measurement as a state class which is correct, and has been moved from ENERGY to POWER as a device class (which is a fix) and thus from kWh to kW

If you go to: https://my.home-assistant.io/redirect/developer_statistics you can click "Fix issue" and remediate past values to be kW instead of kWh - although statistics are still not showing for me for the live sensor. (The broader total consumption sensor which is used for the Energy dashboard is not impacted)

Let me know how you go with this - and I can update the README.md for this.

Apologies for the impact!

@gurrier
Copy link

gurrier commented Jun 13, 2023

I went to do this but got the following choice which worried me about the scaling between kWh to W. Shouldn't it be from kWh to "kW" if there is only a unit change?

"Update the unit of the historic statistic values from 'kWh' to 'W', without converting."

@Megabytemb
Copy link
Author

Yeah,

i did "Update the unit of the historic statistic values from 'kWh' to 'W', without converting."

and then used powerpal_total_consumption going forward

utility_meter:
  daily_house_energy:
    source: sensor.powerpal_total_consumption
    name: Daily Energy
    cycle: daily
    tariffs:
      - peak
      - offpeak
      - shoulder

@mindmelting
Copy link
Owner

Yep, I think thats right from memory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants