runDMCA / home-assistant-mazda

Custom component for Home Assistant that adds integration for Mazda Connected Services
Apache License 2.0
64 stars 30 forks source link

Issue with HA 2024.7 #5

Open DiVrox opened 5 months ago

DiVrox commented 5 months ago

Thanks for you work! I really love this integration. No issues so far untill last night ... upgraded HA to 2024.7.0 and since then, the integration keeps initializing. Anyone else experiencing the same problem?

MartinAirN commented 4 months ago

Maybe we need to take a step back here, remove HA from the equation --- has anyone been able to successfully return data using the pymazda module independently of home assistant?

The pymazda code is working --- this looks to be a HA issue ?

I'm still leaning towards the defaults having changed. Currently thinking of how to fix them to what they where before.

crash0verride11 commented 4 months ago

I'm still leaning towards the defaults having changed. Currently thinking of how to fix them to what they where before.

I think it's firmly in the something changed on HA, if the integration still works below 2024.7. The open question, to me, is whether something changed in HA to break the HA requests, or something changed in HA that causes Mazda's servers to purposefully timeout the Mazda requests.

To that end, I am curious if anyone else has had a similar experience to me, where I can intermittently run the integration on 2024.7. The comments here read like it's not working at all. For me, if I hit reload integration enough times, it will eventually connect and load, but subsequent polling updates also very frequently timeout. So the integration is effectively useless for control as entities are so frequently unavailable, but entities are still available enough that my statistics populate with gaps in the data ranging from ever other 7 minutes, to every few hours.

guba91 commented 4 months ago

I'm still leaning towards the defaults having changed. Currently thinking of how to fix them to what they where before.

I think it's firmly in the something changed on HA, if the integration still works below 2024.7. The open question, to me, is whether something changed in HA to break the HA requests, or something changed in HA that causes Mazda's servers to purposefully timeout the Mazda requests.

To that end, I am curious if anyone else has had a similar experience to me, where I can intermittently run the integration on 2024.7. The comments here read like it's not working at all. For me, if I hit reload integration enough times, it will eventually connect and load, but subsequent polling updates also very frequently timeout. So the integration is effectively useless for control as entities are so frequently unavailable, but entities are still available enough that my statistics populate with gaps in the data ranging from ever other 7 minutes, to every few hours.

I'm on 2024.7 and it's working. Not using the car a lot, today not moved so the data is still the same as this morning. Btw the integration is not in error. I'm not sure that mazda ment his app to be used with real time data.. Even with the app if i press update i have to wait the new value. The gps of the car is shown only when the car is Parker, not when moving..

Btw If you need for me to run some tests just let me know what and how

Thanks!

Update: just pressed like 10 time the update button and integration is now unavailable Maybe mazda server are just cutting down when more than X Request by minute?

americalexander commented 4 months ago

@crash0verride11 I can confirm I'm having intermittent successful updates, but they're sporadic. I haven't found any identifiable pattern in when the updates are successful

guba91 commented 4 months ago

Logger: homeassistant.components.websocket_api.http.connection Source: components/websocket_api/commands.py:241 integration: Home Assistant WebSocket API (documentation, issues) First occurred: 01:37:50 (39 occurrences) Last logged: 01:38:54

