bimmerconnected / ha_custom_component

Home Assistant Custom Component of BMW Connected Drive
34 stars 13 forks source link

Unable to install the BETA integration in China #64

Closed muxiachuixue closed 9 months ago

muxiachuixue commented 1 year ago

I successfully downloaded the 20230517.1 version of BMW Connected Drive BETA from HACS. The files are located in /config/homeassistant/custom_components/bmw_connected_drive. I checked the manifest.json file in this folder and it is indeed the latest with "requirements": ["bimmer_connected==0.13.5"].

The problem is I could not find the BMW Connected Drive BETA integration from Settings -> Devices & Services. There is only a "BWM Connected Drive" integration in the menu and when I tried to login using this one, the error showed:

Logger: bimmer_connected.api.authentication
Source: components/bmw_connected_drive/config_flow.py:43
First occurred: 17:26:26 (2 occurrences)
Last logged: 17:27:14

Authentication error: {"description":"请前往应用市场获取最新版本","code":499100,"msgType":"toast","error":true,"data":null}

It seems like this "BMW Connected Drive" integration in the Devices & Services menu is the official version which is not usable for Chinese users. I also installed the latest bimmer_connected on the Linux host and checked the status of the vehicle using the command line. It successfully returned the vehicle status data. So the problem is not from the bimmer_connected library.

So any solutions to make the BETA version installed on HA?

What I have tried but did not work:

  1. Installed the 20230517.1 BETA version from HACS and restarted HA;
  2. Manually downloaded the files and placed them in the custom_components/bmw_connected_drive folder and then restarted HA;
  3. Changed the name of the integration in the manifest.json file from "BMW Connected Drive" to "BMW Connected Drive BETA" and then restarted HA;
  4. Changed another browser on the laptop or used the HA app;
  5. Asked another Chinese user to try on his own HA.

HA info:

arch: aarch64
channel: stable
docker: 23.0.3
features:
- reboot
- shutdown
- services
- network
- hostname
- timedate
- os_agent
- resolved
- journal
- disk
hassos: null
homeassistant: 2023.4.2
hostname: raspberrypi
logging: info
machine: raspberrypi4-64
operating_system: Debian GNU/Linux 11 (bullseye)
state: running
supervisor: 2023.04.1
supported: true
supported_arch:
- aarch64
- armv7
- armhf
timezone: Asia/Shanghai
rikroe commented 1 year ago

The custom component directly replaces the integrated component (no beta rename), so it should use it.

Please try and replace the refresh_token in config/storage/.config_entries with null and try again.

muxiachuixue commented 1 year ago

The custom component directly replaces the integrated component (no beta rename), so it should use it.

Please try and replace the refresh_token in config/storage/.config_entries with null and try again.

There is no refresh token in the /config/.storage/core.config_entries file and neither the bmw keyword. It seems that HA did not load the BETA integration. Weird. Other integrations installed from HACS work well.

Solved: I found the path of the bimmer_connected library on HA using sudo find / -name bimmer_connected and replaced the library files with the 0.13.6 version and then restarted HA. Now it is able to login.

rikroe commented 1 year ago

Great that you found a workaround, but I don't know why HACS didn't update accordingly...

rikroe commented 1 year ago

Maybe try 20230604.1. This should definitely install 0.13.6.