runDMCA
November 14, 2023, 3:28am
1
Introduction
This is a fork of the Mazda Connected Services integration originally written by bdr99 that has been packaged into a HACS compatible custom integration. The original code was part of the Home Assistant core integrations prior to a DMCA takedown notice issue by Mazda Motor Corporation. It should restore all functionality previously available in the core integration.
Installation
With HACS
Add this repository as a custom repository in HACS
Download the integration.
Restart Home Assistant
Manual
Copy the mazda directory, from custom_components in this repository,
and place it inside your Home Assistant Core installation’s custom_components directory. Restart Home Assistant prior to moving on to the Setup section.
Note: If installing manually, in order to be alerted about new releases, you will need to subscribe to releases from this repository.
Regarding the DMCA
I believe the DMCA takedown notice was issued in bad faith due to the following reasons:
The DMCA refers to the functionality of the code, not the code itself, which is not protected by copyright laws.
The decision by the U.S. Supreme Court in Google LLC v. Oracle America, Inc. set a precedent that copyright protected APIs can be used by third parties under the fair use doctrine.
I have no intention to comply with bad faith lawfare and hope that the continued existence of this integration helps to convince corporations to be more friendly towards developers and their community of users.
11 Likes
Hi.
Had anyone else’s integration failed to initialise within the las 12 hours?
Just wondering if there’s a problem with Mazda Connected Services
I have logged into the Mazda App with my second account and all is working there.
Tried reinitialising the MCS integration and this time I was told to restart HA, which I did, but it’s still failing.
I’m no expert in these things, but the logs suggest either a timeout or a failure to get the vehicle details.
The iPhone App hasn’t updated since 6months ago.
Happy to offer whatever assistance I can.
lehrbad
(Daniel)
November 17, 2024, 7:45pm
3
Same problem for me. Started approximately 36 hours ago. Restarting integration and home assistant didn’t resolve. I have not spent time to review the logs yet.
lehrbad
(Daniel)
November 17, 2024, 8:21pm
4
Looks like this has been reported in github also:
opened 02:15PM - 17 Nov 24 UTC
Integration ran fine for weeks but since yesterday I got:
This error originat… ed from a custom integration.
Logger: custom_components.mazda
Source: custom_components/mazda/__init__.py:154
integration: Mazda Connected Services
First occurred: 3:03:01 PM (9 occurrences)
Last logged: 3:13:03 PM
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 30, in get_vehicles
vec_base_infos_response = await self.controller.get_vec_base_infos()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/mazda/pymazda/controller.py", line 30, in get_vec_base_infos
return 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 690, in _request
await resp.start(conn)
File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 1058, in start
message, payload = await protocol.read() # type: ignore[union-attr]
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/streams.py", line 643, 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 154, in async_update_data
vehicles = await with_timeout(mazda_client.get_vehicles())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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
My log file reflects the same timeout error posted in that bug report.
AdamZ
(Adam)
December 4, 2024, 9:58pm
5
Any luck getting this to work again? Maybe there’s someone at Mazda we can all start reaching out to?
lehrbad
(Daniel)
January 8, 2025, 6:06am
6
Not sure if you already did the same but I just reviewed the latest in github and found my way to the solution. My sensors are working perfectly again!
Direct replacement:
Fork with BEV sensors (if needed for your vehicle):
Instructions to remove old integration and replace:
opened 09:35AM - 04 Jul 24 UTC
Thanks for you work! I really love this integration. No issues so far untill las… t night ... upgraded HA to 2024.7.0 and since then, the integration keeps initializing. Anyone else experiencing the same problem?
2 Likes
Hello, I’ve tried to install but I have “failed to connect” error when I setup the integration. Tried with both custom integrations with the same result… Everything is ok if I login with the Mazda mobile app
My previously working integration is failing. It looks like authentication issues.
I have the same issue. Now after deleting of integration I can nod find it in HACS.
1 Like
check this, I’ll follow the issue on githhub
opened 12:00PM - 12 Mar 25 UTC
Also reported on runDMCA version, found here https://github.com/runDMCA/home-ass… istant-mazda/issues/5#issuecomment-2717521221
Just reporting on here in case it is a code change that will get this working again?
Errors in log show:
```
Logger: homeassistant.config_entries
Source: config_entries.py:753
First occurred: 7:59:42 am (2 occurrences)
Last logged: 12:01:34 pm
Error setting up entry [email protected] for mazda_cs
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 753, in __async_setup_with_context
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/mazda_cs/__init__.py", line 72, in async_setup_entry
await mazda_client.validate_credentials()
File "/config/custom_components/mazda_cs/pymazda/client.py", line 24, in validate_credentials
await self.controller.login()
File "/config/custom_components/mazda_cs/pymazda/controller.py", line 12, in login
await self.connection.login()
File "/config/custom_components/mazda_cs/pymazda/connection.py", line 447, in login
encryption_key_response_json = await encryption_key_response.json()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/aiohttp_client.py", line 83, in json
return await super().json(*args, loads=loads, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/aiohttp/client_reqrep.py", line 1281, in json
raise ContentTypeError(
...<7 lines>...
)
aiohttp.client_exceptions.ContentTypeError: 403, message='Attempt to decode JSON with unexpected mimetype: text/html', url='https://rz97suam.mazda.com/appapi/v1/system/encryptionKey?appId=MazdaApp&locale=en-US&deviceId=XXXXXXXXXX&sdkVersion=11.3.0700.001'
```
kalmma
June 20, 2025, 6:09pm
11
I have been struggling with the Mazda integration for a long time and have also had it working for a separate docker and MQTT but there is always something.
Just tried this hacs integration again and it works in succession.
Let’s see how long it will last but I am already happy again
Tom_Ka
(Tom)
August 29, 2025, 8:04pm
12
I have tested this version from fano0001 today and it WORKED with my Mazda cx-60!!!
Big THX
Danaway
(Danick Tremblay)
October 22, 2025, 6:54pm
13
Hello! I would like to reuse the Mazda integration. Could you please tell me the basics of the configuration? Is there an easier link to follow for installation? Thank you in advance!
Anyone seeing these issues, started today for me - 25/11/25
This error originated from a custom integration.
Logger: custom_components.mazda_cs
Source: custom_components/mazda_cs/init .py:154
integration: Mazda Connected Services ng (documentation, issues)
First occurred: 12:21:59 (11 occurrences)
Last logged: 12:31:53
Unknown error occurred during Mazda update request: Request failed: An update to Mazda app is required to continue
Traceback (most recent call last):
File “/config/custom_components/mazda_cs/init .py”, line 154, in async_update_data
vehicles = await with_timeout(mazda_client.get_vehicles())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/config/custom_components/mazda_cs/init .py”, line 57, in with_timeout
return await task
^^^^^^^^^^
File “/config/custom_components/mazda_cs/pymazda/client.py”, line 30, in get_vehicles
vec_base_infos_response = await self.controller.get_vec_base_infos()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/config/custom_components/mazda_cs/pymazda/controller.py”, line 30, in get_vec_base_infos
return await self.connection.api_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
…<5 lines>…
)
^
File “/config/custom_components/mazda_cs/pymazda/connection.py”, line 213, in api_request
return await self.__api_request_retry(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
method, uri, query_dict, body_dict, needs_keys, needs_auth, num_retries=0
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File “/config/custom_components/mazda_cs/pymazda/connection.py”, line 243, in __api_request_retry
return await self.__send_api_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
method, uri, query_dict, body_dict, needs_keys, needs_auth
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File “/config/custom_components/mazda_cs/pymazda/connection.py”, line 390, in __send_api_request
raise MazdaException("Request failed: " + response_json[“error”])
custom_components.mazda_cs.pymazda.exceptions.MazdaException: Request failed: An update to Mazda app is required to continue
zlakes01
(Zlakes01)
November 25, 2025, 12:53pm
15
I’ve got this message: Failed setup, will retry: Request failed: An update to Mazda app is required to continue