[140392353039120] Unexpected exception Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 241, in handle_call_service response = await hass.services.async_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2741, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2784, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 977, in entity_service_call single_response = await _handle_entity_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1049, in _handle_entity_call result = await task ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/button/init.py", line 134, in _async_press_action await self.async_press() File "/config/custom_components/mazda/button.py", line 147, in async_press await self.entity_description.async_press( File "/config/custom_components/mazda/button.py", line 57, in handle_refresh_vehicle_status await handle_button_press(client, key, vehicle_id, coordinator) File "/config/custom_components/mazda/button.py", line 38, in handle_button_press await api_method(vehicle_id) File "/config/custom_components/mazda/pymazda/client.py", line 328, in refresh_vehicle_status await self.controller.refresh_vehicle_status(vehicle_id) File "/config/custom_components/mazda/pymazda/controller.py", line 389, in refresh_vehicle_status response = await self.connection.api_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/mazda/pymazda/connection.py", line 191, in api_request return await self.api_request_retry( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/mazda/pymazda/connection.py", line 221, in api_request_retry return await self.send_api_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/mazda/pymazda/connection.py", line 329, in send_api_request response = await self._session.request( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 608, in _request await resp.start(conn) File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 971, in start with self._timer: File "/usr/local/lib/python3.12/site-packages/aiohttp/helpers.py", line 735, in exit raise asyncio.TimeoutError from None TimeoutError

SethCalkins commented 4 months ago

mine is suddenly working ... anyone else?

americalexander commented 4 months ago

@SethCalkins yep, same here. No clue what caused the change though

Juanig commented 4 months ago

So we can upgrade??

formiification commented 4 months ago

Mine also started working again. That's weird

ilwalti commented 4 months ago

Yes, really weird. But ir works.

DiVrox commented 4 months ago

I can confirm it suddenly started working again in 2024.7.4 ... but a few minutes ago it stopped working again and now it's oke again. Really weird.

deherw commented 4 months ago

Wonderful!! It is indeed working again! Thanks everyone for all the work and thinking to get it fixed. ;-)

DiVrox commented 4 months ago

It's great it works again/for now, but still curious .... what fixed it?

Imnotme1009 commented 4 months ago

Mine also seems to be working again: Core 2024.7.4 Supervisor 2024.06.2 Operating System 12.4 Frontend 20240710.0

DiVrox commented 3 months ago

Did anyone try 2024.8.0?

Juanig commented 3 months ago

Did anyone try 2024.8.0?

Yes, It works

fano0001 commented 3 months ago

Works for me too

DiVrox commented 3 months ago

Perfect!

Still curious what made it work again

Valdorama commented 3 months ago

I got the 60-day notice for the end of the 3-yr trial period for Mazda Connected Services. I'm assuming this will no longer work for me once the trial ends. Has anyone else's trial period finished and can confirm that this stops working (unless you pay up...)?

holysoles commented 3 months ago

@Valdorama I saw this in one of the FB groups, seems like certain features are at risk rather than the entirety of connected services

454726216_10161657120692866_2124929838451700847_n

guba91 commented 3 months ago

I have a 2022 mx-30 and I'm in the EU, mazda connected service is included with the car, no nerd to Pay extra. But still with 2024.7 HA stopped working, so i don't think it s a €€€ problem

Juanig commented 3 months ago

I have a 2022 mx-30 and I'm in the EU, mazda connected service is included with the car, no nerd to Pay extra. But still with 2024.7 HA stopped working, so i don't think it s a €€€ problem

Mx-30 2021 in Spain and working fine!

ghammer80 commented 3 months ago

Mine just stopped working again this morning. On 2024.7.4

ilwalti commented 3 months ago

Unfortunately, so did mine, in the afternoon... :(

This is the traceback:

This error originated from a custom integration.


Logger: custom_components.mazda
Source: custom_components/mazda/__init__.py:159
integration: Mazda Connected Services
First occurred: 15:08:19 (111 occurrences)
Last logged: 22:28:19

Unknown error occurred during Mazda update request:
Traceback (most recent call last):
  File "/config/custom_components/mazda/__init__.py", line 57, in with_timeout
    return await task
           ^^^^^^^^^^
  File "/config/custom_components/mazda/pymazda/client.py", line 97, in get_vehicle_status
    vehicle_status_response = await self.controller.get_vehicle_status(vehicle_id)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/mazda/pymazda/controller.py", line 46, in get_vehicle_status
    response = await self.connection.api_request(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/mazda/pymazda/connection.py", line 191, in api_request
    return await self.__api_request_retry(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/mazda/pymazda/connection.py", line 221, in __api_request_retry
    return await self.__send_api_request(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/mazda/pymazda/connection.py", line 329, in __send_api_request
    response = await self._session.request(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 608, in _request
    await resp.start(conn)
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 976, in start
    message, payload = await protocol.read()  # type: ignore[union-attr]
                       ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/streams.py", line 640, in read
    await self._waiter
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/config/custom_components/mazda/__init__.py", line 159, in async_update_data
    vehicle["status"] = await with_timeout(
                        ^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/mazda/__init__.py", line 56, in with_timeout
    async with asyncio.timeout(timeout_seconds):
  File "/usr/local/lib/python3.12/asyncio/timeouts.py", line 115, in __aexit__
    raise TimeoutError from exc_val
TimeoutError

Core 2024.7.4 Supervisor 2024.08.0 Operating System 13.0 Frontend 20240710.0

formiification commented 3 months ago

Same story here. Died just after I upgraded mine to 2024.8

Juanig commented 3 months ago

But the official app is not working either

ilwalti commented 3 months ago

Nope, the app is working fine (Italy)

townsmcp commented 3 months ago

Mazda app is stuffed here in the UK plus multiple reports on Facebook UK CX-60 group

formiification commented 3 months ago

Official app is also working fine here in Poland

Juanig commented 3 months ago

For me the official app is not working (Spain)

DiVrox commented 3 months ago

Stop working here too on 2024.8.1

Mazda App itself is also dead in the Netherlands

guba91 commented 3 months ago

2024.6.4 in italy still working

SethCalkins commented 3 months ago

Official App in USA is not working either.

Oddyrolly commented 3 months ago

În RO don’t worked yesterday, în that morning start again official app, but in HA after upgrading at 2024.8.1, stopped working again

3deeee commented 3 months ago

The official Mazda App in Germany is not working either, no update from my CX-60 since 14th of August.

For now the issue must be related to Mazda Servers, not to this Integration nor Home Assistant.

Oddyrolly commented 3 months ago

În RO factory app is working again, but in HA don't....

townsmcp commented 3 months ago

Official Mazda app working again in the UK. HA 2024.8.1 integration NOT working HA 2024.6.4 integration IS working

SethCalkins commented 3 months ago

Official Mazda app working again in the UK. HA 2024.8.1 integration NOT working HA 2024.6.4 integration IS working

Yeah same here -- issue appears to back ugh.

Juanig commented 3 months ago

Someone tried at 2024.8.0?

Hielyr commented 3 months ago

Someone tried at 2024.8.0?

I'm on : Core 2024.7.4 Supervisor 2024.08.0 Operating System 12.4 Frontend 20240710.0

And it's not working for me. The official Mazda app wasn't working for me yesterday, but it is today, but it's very slow to load compared to how it usually is.

townsmcp commented 3 months ago

App seems to be down again :( Last update in the app for me was 9:48am GMT. I have tried refreshing the app a few times but no updated data comes through

MartinAirN commented 3 months ago

During the App downtime there seems to have been DNS issues, noticed both HA and my phone doing requests that were not awnsered.

Now sadly we are back to being down only on the HA side.

Imnotme1009 commented 3 months ago

I'm on: Core 2024.8.1 Supervisor 2024.08.0 Operating System 12.4 Frontend 20240809.0

Located in Germany and stopped working for me too, my Mazda app has been working fine non stop.

Juanig commented 3 months ago

I've downgraded to 2024.6.4 and the integration is working again. I hope magic will make it work again at newer versions but for me is important to have it working now

guba91 commented 3 months ago

HA version 2024.8.2: still not working homeassistant | 2024-08-19 15:51:22.824 ERROR (MainThread) [custom_components.mazda] Unknown error occurred during Mazda update request: homeassistant | Traceback (most recent call last): homeassistant | File "/config/custom_components/mazda/init.py", line 57, in with_timeout homeassistant | return await task homeassistant | ^^^^^^^^^^ homeassistant | File "/config/custom_components/mazda/pymazda/client.py", line 30, in get_vehicles homeassistant | vec_base_infos_response = await self.controller.get_vec_base_infos() homeassistant | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ homeassistant | File "/config/custom_components/mazda/pymazda/controller.py", line 30, in get_vec_base_infos homeassistant | return await self.connection.api_request( homeassistant | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ homeassistant | File "/config/custom_components/mazda/pymazda/connection.py", line 191, in api_request homeassistant | return await self.api_request_retry( homeassistant | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ homeassistant | File "/config/custom_components/mazda/pymazda/connection.py", line 221, in api_request_retry homeassistant | return await self.send_api_request( homeassistant | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ homeassistant | File "/config/custom_components/mazda/pymazda/connection.py", line 329, in send_api_request homeassistant | response = await self._session.request( homeassistant | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ homeassistant | File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 684, in _request homeassistant | await resp.start(conn) homeassistant | File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 999, in start homeassistant | message, payload = await protocol.read() # type: ignore[union-attr] homeassistant | ^^^^^^^^^^^^^^^^^^^^^ homeassistant | File "/usr/local/lib/python3.12/site-packages/aiohttp/streams.py", line 640, in read homeassistant | await self._waiter homeassistant | asyncio.exceptions.CancelledError homeassistant | homeassistant | The above exception was the direct cause of the following exception: homeassistant | homeassistant | Traceback (most recent call last): homeassistant | File "/config/custom_components/mazda/init.py", line 154, in async_update_data homeassistant | vehicles = await with_timeout(mazda_client.get_vehicles()) homeassistant | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ homeassistant | File "/config/custom_components/mazda/init.py", line 56, in with_timeout homeassistant | async with asyncio.timeout(timeout_seconds): homeassistant | File "/usr/local/lib/python3.12/asyncio/timeouts.py", line 115, in aexit homeassistant | raise TimeoutError from exc_val homeassistant | TimeoutError

DiVrox commented 3 months ago

Anyone any idea what causes the problem? It worked on 2024.7 and above. Why did it stop again en why does it work on 2024.6?

guba91 commented 3 months ago

image

guba91 commented 3 months ago

tried to revert one lib by one, but get this error.. image

and after reverting all library to older version, ha don't even start hahaha

AndreasBroager commented 3 months ago

Who, at Mazda, should I write to, to show that I don't like the Mazda-HA takedown? Or to formulate it, in a more positive way, I would looove to see an official 3rd party/HA support..

nosar77 commented 3 months ago

I have been trying to troubleshoot the issue, there seems to have been a change with aiohttp timeout I believe between the updates that has seemed to cause it to stop working. I have limited python experience and limited HA integration experience. Im trying to fix it but so far it seems the API doesnt like the changes ive made and since the API is rate limited I cannot try a bunch of times. The developer really needs to chime in hopefully they havent abandoned the project.