audiconnect / audi_connect_ha

Adds an audi connect integration to home assistant
MIT License
238 stars 97 forks source link

oil_level everytime 100% #297

Closed synack666 closed 7 months ago

synack666 commented 7 months ago

My Audi App told me to check my oil level, my car needed some. In HA the oil level was 100% all the time. Car: S4 TFSI

synack666 commented 7 months ago

File "/config/custom_components/audiconnect/audi_connect_account.py", line 839, in oil_level if isinstance(val, bool): ^^^ UnboundLocalError: cannot access local variable 'val' where it is not associated with a value

Kolbi commented 7 months ago

Can you deliver a debug file?

synack666 commented 7 months ago

sure, how long should i run debug? reload audi_connect? my comment abouve is from debug file

Kolbi commented 7 months ago

Yes should be enough but if you already filled up oil maybe it doesn't make sense. I would need the data before filling up oil to see why it showed up 100% instead of empty.

wigster commented 7 months ago

Just a comment here -- since I bought the car in December (2019 Q5) the oil sensor has randomly moved 100% <-> 75% <-> 0%. This was before the API changes, but it never seemed to be giving good information (in the car, there is never a problem).

Now the API is different, but maybe this never worked properly?

synack666 commented 7 months ago

Yes should be enough but if you already filled up oil maybe it doesn't make sense. I would need the data before filling up oil to see why it showed up 100% instead of empty.

have filled up... but gues not to 100%, i run a debug

synack666 commented 7 months ago

home-assistant_audiconnect_2024-03-20T11-33-22.162Z.zip

synack666 commented 7 months ago

Just a comment here -- since I bought the car in December (2019 Q5) the oil sensor has randomly moved 100% <-> 75% <-> 0%. This was before the API changes, but it never seemed to be giving good information (in the car, there is never a problem).

Now the API is different, but maybe this never worked properly?

it was always just a rough estimate but I could see it slowly getting less and less

Kolbi commented 7 months ago

home-assistant_audiconnect_2024-03-20T11-33-22.162Z.zip

From your log:

File "/config/custom_components/audiconnect/audi_connect_account.py", line 839, in oil_level if isinstance(val, bool): ^^^ UnboundLocalError: cannot access local variable 'val' where it is not associated with a value

Can you provide again a log file with switching on debugging level for this integration?

synack666 commented 7 months ago

2024-04-02 155736.440 DEBUG (MainTh.txt

yes of course, hope that fits

Kolbi commented 7 months ago

Thanks, I think I got the issue and already included the fix with a PR.

Please try with version 1.1.0: https://github.com/audiconnect/audi_connect_ha/releases/tag/v1.1.0

synack666 commented 7 months ago

Unfortunately I have to tell you that it is apparently not solved, in HA 100%, in the car roughly 70% (I only have a bar display and have to estimate).

Kolbi commented 7 months ago

Sadly your log /api provides currently only True as oil_level:

OIL_LEVEL_DIPSTICKS_PERCENTAGE loc:['oilLevel', 'oilLevelStatus', 'value', 'carCapturedTimestamp']: val:True

That's why you see 100% in HA.

synack666 commented 7 months ago

ok, thnx, hoping Audi fix ist.... sometimes...