Closed steeve closed 1 year ago
Hi,
Make sure you are running on >=HA2022.11 and MBAPI2020 =v0.7.4
Then:
please delete the .Mercedes token file in your HA folder
Restart HA
Reauthenticate the component
Thanks for the reply.
I am running everything to the latest and did try to reauthenticate multiple times by either reinstalling the component and restarting or removing the token cache file.
I am running HA=2022.12.9 and MBAPI2020=v0.7.4.
could you please enable the debug logging (see readme) and send the log to mbapi2020-i98 (at) nulsch . de
And share some more info about your car, country and special settings
As i have the same issue i send you my log.
2023-01-05 18:42:58.499 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration philips_airpurifier_coap which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2023-01-05 18:42:58.500 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration nodered which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2023-01-05 18:42:58.500 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration mbapi2020 which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2023-01-05 18:42:58.500 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2023-01-05 18:42:58.500 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration holidays which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2023-01-05 18:43:00.081 WARNING (MainThread) [hass_nabucasa.cloud_api] Fetched https://alexa-api.nabucasa.com/access_token (400)2023-01-05 18:43:06.339 ERROR (MainThread) [hass_nabucasa.remote] Connection problem to snitun server 2023-01-05 18:43:06.944 WARNING (MainThread) [custom_components.mbapi2020] Can't connect to MB APIs; Retrying in background 2023-01-05 18:43:06.945 WARNING (MainThread) [homeassistant.config_entries] Config entry 'mbapi2020' for mbapi2020 integration not ready yet; Retrying in background 2023-01-05 18:43:11.032 WARNING (MainThread) [homeassistant.components.homekit] Cannot add binary_sensor.m_a_8088_park_brake_status as this would exceed the 150 device limit. Consider using the filter option 2023-01-05 18:43:11.032 WARNING (MainThread) [homeassistant.components.homekit] Cannot add device_tracker.m_a_8088_device_tracker as this would exceed the 150 device limit. Consider using the filter option 2023-01-05 18:43:11.033 WARNING (MainThread) [homeassistant.components.homekit] Cannot add sensor.m_a_8088_charging_power as this would exceed the 150 device limit. Consider using the filter option 2023-01-05 18:43:11.033 WARNING (MainThread) [homeassistant.components.homekit] Cannot add binary_sensor.m_a_8088_tire_warning as this would exceed the 150 device limit. Consider using the filter option 2023-01-05 18:43:11.033 WARNING (MainThread) [homeassistant.components.homekit] Cannot add lock.m_a_8088_lock as this would exceed the 150 device limit. Consider using the filter option 2023-01-05 18:43:11.033 WARNING (MainThread) [homeassistant.components.homekit] Cannot add sensor.m_a_8088_ignition_state as this would exceed the 150 device limit. Consider using the filter option 2023-01-05 18:43:11.034 WARNING (MainThread) [homeassistant.components.homekit] Cannot add binary_sensor.m_a_8088_low_brake_fluid_warning as this would exceed the 150 device limit. Consider using the filter option 2023-01-05 18:43:11.034 WARNING (MainThread) [homeassistant.components.homekit] Cannot add sensor.m_a_8088_lock as this would exceed the 150 device limit. Consider using the filter option 2023-01-05 18:43:11.034 WARNING (MainThread) [homeassistant.components.homekit] Cannot add binary_sensor.m_a_8088_low_coolant_level_warning as this would exceed the 150 device limit. Consider using the filter option 2023-01-05 18:43:11.034 WARNING (MainThread) [homeassistant.components.homekit] Cannot add sensor.m_a_8088_odometer as this would exceed the 150 device limit. Consider using the filter option 2023-01-05 18:43:11.034 WARNING (MainThread) [homeassistant.components.homekit] Cannot add binary_sensor.m_a_8088_low_wash_water_warning as this would exceed the 150 device limit. Consider using the filter option 2023-01-05 18:43:11.035 WARNING (MainThread) [homeassistant.components.homekit] Cannot add sensor.m_a_8088_oil_level as this would exceed the 150 device limit. Consider using the filter option 2023-01-05 18:43:11.035 WARNING (MainThread) [homeassistant.components.homekit] Cannot add binary_sensor.m_a_8088_windows_closed as this would exceed the 150 device limit. Consider using the filter option 2023-01-05 18:43:11.035 WARNING (MainThread) [homeassistant.components.homekit] Cannot add sensor.m_a_8088_range_electric as this would exceed the 150 device limit. Consider using the filter option 2023-01-05 18:43:11.035 WARNING (MainThread) [homeassistant.components.homekit] Cannot add sensor.m_a_8088_state_of_charge as this would exceed the 150 device limit. Consider using the filter option 2023-01-05 18:43:11.038 WARNING (MainThread) [homeassistant.components.homekit] Cannot add sensor.m_a_8088_starter_battery_state as this would exceed the 150 device limit. Consider using the filter option 2023-01-05 18:43:11.040 WARNING (MainThread) [homeassistant.components.homekit] Cannot add sensor.m_a_8088_fuel_level as this would exceed the 150 device limit. Consider using the filter option 2023-01-05 18:43:11.040 WARNING (MainThread) [homeassistant.components.homekit] Cannot add media_player.schlafzimmer_2 as this would exceed the 150 device limit. Consider using the filter option 2023-01-05 18:43:11.040 WARNING (MainThread) [homeassistant.components.homekit] Cannot add media_player.kuche_2 as this would exceed the 150 device limit. Consider using the filter option 2023-01-05 18:43:11.040 WARNING (MainThread) [homeassistant.components.homekit] Cannot add switch.m_a_8088_auxheat as this would exceed the 150 device limit. Consider using the filter option 2023-01-05 18:43:11.758 WARNING (MainThread) [custom_components.mbapi2020] Can't connect to MB APIs; Retrying in background 2023-01-05 18:43:22.054 WARNING (MainThread) [custom_components.mbapi2020] Can't connect to MB APIs; Retrying in background 2023-01-05 18:43:43.537 WARNING (MainThread) [custom_components.mbapi2020] Can't connect to MB APIs; Retrying in background 2023-01-05 18:44:23.752 WARNING (MainThread) [custom_components.mbapi2020] Can't connect to MB APIs; Retrying in background 2023-01-05 18:45:44.131 WARNING (MainThread) [custom_components.mbapi2020] Can't connect to MB APIs; Retrying in background 2023-01-05 18:47:04.706 WARNING (MainThread) [custom_components.mbapi2020] Can't connect to MB APIs; Retrying in background 2023-01-05 18:48:08.824 ERROR (MainThread) [frontend.js.latest.202301040] http://homeassistant.local:8123/lovelace-bls2c/zuhause:0:0 Uncaught 2023-01-05 18:48:25.115 WARNING (MainThread) [custom_components.mbapi2020] Can't connect to MB APIs; Retrying in background 2023-01-05 18:49:47.844 WARNING (MainThread) [custom_components.mbapi2020] Can't connect to MB APIs; Retrying in background 2023-01-05 18:51:08.226 WARNING (MainThread) [custom_components.mbapi2020] Can't connect to MB APIs; Retrying in background 2023-01-05 18:52:29.070 WARNING (MainThread) [custom_components.mbapi2020] Can't connect to MB APIs; Retrying in background 2023-01-05 18:53:49.378 WARNING (MainThread) [custom_components.mbapi2020] Can't connect to MB APIs; Retrying in background 2023-01-05 18:55:09.660 WARNING (MainThread) [custom_components.mbapi2020] Can't connect to MB APIs; Retrying in background 2023-01-05 18:56:30.052 WARNING (MainThread) [custom_components.mbapi2020] Can't connect to MB APIs; Retrying in background 2023-01-05 18:57:50.564 WARNING (MainThread) [custom_components.mbapi2020] Can't connect to MB APIs; Retrying in background 2023-01-05 18:59:11.025 WARNING (MainThread) [custom_components.mbapi2020] Can't connect to MB APIs; Retrying in background 2023-01-05 19:00:31.375 WARNING (MainThread) [custom_components.mbapi2020] Can't connect to MB APIs; Retrying in background 2023-01-05 19:01:51.701 WARNING (MainThread) [custom_components.mbapi2020] Can't connect to MB APIs; Retrying in background 2023-01-05 19:03:14.219 WARNING (MainThread) [custom_components.mbapi2020] Can't connect to MB APIs; Retrying in background 2023-01-05 19:04:34.611 WARNING (MainThread) [custom_components.mbapi2020] Can't connect to MB APIs; Retrying in background 2023-01-05 19:05:54.945 WARNING (MainThread) [custom_components.mbapi2020] Can't connect to MB APIs; Retrying in background 2023-01-05 19:07:15.493 WARNING (MainThread) [custom_components.mbapi2020] Can't connect to MB APIs; Retrying in background 2023-01-05 19:08:35.838 WARNING (MainThread) [custom_components.mbapi2020] Can't connect to MB APIs; Retrying in background 2023-01-05 19:09:56.035 WARNING (MainThread) [custom_components.mbapi2020] Can't connect to MB APIs; Retrying in background 2023-01-05 19:11:16.399 WARNING (MainThread) [custom_components.mbapi2020] Can't connect to MB APIs; Retrying in background 2023-01-05 19:12:36.893 WARNING (MainThread) [custom_components.mbapi2020] Can't connect to MB APIs; Retrying in background 2023-01-05 19:12:42.330 ERROR (MainThread) [homeassistant.components.ipp.coordinator] Error fetching ipp data: Invalid response from API: Timeout occurred while connecting to IPP server. 2023-01-05 19:12:43.184 ERROR (MainThread) [homeassistant.components.ipp.coordinator] Error fetching ipp data: Invalid response from API: Timeout occurred while connecting to IPP server.
hi @MarcW22,
the debug log for the MBAPI2020 component was not enabled. Please enable it before sharing the log via email (address: mbapi2020-i98 (at) nulsch . de)
configuration.yaml:
logger: default: warn logs: custom_components.mbapi2020: debug
Same problem with me.
Hi @MathieuWuyts ,
please share some more information. Are you running on the latest version? What is your region. Please enable debug logging and share the log via email (address: mbapi2020-i98 (at) nulsch . de)
You can attach the diagnostic information (HA, integrations, click on the 3 dots of the MB component and download the diagnostic)
Hi @MathieuWuyts ,
I have published a version v0.8.0 and besides the long list of changes, I added a better Error-reporting for your case, when the component log level is set to debug. Could you please check again and share the error message? And please make sure that your MB mobile app is working and that you see the status changes in the app. The problem from MarcW22 was a different one and was solved via mail.
Hey Rene, apologies for the late reply, here is my debug log with 0.8.0:
2023-01-08 23:00:46.450 INFO (MainThread) [custom_components.mbapi2020.client] WSL not detected - running in rlock mode
2023-01-08 23:00:46.450 DEBUG (MainThread) [custom_components.mbapi2020.oauth] Start async_get_cached_token()
2023-01-08 23:00:46.451 DEBUG (MainThread) [custom_components.mbapi2020.oauth] Start async_get_cached_token()
2023-01-08 23:00:47.096 DEBUG (MainThread) [custom_components.mbapi2020] VIN not found in masterdata. Used FIN XXXXXXXXXXX instead.
2023-01-08 23:00:47.096 DEBUG (MainThread) [custom_components.mbapi2020.oauth] Start async_get_cached_token()
2023-01-08 23:00:47.434 DEBUG (MainThread) [custom_components.mbapi2020.oauth] Start async_get_cached_token()
2023-01-08 23:00:47.640 DEBUG (MainThread) [custom_components.mbapi2020.oauth] Start async_get_cached_token()
2023-01-08 23:00:48.066 DEBUG (MainThread) [custom_components.mbapi2020] RCP supported for car XXXXXXXXXXX: True
2023-01-08 23:00:48.066 DEBUG (MainThread) [custom_components.mbapi2020] Init - car added - XXXXXXXXXXXXXXX
2023-01-08 23:00:48.066 DEBUG (MainThread) [custom_components.mbapi2020.client] start update_poll_states
2023-01-08 23:00:48.066 DEBUG (MainThread) [custom_components.mbapi2020.oauth] Start async_get_cached_token()
2023-01-08 23:00:48.410 DEBUG (MainThread) [custom_components.mbapi2020.api] Traceback (most recent call last):
File "/config/custom_components/mbapi2020/api.py", line 84, in _request
2023-01-08 23:00:48.410 DEBUG (MainThread) [custom_components.mbapi2020.oauth] Start async_get_cached_token()
2023-01-08 23:00:48.411 INFO (MainThread) [custom_components.mbapi2020.websocket] Connecting to wss://websocket.emea-prod.mobilesdk.mercedes-benz.com/ws
2023-01-08 23:00:48.553 ERROR (MainThread) [custom_components.mbapi2020.websocket] Could not connect to wss://websocket.emea-prod.mobilesdk.mercedes-benz.com/ws, retry in 10 seconds...
2023-01-08 23:00:48.555 DEBUG (MainThread) [custom_components.mbapi2020.websocket] 403, message='Invalid response status', url=URL('wss://websocket.emea-prod.mobilesdk.mercedes-benz.com/ws')
2023-01-08 23:00:58.556 INFO (MainThread) [custom_components.mbapi2020.websocket] Connecting to wss://websocket.emea-prod.mobilesdk.mercedes-benz.com/ws
2023-01-08 23:00:58.568 ERROR (MainThread) [custom_components.mbapi2020.websocket] Could not connect to wss://websocket.emea-prod.mobilesdk.mercedes-benz.com/ws, retry in 10 seconds...
2023-01-08 23:00:58.569 DEBUG (MainThread) [custom_components.mbapi2020.websocket] 403, message='Invalid response status', url=URL('wss://websocket.emea-prod.mobilesdk.mercedes-benz.com/ws')
2023-01-08 23:01:08.570 INFO (MainThread) [custom_components.mbapi2020.websocket] Connecting to wss://websocket.emea-prod.mobilesdk.mercedes-benz.com/ws
2023-01-08 23:01:08.583 ERROR (MainThread) [custom_components.mbapi2020.websocket] Could not connect to wss://websocket.emea-prod.mobilesdk.mercedes-benz.com/ws, retry in 10 seconds...
2023-01-08 23:01:08.584 DEBUG (MainThread) [custom_components.mbapi2020.websocket] 403, message='Invalid response status', url=URL('wss://websocket.emea-prod.mobilesdk.mercedes-benz.com/ws')
Here are the diagnostics, and cars
entry properly formatted:
{
"home_assistant": {
"installation_type": "Home Assistant OS",
"version": "2023.1.1",
"dev": false,
"hassio": true,
"virtualenv": false,
"python_version": "3.10.7",
"docker": true,
"arch": "x86_64",
"timezone": "Europe/Paris",
"os_name": "Linux",
"os_version": "5.15.80",
"supervisor": "2022.12.1",
"host_os": "Home Assistant OS 9.4",
"docker_version": "20.10.19",
"chassis": "embedded",
"run_as_root": true
},
"custom_components": {
"mbapi2020": {
"version": "0.8.0",
"requirements": [
"protobuf>=3.19.1"
]
}
},
"integration_manifest": {
"domain": "mbapi2020",
"name": "MercedesME 2020",
"config_flow": true,
"documentation": "https://github.com/ReneNulschDE/mbapi2020",
"issue_tracker": "https://github.com/ReneNulschDE/mbapi2020/issues",
"requirements": [
"protobuf>=3.19.1"
],
"dependencies": [],
"codeowners": [
"@ReneNulschDE"
],
"version": "0.8.0",
"iot_class": "cloud_push",
"integration_type": "hub",
"loggers": [
"custom_components.mbapi2020"
],
"is_built_in": false
},
"data": {
"entry": {
"entry_id": "XXXXXXX",
"version": 1,
"domain": "mbapi2020",
"title": "mbapi2020",
"data": {
"username": "**REDACTED**",
"region": "Europe",
"nonce": "XXXXXXXX",
"token": {
"access_token": "**REDACTED**",
"refresh_token": "**REDACTED**",
"token_type": "Bearer",
"expires_in": 7199,
"expires_at": 1673222353
}
},
"options": {},
"pref_disable_new_entities": false,
"pref_disable_polling": false,
"source": "user",
"unique_id": "**REDACTED**",
"disabled_by": null
},
"cars": "...."
}
}
cars
:
[
{
"licenseplate": "XXXXXXXXXXX",
"finorvin": "XXXXXXXXXXX",
"_is_owner": null,
"messages_received": {
"f": 0,
"p": 0
},
"_last_message_received": 1673215248066,
"_last_command_type": "",
"_last_command_state": "",
"_last_command_error_code": "",
"_last_command_error_message": "",
"_last_command_time_stamp": 0,
"binarysensors": null,
"tires": null,
"odometer": null,
"doors": null,
"location": null,
"windows": null,
"features": {
"name": "Features",
"ZEV_PRECONDITION_CONFIGURE": false,
"ZEV_PRECONDITION_CONFIGURE_SEATS": false,
"ZEV_PRECONDITIONING_START": false,
"ZEV_PRECONDITIONING_STOP": false,
"AUXHEAT_CONFIGURE": false,
"AUXHEAT_START": false,
"AUXHEAT_STOP": false,
"BATTERY_CHARGE_PROGRAM_CONFIGURE": false,
"BATTERY_MAX_SOC_CONFIGURE": false,
"CHARGE_OPT_CONFIGURE": false,
"CHARGE_OPT_START": false,
"CHARGE_OPT_STOP": false,
"CHARGE_PROGRAM_CONFIGURE": false,
"DOORS_LOCK": true,
"DOORS_UNLOCK": true,
"ENGINE_START": false,
"ENGINE_STOP": false,
"SUNROOF_OPEN": true,
"SUNROOF_LIFT": true,
"SUNROOF_CLOSE": true,
"SPEEDALERT_START": false,
"SPEEDALERT_STOP": false,
"TEMPERATURE_CONFIGURE": false,
"THEFTALARM_DESELECT_INTERIOR": false,
"THEFTALARM_DESELECT_TOW": false,
"THEFTALARM_SELECT_INTERIOR": false,
"THEFTALARM_SELECT_TOW": false,
"THEFTALARM_START": false,
"THEFTALARM_STOP": false,
"THEFTALARM_CONFIRM_DAMAGEDETECTION": false,
"THEFTALARM_DESELECT_DAMAGEDETECTION": false,
"THEFTALARM_SELECT_DAMAGEDETECTION": false,
"WEEK_PROFILE_CONFIGURE": false,
"WINDOWS_OPEN": true,
"WINDOWS_CLOSE": true,
"WINDOWS_VENTILATE": false,
"WIPER_HEALTH_RESET": false,
"SIGPOS_START": true
},
"rcp_options": {
"name": "RCP_Options",
"rcp_supported": {
"value": true,
"retrievalstatus": "VALID",
"timestamp": 0,
"distance_unit": null,
"display_value": null,
"unit": null
}
},
"auxheat": null,
"precond": null,
"electric": null,
"caralarm": null,
"geofence_events": {
"name": "GeofenceEvents",
"events": []
},
"entry_setup_complete": false,
"_update_listeners": []
}
]
Hi Steve, thanks for the details. So it looks like that the Authentication against the webservices is working fine, just the connection to the websocket does not work. I have never seen this scenario. Could you please check if your mobile app is working? Do you see status changes like doors/windows in the app? Can you open the doors or windows? My component does more or less the same like the app. Do you use any local proxy? BR Rene
EDIT:
Issue seems to be gone now. At least I do not receive further error messages in HA and this quite shortly after below post. Probably it was related to MB side server.
Thanks for your really cool custom integration and hard work.
Hi,
since yesterday evening I've the very same issue. However, controlling or monitoring the car thru HA is still possible. Couldn't yet notice any restrictions related to the error.
`This error originated from a custom integration.
Logger: custom_components.mbapi2020.websocket Source: custom_components/mbapi2020/websocket.py:132 Integration: MercedesME 2020 (documentation, issues) First occurred: January 9, 2023 at 20:07:31 (4061 occurrences) Last logged: 07:26:12
Could not connect to wss://websocket.emea-prod.mobilesdk.mercedes-benz.com/ws, retry in 10 seconds...`
Using latest version of the custom integration on HA 2023.1.1
BR, Stefan
Original problem from Steeve was solved by the MB-Support as the MB-app was not working too. They created a new MBme account at the car dealer.
Hi Rene, I am not using a proxy, and tried changing DNSs multiple times juste in case. The app doesn't report any error either, but I haven't tried using the fonctions as the car doesn't have connectivity at the moment. I am still experiencing connection issues.
Hi,
The component used to work fine, but for some time now, it's failing with the following error:
I have tried deleting/restarting/reauthenticating multiple times, no to avail. When setuping, the vehicle is correctly detected, but no entities are created/found.
Thank you again for this great component!