core: August integration can no longer access account after migrating to Yale Home app for devices outside of North America

The problem

Until now the August integration could be used to control the Yale locks, however after switching to their new app, the integration now gets the error: Failed to call service lock/lock. Garage Door: The operation failed with error code 401: Unauthorized

From system log:

Logger: homeassistant.components.websocket_api.http.connection
Source: components/august/__init__.py:398
Integration: Home Assistant WebSocket API ([documentation](https://www.home-assistant.io/integrations/websocket_api), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+websocket_api%22))
First occurred: 2:51:14 PM (9 occurrences)
Last logged: 3:19:15 PM

[281472364985120] Garage Door: The operation failed with error code 401: Unauthorized.
[281472141605136] Garage Door: The operation failed with error code 401: Unauthorized.
[281472275691600] Front Door: The operation failed with error code 401: Unauthorized.
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/yalexs/api_async.py", line 327, in _raise_response_exceptions
    response.raise_for_status()
  File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1005, in raise_for_status
    raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 401, message='Unauthorized', url=URL('https://api-production.august.com/remoteoperate/A5F7B5C084DF4545BDA4DB5E156F8445/lock?v=2.3.1&type=async&connection=persistent')

Email from Yale is:

Dear Yale Access User, –   The new Yale Home app has arrived! As part of our ongoing mission to provide our customers with the highest possible standard of technology and service, our new Yale Home app will grant you a more connected Yale ecosystem of smart devices, all easily controlled using one intuitive app. With the Yale Home app, you can continue to experience all of the control, convenience, and security our current Yale smart security devices have to offer, as well as any of our exciting upcoming devices, all from the palm of your hand using your smartphone.   To ensure the continued smooth running of your Yale smart security devices, and the continued use of services like access sharing, access logs, integrations with other smart devices, and more you must now move your existing Yale account over to our new app.   To do this simply download the Yale Home app and log in with the existing details you currently use to log into your Yale Access app.   https://www.yalehome.com/global/en/trusted-innovation/yale-apps/download-yale-home   With the new app, there’s no need to create a new account or set up your product again, once you have logged in you will be good to go!   Once you have moved your account, all other users associated with the account will also be asked to use the new app. Failure to switch over to the new app will result in any other users being locked out of their accounts.   If you had a third-party integration (Google Home / Amazon Alexa / Philips Hue smart lighting, etc), enabled in your Yale Access app, then this integration will require a new setup in the Yale Home app or the third-party app to continue to use this service. Please head to our website to learn more about the status of each integration, when they will be launched, and linking third-party integrations. (https://www.yalehome.com/nz/en/stories/news/introducing-the-new-yale-home-app )   You have until June 30th 2023 to move to the new app. Any accounts that fail to make the switch before this date will be locked out of the old Yale Access app, and unable to use or control their device via the APP until they download our new app.   For more information please have a look at our website: https://www.yalehome.com/nz/en/stories/news/introducing-the-new-yale-home-app   Thank you for your continued support and trust in Yale products.   Regards, The Yale Team

As an aside: The Yale Access Bluetooth integration is not usable due to the lack of bluetooth in the HAOS here, despite ESP32Home running with bluetooth proxy enabled.

What version of Home Assistant Core has the issue?

2023.5.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

August

Link to integration documentation on our website

https://www.home-assistant.io/integrations/august

Diagnostics information

config_entry-august-1065d8d039542bb726fa4a9ddc8a48e0.json.txt

home-assistant_august_2023-05-17T03-29-49.258Z.log

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2023-05-17 15:29:34.214 DEBUG (MainThread) [yalexs.api_async] About to call https://api-production.august.com/remoteoperate/E44E50D1E0764627BE10661A0F246B23/lock?v=2.3.1&type=async&connection=persistent with header={'Accept-Version': '0.0.1', 'x-august-api-key': '7cab4bbd-2693-4fc1-b99b-dec0fb20f9d4', 'Content-Type': 'application/json; charset=UTF-8', 'User-Agent': 'August/Luna-22.17.0 (Android; SDK 31; gphone64_arm64)', 'x-august-branding': 'august', 'x-august-country': 'US', 'x-august-access-token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpbnN0YWxsSWQiOiI0YzljZDM0ZS00OGQ4LTRmYzQtOWVkOC1iM2RmM2UzODExNTIiLCJyZWdpb24iOiIiLCJhcHBsaWNhdGlvbklkIjoiIiwidXNlcklkIjoiYzk1NjA0ZDQtNGY2OS00ZTAyLTgxMmMtMmNhMjRiMDQ3OTZiIiwidkluc3RhbGxJZCI6dHJ1ZSwidlBhc3N3b3JkIjp0cnVlLCJ2RW1haWwiOmZhbHNlLCJ2UGhvbmUiOmZhbHNlLCJoYXNJbnN0YWxsSWQiOnRydWUsImhhc1Bhc3N3b3JkIjp0cnVlLCJoYXNFbWFpbCI6dHJ1ZSwiaGFzUGhvbmUiOnRydWUsImlzTG9ja2VkT3V0IjpmYWxzZSwiY2FwdGNoYSI6IiIsImVtYWlsIjpbXSwicGhvbmUiOltdLCJleHBpcmVzQXQiOiIyMDIzLTA3LTIzVDA3OjUyOjE5LjcwMFoiLCJ0ZW1wb3JhcnlBY2NvdW50Q3JlYXRpb25QYXNzd29yZExpbmsiOiIiLCJpYXQiOjE2NjAyMDQzMzIsImV4cCI6MTY5MDA5ODczOSwiTGFzdE5hbWUiOiJNdW5ybyIsIkZpcnN0TmFtZSI6IkpvaG4ifQ.NFBKHLnIfCYBWejELZYhEqhDUk4yGYvZDwfnJgAEnPE'} and payload=None
2023-05-17 15:29:34.713 DEBUG (MainThread) [yalexs.api_async] Received API response from url: https://api-production.august.com/remoteoperate/E44E50D1E0764627BE10661A0F246B23/lock?v=2.3.1&type=async&connection=persistent, code: 401, headers: <CIMultiDictProxy('Date': 'Wed, 17 May 2023 03:29:34 GMT', 'Content-Type': 'application/json', 'Content-Length': '71', 'Connection': 'keep-alive', 'Vary': 'origin,access-control-request-method,access-control-request-headers', 'Content-Security-Policy': "default-src 'self';base-uri 'self';block-all-mixed-content;font-src 'self' https: data:;frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests", 'X-DNS-Prefetch-Control': 'off', 'Expect-CT': 'max-age=0', 'X-Frame-Options': 'SAMEORIGIN', 'Strict-Transport-Security': 'max-age=15552000; includeSubDomains', 'X-Download-Options': 'noopen', 'X-Content-Type-Options': 'nosniff', 'X-Permitted-Cross-Domain-Policies': 'none', 'Referrer-Policy': 'no-referrer', 'X-XSS-Protection': '0', 'api-version': '0.0.1', 'x-response-time': '18', 'CF-Cache-Status': 'DYNAMIC', 'Server': 'cloudflare', 'CF-RAY': '7c88c6ddac15a835-SYD')>, content: b'{"code":"InvalidCredentials","message":"access token - user migrtated"}'
2023-05-17 15:29:34.713 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [281472275691600] Front Door: The operation failed with error code 401: Unauthorized.
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/yalexs/api_async.py", line 327, in _raise_response_exceptions
    response.raise_for_status()
  File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1005, in raise_for_status
    raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 401, message='Unauthorized', url=URL('https://api-production.august.com/remoteoperate/E44E50D1E0764627BE10661A0F246B23/lock?v=2.3.1&type=async&connection=persistent')

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

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/august/__init__.py", line 393, in _async_call_api_op_requires_bridge
    ret = await func(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/yalexs/api_async.py", line 193, in async_lock_async
    return await self._async_call_async_lock_operation(
  File "/usr/local/lib/python3.10/site-packages/yalexs/api_async.py", line 169, in _async_call_async_lock_operation
    response = await self._async_dict_to_api(
  File "/usr/local/lib/python3.10/site-packages/yalexs/api_async.py", line 320, in _async_dict_to_api
    _raise_response_exceptions(response)
  File "/usr/local/lib/python3.10/site-packages/yalexs/api_async.py", line 341, in _raise_response_exceptions
    raise AugustApiAIOHTTPError(
yalexs.exceptions.AugustApiAIOHTTPError: The operation failed with error code 401: Unauthorized.

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

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 199, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1849, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1889, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 226, in handle_service
    await service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 798, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 980, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 838, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/lock/__init__.py", line 96, in _async_lock
    await entity.async_lock(**remove_entity_service_fields(service_call))
  File "/usr/src/homeassistant/homeassistant/components/august/lock.py", line 51, in async_lock
    await self._data.async_lock_async(self._device_id, self._hyper_bridge)
  File "/usr/src/homeassistant/homeassistant/components/august/__init__.py", line 360, in async_lock_async
    return await self._async_call_api_op_requires_bridge(
  File "/usr/src/homeassistant/homeassistant/components/august/__init__.py", line 398, in _async_call_api_op_requires_bridge
    raise HomeAssistantError(f"{device_name}: {err}") from err
homeassistant.exceptions.HomeAssistantError: Front Door: The operation failed with error code 401: Unauthorized.
2023-05-17 15:29:35.560 DEBUG (MainThread) [homeassistant.components.august.activity] Skipping update because pubnub is connected
2023-05-17 15:29:45.561 DEBUG (MainThread) [homeassistant.components.august.activity] Skipping update because pubnub is connected

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 7
  • Comments: 116 (22 by maintainers)

Most upvoted comments

The pr should be testable with the following. You must be on Home Assistant 2023.5.3 or later

cd /config
curl -o- -sSL https://gist.githubusercontent.com/bdraco/43f8043cb04b9838383fd71353e99b18/raw/core_integration_pr | bash /dev/stdin -d august -p 93214

Dang, I migrated before seeing the notice and now I can’t access my Yale Doorman L3 from HA anymore. And it seems I can’t reverse it and go back to the Yale Access app.

I am making progress unraveling what has changed. There will need to be config flow changes, library changes, and reauth changes to make it work again. It will probably take a few days to put that all tougher. Than I’ll need testers since I am in North America and not personally affected by the change.

Worth noting that HomeAssistant still tracks entity changes for the integration(door locked/unlocked, door open etc)

But isn’t that from the bluetooth integration? hence the “ble”…

“ble” in log is Norwegian word meaning “became” in this case.

I have also migrated to new Yale Home app before I have read warning and have lost access to lock through HA.

I live in Norway and I’m ready to help to test new integration / solution if needed.

BTW - Yale Doorman L3 was marked as unsupported device but everything worked perfectly with integration until now of course.

This one is unsupported because there is no code owner to maintain it in a region where the lock is released so any change we make could break it in the future.

Delete the custom component

rm -rf /config/custom_components/august

restart

@NStelian it’s all written in this patch:

info "NOTE: If the PR changed anything outside of it´s own folder this method will not work."
info "If you want to remove this, you need to delete the ${current_dir}/custom_components/${domain} folder"```

Additional update for handling transient failures. Same install process: https://github.com/home-assistant/core/issues/93195#issuecomment-1551970249

If you tried to test with the above, please run it again and restart again. There have been new changes

Been able login successfully (Yale Home) and unlock / lock door through HA.

@toredash Can you reach out to me on discord. I’m bdraco#6479

Testing has proven a bit difficult as the all my bridges went offline about 30 minutes ago, and it looks like their North American servers are having an outage.

It’s probably worth stating that the migration is mandatory (at least here in the UK) by the end of June. So, the expedient of delaying migration is only a temporary reprieve. Hopefully that’ll be enough time to get the integration working with the new app.