Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Comments

Fix: use cloudhook URL instead of cloud URL for integration requests#6197

Merged
TimoPtr merged 1 commit intohome-assistant:mainfrom
jpelgrom:fix-cloudhook
Dec 25, 2025
Merged

Fix: use cloudhook URL instead of cloud URL for integration requests#6197
TimoPtr merged 1 commit intohome-assistant:mainfrom
jpelgrom:fix-cloudhook

Conversation

@jpelgrom
Copy link
Member

Summary

Fixes #6194

When getting logs with a debug build, the issue is obvious: it is trying to use the UI cloud URL instead of the cloudhook URL for integration (webhook) requests. This PR adjusts the getApiUrls function, which is only used for integration requests, to return the cloudhook URL instead of cloud URL.

Tests have been adjusted to a server which still has a cloud URL so this mistake is caught if reverted in the future. Realistically a server with cloud will also have a cloudhook.

2025-12-25 09:09:02.839 15966-16045 OkHttp                  io....stant.companion.android.debug  I  --> POST https://secretletters.ui.nabu.casa/
2025-12-25 09:09:02.839 15966-16045 OkHttp                  io....stant.companion.android.debug  I  Content-Type: application/json; charset=UTF-8
2025-12-25 09:09:02.839 15966-16045 OkHttp                  io....stant.companion.android.debug  I  Content-Length: 216
2025-12-25 09:09:02.839 15966-16045 OkHttp                  io....stant.companion.android.debug  I  
2025-12-25 09:09:02.840 15966-16045 OkHttp                  io....stant.companion.android.debug  I  {"type":"update_registration","data":{"app_version":"2025.12.4-SNAPSHOT-full (1)","device_name":"Pixel 7a dev","manufacturer":"Google","model":"Pixel 7a","os_version":"36","app_data":{"push_websocket_channel":true}}}
2025-12-25 09:09:02.840 15966-16045 OkHttp                  io....stant.companion.android.debug  I  --> END POST (216-byte body)
(...)
2025-12-25 09:09:03.081 15966-16045 OkHttp                  io....stant.companion.android.debug  I  <-- 405 Method Not Allowed https://secretletters.ui.nabu.casa/ (241ms)
2025-12-25 09:09:03.081 15966-16045 OkHttp                  io....stant.companion.android.debug  I  Content-Type: text/plain; charset=utf-8
2025-12-25 09:09:03.081 15966-16045 OkHttp                  io....stant.companion.android.debug  I  Allow: GET
2025-12-25 09:09:03.081 15966-16045 OkHttp                  io....stant.companion.android.debug  I  Referrer-Policy: no-referrer
2025-12-25 09:09:03.081 15966-16045 OkHttp                  io....stant.companion.android.debug  I  X-Content-Type-Options: nosniff
2025-12-25 09:09:03.081 15966-16045 OkHttp                  io....stant.companion.android.debug  I  Server: 
2025-12-25 09:09:03.081 15966-16045 OkHttp                  io....stant.companion.android.debug  I  X-Frame-Options: SAMEORIGIN
2025-12-25 09:09:03.081 15966-16045 OkHttp                  io....stant.companion.android.debug  I  Content-Length: 23
2025-12-25 09:09:03.081 15966-16045 OkHttp                  io....stant.companion.android.debug  I  Date: Thu, 25 Dec 2025 08:09:02 GMT
2025-12-25 09:09:03.082 15966-16045 OkHttp                  io....stant.companion.android.debug  I  
2025-12-25 09:09:03.082 15966-16045 OkHttp                  io....stant.companion.android.debug  I  405: Method Not Allowed
2025-12-25 09:09:03.082 15966-16045 OkHttp                  io....stant.companion.android.debug  I  <-- END HTTP (241ms, 23-byte body)

Checklist

  • New or updated tests have been added to cover the changes following the testing guidelines.
  • The code follows the project's code style and best_practices.
  • The changes have been thoroughly tested, and edge cases have been considered.
  • Changes are backward compatible whenever feasible. Any breaking changes are documented in the changelog for users and/or in the code for developers depending on the relevance.

Screenshots

n/a

Link to pull request in documentation repositories

n/a

Any other notes

@jpelgrom jpelgrom changed the title Fix: use cloudhook url instead of cloud URL for integration requests Fix: use cloudhook URL instead of cloud URL for integration requests Dec 25, 2025
@jpelgrom jpelgrom requested a review from TimoPtr December 25, 2025 08:30
Copy link
Member

@TimoPtr TimoPtr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking the time to look at the issue 🙏

@TimoPtr TimoPtr enabled auto-merge (squash) December 25, 2025 09:08
@TimoPtr TimoPtr merged commit 9b5c487 into home-assistant:main Dec 25, 2025
18 checks passed
@jpelgrom jpelgrom deleted the fix-cloudhook branch December 25, 2025 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Companion app sensors stopped updating when not connected to home Wi-Fi (405 method not allowed)

2 participants