Teams2HA - Microsoft Teams HA Bridge

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.

Many thanks for these nice quality of life improvements, PR has now been merged, v1.2.4 is available from the releases page https://github.com/jimmyeao/TEAMS2HA/releases/latest

Today I did a lot of changes to the code, please see the changelogs: TEAMS2HA/CHANGELOG.md at master · mhoogenbosch/TEAMS2HA, again, I am no coder, had some tokens left this week so thought to do a few additional features.

If you would like to have any changes as PR, feel free, i’ll push them.

v1.3.4 is out — and thanks again to @mhoogenbosch whose PRs drove a lot of the reliability work.

  • Auto-update restored (signed, verifies before installing)
  • MQTT password encrypted at rest with Windows DPAPI
  • More reliable mute detection via UI Automation (fixes cases where mute state was wrong or stuck)
  • TLS transport no longer silently downgrades to plaintext if the broker negotiation fails
  • Multi-homed gateway detection fix — the “home network” feature now resolves the router MAC correctly on machines with Ethernet + Tailscale/VPN + a dock, where it previously failed to detect the gateway
  • App version now shown in the UI and published as sw_version in HA
  • Publishes state only when it actually changes (less MQTT chatter), dependency updates, and a security-audit CI job

Download: Release Teams2HA v1.3.4 · jimmyeao/TEAMS2HA · GitHub