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

Consumption chart seems to be linked to time of sync, not time of usage #5

Closed
maxw3l opened this issue Oct 21, 2021 · 3 comments
Closed

Comments

@maxw3l
Copy link

maxw3l commented Oct 21, 2021

Version of the custom_component

f7e8b30

Describe the bug

The Total Consumption chart seems to be calculated based on the time of syncing the data, not the actual time of usage. This shows it fairly clearly:
image

Compare with actual usage per hour from Powerpal app:
image

Is this a bug or a limitation of the API?

@mindmelting
Copy link
Owner

Hey @maxw3l - thanks for using - in its current implementation this is not a bug - it evaluates total_watt_hours from the API (which is total consumption) every minute. This works fine if your Powerpal app is updating the servers with readings consistently - which means you need to have it running on a device that is connected to Powerpal 24/7 (I have mine running on an old iPad which I also use as a HA wall mounted dashboard)

Now there is also an API for getting historical usage - however I haven't found a neat way of getting that to play nicely with HA and the energy dashboard yet (will look at it again).

If all works nicely you should get a dashboard that is pretty close to what Powerpal reports - and within a few cents of what your bill shows for that day.

Let me update the documentation shortly to be clear on how this works internally!

@maxw3l
Copy link
Author

maxw3l commented Oct 21, 2021

@mindmelting cheers, thanks for the explanation.

As you thought, I'm using it on my phone which isn't connected full time, explaining the disconnect in the figures.

Awesome work getting HA to interface with Powerpal at all! Very clever.

@mindmelting
Copy link
Owner

@maxw3l I will relook into using batched historical data (which would more suit use cases where devices are not 24/7 connected) soon!

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

2 participants