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

Energy value briefly drops to zero while still plugged in. #55

Open
richie510 opened this issue Jan 23, 2025 · 6 comments
Open

Energy value briefly drops to zero while still plugged in. #55

richie510 opened this issue Jan 23, 2025 · 6 comments

Comments

@richie510
Copy link

The energy value appears to go to zero when the charger is unplugged, and then it jumps back up to cumulative value when updating. In the graph, you can see how I charged last night, and then this morning I remote started, which drew some more energy. Then I unplugged, which dropped the value to zero, then it had a periodic update that went back up, then dropped back down because it was still unplugged.

Do I have something wrong in my setup?

Image

@richie510
Copy link
Author

It happened again this morning. I got two bumps this morning. Each one shows up as a huge power draw in my energy dashboard. Luckily I can go to Developer Tools -> statistics, and then find that entity and normalize out the "outlier", but this appears to not be very helpful for an energy dashboard... Is anyone else experiencing this? Is anyone using a helper to "debounce" the signal?

Image

@richie510 richie510 changed the title Energy value appears to drop to zero after unplugging. Energy value briefly drops to zero while still plugged in. Jan 25, 2025
@richie510
Copy link
Author

I updated the issue description to better reflect what I'm witnessing. It appears that Chargepoint itself resets the total charge after unplugging, and that is expected. Today my energy output had no dropouts. It appears that accessing the Chargepoint app causes issues with the HA integration, and visa versa. I have an iPhone widget setup on my Mac desktop for Chargepoint and I believe that it was updating around the times that I got the dropouts. I have since deleted the charge point widget on my Mac and I will use the charge point app more sparingly.

Maybe an even better description for this issue would be that the energy value drops out to zero every time the integration has an issue, rather than just holding on to the last good known value until a fresh value can be obtained.

Image

@richie510
Copy link
Author

I had several days of this working fine after avoiding the ChargePoint app and removing the widget from my Mac desktop. Today I got another dropout. I have been trying to look through the code finding more about how this variable is defined to see if there is a way to have it not reset to zero, but I’m not getting very far.

I think I have also found a possible work around by using a helper for the statistic maximum. There I am setting sampling size to a relatively large number (100) with a maximum time of 10 minutes. This seems to remove the dropouts. Now I’m a little wary of the charade of trying to swap the signals without losing the history…

I would also like to clarify that there are no errors in the log (regular or raw) during the time of the dropout, and in general, no errors related to ChargePoint.

Image

@richie510
Copy link
Author

I forked this repository and installed it with some changes. Turns out I am terrible at this. I cannot understand how this section works:

    value=lambda entity: round(entity.session.energy_kwh, 2)
    if entity.session
    else 0,

I tried to do this without the if statement:

    value=lambda entity: round(entity.session.energy_kwh, 2),

But I got an error about the unit of measurement being an issue.

I was hoping to just not reset the value to 0 if there is an issue with the session. I guess I will give up for now and see if I can transition to using the “max statistic” for my energy dashboard, rather than the native entity.

@adbsmith
Copy link

adbsmith commented Feb 6, 2025

I am having what I believe is the same issue. Roughly 30 minutes before the charge ends, the energy output drops to 0 and then shoots back up to the full charge gain. This is a major issue for Energy Output's integration into HA's energy monitoring because it is causing my energy monitoring to think that my car has consumed double the amount of energy and is screwing up cost tracking

Image Image

@richie510
Copy link
Author

@adbsmith Two things for you. 1. have you used the "statistics" developer tool to normalize out the "outliers" when you get these spikes in the energy graph? 2. I recently "setup" this integration again clicking "configure" on the integration page and re-applying my password. Surprisingly It showed a new feature for me to be able to select the charging amperage.

I have not gotten a dropout since then, but it has only been a few days and I have only charged once since doing that. I will report back if seems to have any lasting effect.

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