Replies: 10 comments
|
Hi @mrdjtoto thanks for reaching out. As you can probably tell, I'm a heavy Claude Code user too! I'd welcome contributions for WebSocket support. It's the natural evolution of this integration now that basic polling support exists in HA 2026.7. When I first performed the API research, I used Claude to drive the Chrome DevTools MCP to inspect the web browser network traffic. Since then I've switched the API to use the Mobile App API backend as it appears to be more reliable, but didn't look at the time to see whether MITM proxy supports / captures websocket push updates. docs/research/REVERSE_ENGINEERING.md Might be worth starting to look at that doc. Let me know how you get on! |
|
hi @andrew-blake, thank you for your answer. I've already sarted to set up claude to investigate about websocket, starting from what you documented. At first glance, the plan should sound like that: The investigation will be Claude-driven, with everything verified against my real setup (3 ATA units, HA 2026.7.1 on an always-on home server).
Planned steps — investigation only, no integration code until we agree on findings:
Deliverable: findings written up on #174 (protocol notes + reliability data), then we decide together if and how to implement. I'll keep you updated, thank you for the opportinity! |
|
Sounds great. I'd recommend registering for a new MELCloud Home user account for development / HA purposes and then invite it to control each of your devices (Device -> ... -> Advanced Controls -> Share Product). That way, if you accidentally trigger a rate limit MELCloud Home won't block your main account. |
|
Hi @andrew-blake, good news on your open question: mitmproxy does capture the WebSocket, and I think the auth story is simpler than we feared. I did an iOS mitmproxy capture (your Phase 1 flow) plus a static look at the app, and the realtime path turns out to be reproducible with the mobile-BFF bearer the integration already holds — no parallel web session needed. Details below, all level-1 (observed live on my 3 ATA units, read-only unless noted). 1. The app's realtime IS a WebSocket (not native push)Static analysis of the app (it's a .NET 9 MAUI Blazor Hybrid) shows a 2. The WS token comes from the mobile BFF — no web session requiredThis is the key finding vs. the old ADR-007 notes. The app gets its WS credential from an AWS Lambda Function URL, authenticated with the mobile-BFF Bearer: then Verified end-to-end with the integration's own stored token: Lambda (Bearer) → hash → One question for you here: that Lambda URL looks like a fixed, hardcoded endpoint — I couldn't see it returned dynamically by 3. Capture gotcha worth adding to the RE doc
4. Message shapePer-unit delta pushes, only the changed setting names: [{"messageType": "unitStateChanged",
"Data": {"id": "<uuid>", "unitType": "ata",
"settings": [{"name": "SetTemperature", "value": "…"}]}}]Observed names: 5. Reliability (resilient listener, over 22 hours)
Net: treat the 2-hourly drop as normal and reconnect → effectively continuous. 6. Proposed approach (keen on your steer)
I can put this on a branch and dogfood it on my own HA before raising anything — and I'll hold it until you've had a chance to look at the current PRs (#172/#173). Does the opt-in-accelerator shape sound right to you, and would you prefer the RE-doc/HAR contribution as a separate small PR first? |
|
Great findings! Yes, can you create the docs/har PR first please ? |
|
Thanks @mrdjtoto, the #175 capture pinned down the login flow and frame shape nicely. The thing ADR-007 got stuck on was the routing — "only one device receives updates, inconsistent which one" — and that's the bit we still can't see, so if you're up for a few more captures, these are the ones that would help most:
One note: the token-contention question isn't really a HAR thing — it's the debug logs ( One heads-up for whenever you capture these — If the first one comes back showing all units on one socket reliably, that clears ADR-007's main objection and we can start talking about implementation. Thanks again for picking this up. |
|
Happy to keep capturing. On the important one (multi-device routing): the debug For the rest:
And noted re anonymize_har.py only catching plaintext — I'll hand-scrub anything On the token-contention question (agreed, a debug-log thing, not a HAR one): I |
|
Update on the captures — most of it is done, and I've pushed the results into #175. #1 Multi-device routing (the important one) — done, and it clears ADR-007's #3 Setting value types — done (Chrome DevTools HAR, committed anonymized to #175). #4 Mobile credential — done. mitmproxy on the mobile app: the Lambda fetch returns #2 Socket lifecycle — mostly. No client→server frames at all — no subscribe #2/#5 the gaps (ping/pong, close frame) — I couldn't get these cleanly. Separately, on the token-contention question (which as you said is a debug-log |
|
Thanks for this write up. I'm OOO for the next week but will take a look when I return. |
|
Back to close this out — everything since landed while this thread was quiet. Your routing captures above cleared ADR-007's core objection, and the rest held up: implementation merged in #176 (follow-ups #181, #183, #185, #187), and my ~12.5h guest-account soak confirmed the socket is device-type agnostic (587 deltas across 7 units on one socket, including 130 from an Ecodan heat pump) with clean ~2h reconnects throughout. ADR-019 supersedes ADR-007. Shipped in v2.4.0-beta.1 as "Real-time updates", on by default with an opt-out, currently soaking in beta.2 ahead of stable. Thanks for driving this end to end. |
Uh oh!
There was an error while loading. Please reload this page.
Who I am
Hi! I'm a Home Assistant user and software engineer, and I recently got Mitsubishi units at home — so I'm very interested in helping improve this integration. I'm the author of #172 and #173. Full transparency on how I work: I use Claude Code to write the code, and everything gets tested locally on my own HA instance (real MELCloud Home account, 3 ATA units) before I push anything.
Proposal
I'd like to pick up the WebSocket investigation that was deferred in ADR-007.
The ADR documents the v1.1 findings (inconsistent message delivery, only one device receiving updates, routing mechanism not understood) and lays out a clear investigation path:
What I'm offering
Investigation only, at first — no implementation PR until the protocol is understood and we agree it meets the ADR's bar (≥99% delivery, graceful fallback to polling, proper reconnection handling):
docs/api/following the style of the existing API references (scrubbed captures only)Questions
docs/archive/research/that would save me time (captures, notes, dead ends)?If the investigation confirms the protocol can be made reliable, I'd follow up with a design proposal here before opening an implementation PR.
🤖 Issue drafted with Claude Code
All reactions