Closed rhoddan closed 2 years ago
it in minutes, but hows in hours
13.73 hours should be 137.3 minutes
Just fixed AM/PM parsing coming of the charging end times, please try again with the newest custom component/library.
20211127.1 Still mismatch between BMW App and HA regarding end charging time remaining...
I was thinking of maybe removing charging_time_remaining
completely and just replacing it with charging_end_time
.
That could be easier to debug and produce less state changes in Home Assistant.
If needed you still could calculate the remaining time using a simple sensor in HA.
Please check the new sensor charging_end_time
in the latest custom component. If you want to see the value returned by the BMW API, please also activate the charging_end_time_mybmw
sensor from device settings in HA.
not sure if/how I need to activate the charging_end_time_mybmw?
2021-12-05 22:39:23 ERROR (SyncWorker_2) [bimmer_connected.account] 401 Client Error: Unauthorized for url: https://cocoapi.bmwgroup.com/eadrax-vcs/v1/vehicles?apptimezone=60.0&appDateTime=1638736763.002946&tireGuardMode=ENABLED Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/bimmer_connected/account.py", line 300, in send_request response.raise_for_status() File "/usr/local/lib/python3.9/site-packages/requests/models.py", line 953, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://cocoapi.bmwgroup.com/eadrax-vcs/v1/vehicles?apptimezone=60.0&appDateTime=1638736763.002946&tireGuardMode=ENABLED 2021-12-05 22:39:23 ERROR (SyncWorker_2) [custom_components.bmw_connected_drive] Could not connect to the BMW Connected Drive portal. The vehicle state could not be updated 2021-12-05 22:39:23 ERROR (SyncWorker_2) [custom_components.bmw_connected_drive] 401 Client Error: Unauthorized for url: https://cocoapi.bmwgroup.com/eadrax-vcs/v1/vehicles?apptimezone=60.0&appDateTime=1638736763.002946&tireGuardMode=ENABLED Traceback (most recent call last): File "/config/custom_components/bmw_connected_drive/init.py", line 321, in update self.account.update_vehicle_states() File "/usr/local/lib/python3.9/site-packages/bimmer_connected/account.py", line 412, in update_vehicle_states self._get_vehicles() File "/usr/local/lib/python3.9/site-packages/bimmer_connected/account.py", line 376, in _get_vehicles response = self.send_request( File "/usr/local/lib/python3.9/site-packages/bimmer_connected/account.py", line 303, in send_request raise ex File "/usr/local/lib/python3.9/site-packages/bimmer_connected/account.py", line 300, in send_request response.raise_for_status() File "/usr/local/lib/python3.9/site-packages/requests/models.py", line 953, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://cocoapi.bmwgroup.com/eadrax-vcs/v1/vehicles?apptimezone=60.0&appDateTime=1638736763.002946&tireGuardMode=ENABLED
Sorry, you were not able to. Check your entities list with the new custom component: https://github.com/bimmerconnected/ha_custom_component/releases/tag/20211207.1
Why does it differ between HA (03:06AM) (updated via bmw_connected_drive.update_state service) and my My BMW App (23:20)? It's also 12h & 24h time format
This is driving me nuts. I really think we're using the wrong endpoint here...
Can you please do me a favor and edit /usr/local/lib/python3.9/site-packages/bimmer_connected/account.py
L384 to the following:
"appDateTime": int(datetime.datetime.now().timestamp()*1000),
and test again?
The BMW API will always return 12h format, so we have to parse it.
If your charging_end_time
sensor (not the _original
one) shows Invalid timestamp (like in your screenshot above), can you please check the entity itself & if there are any logs why this is not working?
Can you please do me a favor and edit
/usr/local/lib/python3.9/site-packages/bimmer_connected/account.py
L384 to the following:"appDateTime": int(datetime.datetime.now().timestamp()*1000),
and test again?
The BMW API will always return 12h format, so we have to parse it.
If your
charging_end_time
sensor (not the_original
one) shows Invalid timestamp (like in your screenshot above), can you please check the entity itself & if there are any logs why this is not working?
I'm running Home Assistant "Supervised" and not sure how to edit that file? The only files I can edit is as the attached.
Can you please edit manifest.json
and change the line with requirements
to:
"requirements": ["bimmer_connected==0.8.7.0b1"],
That should bring you up to the latest and just merged master branch.
EDIT: Updated to a pre-release version, as the git+
link doesn't seem to work.
Can you please edit
manifest.json
and change the line withrequirements
to:"requirements": ["bimmer_connected==0.8.7.0b1"],
That should bring you up to the latest and just merged master branch.
EDIT: Updated to a pre-release version, as the
git+
link doesn't seem to work.
Thanks for all help and time. I edited the manifest.json (see attached) and then restarted HA I also tried to redownload but no new version available. Probably I'm missing a step?
There is no new component available, so you should not see any upgrade notice in HA.
Please check with pip3 freeze
if your are on the beta mentioned above and then have a look at the charging_end_time
sensors and their values.
Just looked through the PRs for HA 2021.12. It can be that charging_end_time
only works (i.e. displays a timestamp in the UI) if you are already on 2021.12 (it was developed on the 2021.12 beta).
So if charging_end_time_original
is close to the app (ignore 12h/24h), the new sensor should work with the new HA release.
Thanks for info. I will wait for 2021.12 and see if it works
Hi again, The released 2021.12 BMW version seems to work great! The only issue I can see is still the difference of remaining charge time
Thanks for a fantastic work!
This should finally be fixed with Home Assistant 2021.12.4.
Please uninstall the custom component again to be able to get updates with Home Assistant.
If new errors come up, please open new issues with the home-assistant/core or the bimmerconnected/bimmer_connected repositories.
Thanks - seems to work fine in 2021.12.4
The charging time remaining seems to be incorrect. I guess max 45 minutes left