This project started out as way to get Microsoft Teams status and activity updates into home assistant, it has since grown to provide standalone connection to Philips Hue lights, WLED lights, out own hatcher project and MQTT.
Originally, all updates were parsed from the logs that Teams creates, today we only get status updates from the logs, all other activity comes from the new Teams local API (Thanks Microsoft!)
I am hoping Microsoft add status updates to the local api as well, as constantly reading a log file is not very efficient.
The whole thing is written in C# and is pretty lightweight.
- Light state (Hue, WLED and Hatcher) are restored to their original state on exit, stop or if the module is disabled
- Minimises to system tray to keep your task bar clutter free
- Can run independently of Home Assistant
- Publish updates to MQTT
- Change the color of WLED / Hue devices dependant on Status/Activity
On first run, nothing is configured, but it will start monitoring the Teams logs in the background, so your Status icon may be different, depending on your current Teams status
First step is to go to Teams, open settings, privacy, scroll to Third Party API and click manage API:
Enable the API and copy the key.
In THFHA go to File – Settings and paste in your key (It is automatically saved):
Also note the two options at the bottom:
Run at Startup does NOT make the app launch when you start windows, rather it starts controlling lights/mqtt etc when the app is run.
Run minimised does exactly what it says, an it will appear in your system tray.
To configure Home Assistant, you can either double click the Home Assistant entry in the available modules list, or you can access its settings page from File > Settings:
Enter the URL to your home assistant instance (Including the port it it is not 443)
e.g
http://homeassistant.local:8123
or if you are using ssl:
you will need a long lived access token from Home assistant (See here)
Paste it into the box as shown:
Click Test, if all is OK you will see "Homeassistant is connected" in the status bar. If you get an error, please check the url, port, scheme (http or https) and token.
You should now be able to enable this either by right clicking:
Or in the settings:
Once enabled, (And the app is started)
You should see new sensors created in Home assistant with the prefix THFHA:
These should be pretty self explanatory
Activity = generally "Not in a Meeting" or "In a Meeting"
Blurred – indicate whether or not your back ground is blurred
Camera – On/Off state of Camera
Hand – whether or not you have your hand raised in a meeting
Microphone – mute state
Recording – whether or not the call is being recorded
Status – Available/Busy/DND/Be Right Back/Away/Offline etc.
Enter the ip of your hue bridge and click Link
you will be prompted to push the link button on your hub – please do so before proceeding to click ok!
Once linked, your available hue lights will appear in the list. Choose the one you wish to control (Currently, only one light may be selected)
Once again, right click in the module list to enable Hue control.
Double click MQTT to open its settings:
Note, you don't need to specify the port for mqtt unless you are using something other than the default (untested)
If you have a username and password, enter these
MQTT Topic is the prefix that the topic will start with.
Click Test:
If you receive an error, please double check your settings.
This will now be publishing to MQTT under the main topic of HomeAssistant, and should create the sensors for you based on your MQTT Topic: (Mine here was ryzen, ignore the ryzen_lastboot, that is from a different integration!)
You can now enable MQTT by right clicking it in the module list.
WLED relies on mDns for discovery, it is usually enabled by default on most home routers, but some prosumer equipment (Unifi etc) may need mDns enabling.
Click discover to have the program discover your devices, please wait until the status bar shows "Stopped Discovering Lights"
Select your WLED light from the list:
Once again, right click to enable in the modules list
We built a device based on a Raspberry Pi zero and a circular LED display – see
https://github.com/jimmyeao/Hatch_Companion
it is possible to control this from THFHA. Simply enter the IP of your Pi and click test:
If all is well, you will now be able to control this device from THFHA