AntoineGS / TeamsStatusV2

Monitoring your Microsoft Teams status with PowerShell
39 stars 6 forks source link

Support for New Teams #23

Closed bezibaerchen closed 6 months ago

bezibaerchen commented 1 year ago

Hi Antoine,

do you hold any knowledge where "New Teams" stores it's logfiles? I am currently piloting the client and script stopped working as logfile location or even logging changed completely. As I heavily use this script to control my busy light I'd be highly interested in getting "New Teams" working.

AntoineGS commented 1 year ago

I had no idea there was a new Teams 😂 The original was outputting an insane amount of logs, part of me thinks if they are doing a big redesign they would probably also reduce the amount of logging done :( I cannot seem to enable it on my current machine (I tried both work and personal accounts). From what I read it has to be enabled by the administrator of the teams organisation, and is not available for personal accounts only, so that could explain it.

bezibaerchen commented 1 year ago

I happen to be an admin of our tenant and enabled it for a pilot group. Trust me, this "new" thing is anything but stable, but someone has to test it. Biggest advantages from my perspective so far:

I am however really not sure where to find the logs to potentially parse for your PS-Script and my busylight not working sucks when working from home ;-)

So if you have any idea as of how to potentially locate I'd highly appreciate.

AntoineGS commented 1 year ago

The 'easy aka bruteforce' approach I would take is to search some common keywords that were part of the old log file in a wide search from the C: drive (or whichever one you have your apps installed) and hope it finds something. I typically use the Find feature of Multi Commander (File Explorer replacement) to do this as Windows never seems to have gotten searching working at a reasonable speed. Any other method of doing 'Find in Files' would work. I would have pasted some examples from the log file but I have no power since yesterday due to a wave of freezing rain in my area lol.

pulimento commented 1 year ago

