Teams2HA: reliability improvements for the Teams → Home Assistant bridge (fork, PR pending)
First things first: all credit for Teams2HA goes to @jimmyeao, who built and maintains
the original tool — GitHub - jimmyeao/TEAMS2HA · GitHub. It’s a small Windows tray app
that bridges your Microsoft Teams meeting state (in a meeting, camera on, muted, presence)
to Home Assistant over MQTT, so you can automate an on-air light, mute speakers during
calls, and so on. After Microsoft deprecated the Teams local API, Jimmy rewrote it in
Rust/Tauri using Teams logs and hardware signals — it needs no admin rights and no Graph
API registration.
I’ve been running it daily and hit a few practical reliability issues on my setup, so I
built fixes for them and submitted everything upstream as a PR
(Tauri: MQTT availability (Last Will) + optional home-network gating by mhoogenbosch · Pull Request #93 · jimmyeao/TEAMS2HA · GitHub). Sharing here in case others recognise
these symptoms:
Entities stuck on stale values. MQTT retained states meant is_in_meeting could stay
on forever after closing the laptop mid-call, silently blocking automations. All
entities now have an MQTT availability topic with a Last Will, so Home Assistant marks
them unavailable the moment the app (or laptop) goes away.
Nothing reconnects after Modern Standby. Windows delivers no reliable resume event to
a suspended tray app, and the pre-sleep MQTT session can be a silently dead TCP
connection. The app now detects a resume by clock gap and rebuilds the MQTT connection
from scratch.
Phantom “in a meeting” after a restart. Windows’ privacy registry keeps
LastUsedTimeStop = 0 (“camera in use”) when Teams dies or the machine suspends mid-call.
The app trusted that blindly and would publish a phantom video-on/in-meeting state —
which in my house muted the office speakers for a call that didn’t exist. An ‘active’
reading now only counts after the device has been seen inactive at least once since
start/resume.
Optional home-network gating. The app can now pause MQTT entirely while you’re not on
your home network (detected via the default gateway’s MAC — works wired and on Wi-Fi,
needs no location permission, and a VPN tunnel can’t fool it).
Plus smaller things: the close button hides to tray instead of quitting the bridge, and
there’s a log file for troubleshooting.
While the PR awaits review you can find code and releases in my fork:
GitHub - mhoogenbosch/TEAMS2HA · GitHub — once it’s merged upstream, use Jimmy’s releases.
Fair warning: the fork’s installers are unsigned, so Defender’s ML heuristics may flag a
fresh release as a false positive (!ml detections). You can verify the SHA256 against
the GitHub release digest or build from source — it’s all GitHub Actions from the
repository you can read.
Transparency note: these fixes were developed with AI assistance and field-tested on my
own setup before submitting.