You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A Discord tester reported MyUplink auth fails during startup:
MyUplink: token request failed: HTTP 400: {"error":"invalid_client","error_description":"check authorization server configuration","code":"invalid_client","description":"check authorization server configuration"}
The current Lua driver posts directly to https://api.myuplink.com/oauth/token with grant_type=client_credentials, client_id, client_secret, and scopes READSYSTEM WRITESYSTEM.
The tester reports that the MyUplink developer web portal does not expose a client_credentials app type or selectable READSYSTEM / WRITESYSTEM scopes. The iOS app also does not list a forty-two-watts client, which is expected because this should be a web developer portal app, not an iOS app.
Current dev.myuplink.com frontend bundle references Azure B2C authorization-code/PKCE flow and scopes in the form .../api/READSYSTEM .../api/WRITESYSTEM; it does not contain client_credentials.
No existing GitHub issue found for myuplink oauth invalid_client client_credentials.
Expected Behavior
The driver setup docs and implementation should match the auth flow available to a normal MyUplink developer portal app, or clearly state that the driver requires a special app/API capability.
Actual Behavior
A normal-looking portal client produces invalid_client at token request time, before any device polling starts.
Proposed Direction
Investigate whether MyUplink API v2 now requires authorization-code + refresh-token flow for user-owned systems. If so, replace or supplement the driver auth with a setup flow that obtains and stores a refresh token, then uses refresh-token grants at runtime.
Environment
Component: drivers/myuplink.lua
Verification status: experimental driver
Reporter: Discord Göran Andersson in #troubleshooting
Additional Discord evidence: reporter shared a screenshot of the MyUplink developer portal app edit screen. It exposes Application Name, Description, Callback Url, Client Identifier, Client Secret, and Create new client secret/Save/Remove buttons. No visible grant-type selector or explicit scope selector is present on that screen. Secret was masked in the screenshot.
Confirmed: MyUplink's developer portal only issues authorization-code apps (Callback URL + Client Identifier + Client Secret, on Azure B2C). The client_credentials grant the driver used is not offered for these apps, so it fails with invalid_client at the token request — before the callback is ever involved. This matches reference integrations (Home Assistant myuplink, MarshFlattsFarm's NIBE scripts), which all use authorization_code + offline_access → refresh_token.
Correction on the earlier troubleshooting advice: the driver has no mode field. The mode: hotwater | heating suggestion was wrong — myuplink.lua is read-only telemetry for one physical pump (compressor power + hot-water/indoor/outdoor temps) and does not split into hot-water/heating instances. Apologies for the noise.
The driver now uses grant_type=refresh_token at runtime; rotated tokens are persisted (new host.persist_secret capability) so they survive restarts.
A one-time in-app consent (Settings → Devices → Connect to MyUplink) handles the browser sign-in — no hand-pasting tokens. The UI shows the exact Callback URL to register in the portal.
Bonus: a Heat pump dashboard card now surfaces the hp_* telemetry.
Setup guide: docs/myuplink-oauth.md. Note the HTTPS-callback caveat — if the portal rejects a plain-http LAN callback, use your HTTPS (relay) address as the callback and start the connect from there.
Activity
frahlg commentedon Jun 20, 2026
Additional Discord evidence: reporter shared a screenshot of the MyUplink developer portal app edit screen. It exposes Application Name, Description, Callback Url, Client Identifier, Client Secret, and Create new client secret/Save/Remove buttons. No visible grant-type selector or explicit scope selector is present on that screen. Secret was masked in the screenshot.
frahlg commentedon Jun 20, 2026
Root cause confirmed + fix in #497
Confirmed: MyUplink's developer portal only issues authorization-code apps (Callback URL + Client Identifier + Client Secret, on Azure B2C). The
client_credentialsgrant the driver used is not offered for these apps, so it fails withinvalid_clientat the token request — before the callback is ever involved. This matches reference integrations (Home Assistantmyuplink, MarshFlattsFarm's NIBE scripts), which all useauthorization_code+offline_access→refresh_token.Correction on the earlier troubleshooting advice: the driver has no
modefield. Themode: hotwater | heatingsuggestion was wrong —myuplink.luais read-only telemetry for one physical pump (compressor power + hot-water/indoor/outdoor temps) and does not split into hot-water/heating instances. Apologies for the noise.Fix (#497):
grant_type=refresh_tokenat runtime; rotated tokens are persisted (newhost.persist_secretcapability) so they survive restarts.hp_*telemetry.Setup guide:
docs/myuplink-oauth.md. Note the HTTPS-callback caveat — if the portal rejects a plain-httpLAN callback, use your HTTPS (relay) address as the callback and start the connect from there.MyUplink: authorization-code OAuth + in-app consent + heat-pump dashb…