As far as I see, the process name changes, and the logs are in another path (for now, because those are two separate apps, "Teams" and "Teams Preview". Will take a look at paths/logs when I have time

bezibaerchen commented 1 year ago

As far as I see, the process name changes, and the logs are in another path (for now, because those are two separate apps, "Teams" and "Teams Preview". Will take a look at paths/logs when I have time

That would be truly appreciated. Preview still clearly a preview but it is way more snappy, despite lacking functionalities.

AntoineGS commented 1 year ago

I started rewriting this project in Rust as a means to learn the language and stumbled upon this while figuring out if there is a way to get away from tailing a log file: https://support.microsoft.com/en-us/office/connect-third-party-devices-to-teams-aabca9f2-47bb-407f-9f9b-81a104a883d6 Do you know if the new Teams has a similar option to turn on the local API? If so the re-write might be more beneficial than I had thought 🤣

binderth commented 1 year ago

I don't know anything about the new Teams, as my company doesn't have an early beta-testing in place for it. But I bought a Stream Deck last week and was about to propose to you using the local API, as there must be some way to

  1. get info on a current meeting (aka activity), as the Stream Deck's icons are greyed if I'm not online
  2. get info on use of microphone (this one's new for TeamsStatusV2 and great to know!) and camera (aka webcam), as there's two icon states for it

What I think, the local API (at least for present Teams) is lacking: the "real" state (aka status: Available, Busy, Do not disturb, ...). That is always nice at least for my use case to show my states and if I'm in a meeting right now outside of my study room.

pulimento commented 1 year ago

Unfortunately, can't find this API access on Teams Preview. No wonder, because it's lacking some features. Will need to wait. Didn't have time to check the logs :(

binderth commented 1 year ago

Unfortunately, can't find this API access on Teams Preview. No wonder, because it's lacking some features

I guess, it's because the new Teams is a complete rewrite and switches from Electron to WebView2 and from Angular to ReactJS. Guess, the logs won't be the same. But my bet is, the local API will be added soon enough, I found out, there's a lot of people using the Stream Deck integration Plugin and it works just perfect!

PablaV commented 9 months ago

Any update with this? My organization just updated to the "new" teams app and I no longer see my status in Home Assistant.

AntoineGS commented 9 months ago

I hit a wall with my app and haven't pushed further, I'll gather some motivation to do so. Does the new Teams app have the Third Party Integration option (aka API) yet?

PablaV commented 9 months ago

I'm not sure if there is an API for the new app, I did some searches but nothing really came up.

AntoineGS commented 9 months ago

I do not have access to the new Teams, but here is where the API is turned on in the current (that last button "Manage API"): image

I got the new version of the TeamsStatus that uses the API mostly working last night, but without an API endpoint in the new Teams it would be useless, just as logging has been cleaned up in the new version to a point where we cannot rely on it (or at least that was the case a few months ago).

PablaV commented 9 months ago

So I checked the New Teams app and there isn't a section with the Third-party app API. I did find where the team's logs are but not sure if those will be useful as you mentioned their logging was cleaned up quite a bit. Maybe we can contact Microsoft and see if they will even have a third party API?

binderth commented 9 months ago

I don't think, Microsoft will deprecate the local API. There's a lot of partners using it. I for one use it with my stream deck and would be very unhappy if they discontinued it

https://techcommunity.microsoft.com/t5/healthcare-and-life-sciences/update-4-using-the-native-elgato-stream-deck-integration-with/ba-p/3732044

felipecrs commented 8 months ago

image

There is this option by the way. I don't know what it does though.

And by now everyone can use the new Teams client.

AntoineGS commented 7 months ago

I just saw they added the API in the new Teams!! I have been working on an integration using their APIs, it still has some quirks like handling a Teams restart, there is a persistent command prompt and probably some other minor things but otherwise I have been using it on the old Teams and it has been working well. I will update back here when I get it working on the new Teams, though activating the option does not give me an API key: image

PS: There will be breaking changes if you are moving for this integration to the new one.

For the curious, the project is here: https://github.com/AntoineGS/teams-status-rs But I have not compiled a release yet so this is just the sources.

binderth commented 7 months ago

I don't know, if you know already, but I think, the API is downwards compatible - at least my Stream Deck Plugin now works after I activated the API on new Teams. Should mean, that classic and new Teams' API uses the same endpoints and attributes.

AntoineGS commented 7 months ago

From what I saw last night when testing, the new Teams requires a handshake to generate the token and allow the application to use it, while previously we could generate a token in the UI and use with any application. I am going to run some tests with postman and see if I can get it to trigger somehow. To be continued!

binderth commented 7 months ago

Yes, New Teams did als me to autorize the request from my Stream Deck. If you need help, just tell me. I do need some instructions on how to use postman or other tools, though! 😉

AntoineGS commented 7 months ago

I made some good progress over lunch! I was able to use postman to find the new parameters to pass and was able to get it approved in the New Teams.

I also found this by accident, which is honestly a much better solution and one I was going to tackle after my new application: https://github.com/malkstar/ms_teams_websockets

It does not seem to have any active development or involvement from the creator though since May. Do you have any reason to not use a HACS integration? On my end there is no good reason, I rewrote the application in Rust because I wanted some Rust experience but having it directly in HA is much better.

PablaV commented 7 months ago

While I would prefer a HACS integration, the one you linked doesn't seem to be updated for the new Teams. Either way works for me

AntoineGS commented 7 months ago

Well it seems the new Teams only allows local connections to the API (same machine), which was not the case with the old API. That's too bad, this looked very promising. Back to my Rust project for now.

binderth commented 7 months ago

Sorry this was a dead end, but I think, not everyone uses Home Assistant. I for one use openHAB - and built a home assistant mock service with node-Red, which accepted the call from the script and sent mqtt messages...

So, if it would be possible either let the Rust still send "the same"/similar requests to HA. Or let it send mqtt itself? Or let it send other "standard" messages or the like? For folks not using HA? Could be a configuration or something?

AntoineGS commented 7 months ago

Sure, I can add an MQTT mode once I wrap up the initial release which should be shortly.

On Wed, Nov 15, 2023, 1:27 AM Thomas B. @.***> wrote:

Sorry this was a dead end, but I think, not everyone uses Home Assistant. I for one use openHAB - and built a home assistant mock service with node-Red, which accepted the call from the script and sent mqtt messages...

So, if it would be possible either let the Rust still send "the same"/similar requests to HA. Or let it send mqtt itself? Or let it send other "standard" messages or the like? For folks not using HA? Could be a configuration or something?

— Reply to this email directly, view it on GitHub https://github.com/AntoineGS/TeamsStatusV2/issues/23#issuecomment-1811877922, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEBAYJ6BLL4X4UQ6EOVELF3YEROFLAVCNFSM6AAAAAAWQ7DINSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMJRHA3TOOJSGI . You are receiving this because you commented.Message ID: @.***>

binderth commented 7 months ago

Wow. A Dream!

AntoineGS commented 7 months ago

Initial release is done! Since its not an update but a full rewrite things will most definitely be different. It should be noted that the WebSocket API does not give the status (Busy, Idle, etc.), the JSON example shows what is available from that API, though I only integrated the video feed and in meeting statuses. Feel free to open issues on the other project!