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

Homeassistant "lies" about how recent a reading was. #45

Open
sweavo opened this issue Sep 3, 2023 · 0 comments
Open

Homeassistant "lies" about how recent a reading was. #45

sweavo opened this issue Sep 3, 2023 · 0 comments

Comments

@sweavo
Copy link

sweavo commented Sep 3, 2023

Scenario: HA polls the car once an hour for SOC, plugged status, etc., and shows the results on a dashboard along with "3 minutes ago" etc. When I go for a drive, the car stops responding to the API calls, but pycarwings (init.py line 417) pretends it is getting data, passing stale data up to HA. When I get home and plug in again, HA might tell me that it read a SoC of 90% 3 minutes ago, when an hour later it is now reading 60%.

I would like the "3 minutes ago" to say "4 hours ago" if that's how old the sample is.

I have two strategies to consider:

  1. make a new sensor that is "time of last successful query" so that it can be displayed on the dash along with the (sometimes stale) data
  2. cause the entities not to be updated when the car is unavailable, e.g. by not falling back to latest server values at line 417

Before I go down the rabbithole learning how to run my development python on my HA setup, does point (2) make sense? or will it have some other consequences to fail to return a value?

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

1 participant