HKCU still works for me, my code is still running with CU. That said, seems it’s also under HKLM for me. Different stop times, though…
If you tested it in PowerShell console, make sure you replace $UserName with your actual username on the machine, OR set the variable first. Otherwise it’ll fail.
just got mine working a couple of days ago with a Hue light showing stutus.
I first tried the PowerShell task scheduler way, but the thing wanted a password (in Windows) that I had no clue what it was, so I couldn’t make the task. Then I tried the API way using PresenceLight and got this to work via Nabu Casa.
I don’t know what is better, but the API/PresensceLight works even if you sign on another computer or use the Teams app on your phone.
I have applied most of the recommendations from the Issues and Pull Requests, including support for camera detection.
The only “issue” I am aware of right now is that the icons will be the default sensor icon if the service has not sent an update to HA yet, but I preferred that over having unneeded input boxes which is what seemed to be used to get icons to show up.
Woups I was not watching this thread, I can most definitely add an environment variable for the language!
If you have other requests I created a Feature Request label in the issues.
The Web Socket API seems to be released officially now (it was pulled almost immediately after the first appearance). I wrote a Windows service that connects with the Teams Web Socket API and pushes the information to Home Assistant using MQTT. I published the tool on GitHub and maybe it’s useful for someone else as well. I currently have labeled the release as “pre-relase”, so it does not appear directly on the front page of the repository, but you can access it through the “Releases” link.
Right now, I have automations that switch on/off my Key Lights when a meeting starts/ends and also pauses Spotify if I join a meeting.
Very cool! As somebody who contributed to various iterations of code for the script-based solutions, I’ll be watching this - seems much cleaner!
Hopefully the API exposes whether the webcam is on or not? For the various scripts out there I added a way to scan the registry for the camera turning on but it’s… clunky.
It does indeed provide a sensor whether or not the camera is on, though tbf I tend to exclusively camera on in a meeting so I may not have tested it all that well.
That being said, it flicks on whilst I’m in a meeting as expected and comes from the websockets API so I’m guessing it will work correctly.
I’ve now implemented all 6 sensors (should probably update the github to reflect that)
I’ve been testing for a couple of weeks now and pretty happy with the results, allowing me to control sound notifications based on meeting status. There’s a couple of intricacies to iron out but I’m imagining their due to my lack of experience in integration development.
Hi, I’m just giving this a go, it looks great, I get an unexpected error when I’m trying to set up the integration though? I get an unexpected error if I leave my host as local host and put in the API token or if I change the host IP to my laptop with teams on, it thinks about it for 5 seconds and then I get an unexpected error. Hoping you can point me in the right direction please?
Apologies, I haven’t had a great deal of computer time outside of work the past couple of weeks.
The host should indeed be the machine where the teams client is, so I have my HA server on my NAS and use the local IP of my teams client when setting up the integration.
Are you guys on Windows? I need to set up a windows machine to test with, I should get chance Monday.
Yes, I am using Windows. I assume you are running Teams on MacOS? This appears to be a Windows Firewall issue? I can use a websocket test successfully locally (browser and TEAMs on same machine) and it works. However, if run the websocket from a remote machine (such as a HA server), it fails. I don’t have admin priviledges on my laptop to open any firewall ports.
Yes also using windows, it’s my work laptop so admin permissions and firewall issues might be tricky to overcome. I have a personal laptop with windows on so could always try that as well
Pretty certain it’s a firewall issue, can set up the integration on macOS and my own windows laptop fine but it keeps failing with an unexpected error on my work laptop….need to speak nicely to IT….