Giter Club home page Giter Club logo

teamsstatus's People

Contributors

anonyme22 avatar dielee avatar ebooz avatar metbril avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

teamsstatus's Issues

Status does not update when call is finished

I’ve been using this for about a month and it works well, but I am getting an issue where my status is not going back to ‘Not in a call’ when I close out a call. I have to kill Teams and reopen it to get things synced again.

Has anyone run into this? Any ideas on troubleshooting? It does not happen every time but it does happen fairly often (at least once per day).

Question

Does the service survive a reboot, or will I need to start it every time?
Great work by the way :)

Is this repo still maintained?

There are some pull requests from many months ago, with some nice fixes and features. I'm wondering if the repo is still maintained?

UTF8-Issue when reading Teams\log.txt

When reading the logs.txt to get the $TeamsStatus variable an error may occur when the OS uses a different language that includes umlauts, for example

Mit Jan 19 2022 19:33:51 GMT+0100 (Mitteleuropäische Normalzeit) <5284> -- info -- Setting the taskbar overlay icon - 
             Verfügbar 

Can be fixed by adding -Encoding Utf8 to the $TeamsStatus = Get-Content call.

Problems changing status with script to HA

The status in HA is not changing when chaning the status of my MSTeams session.
Although there are parts of the script which is working the actual automatically changing of the status is not working.

When i close MSTeams from the statusbar the status in HA is updated to Offline.
When i launch the script with the SetStatus argument it is working
.\Get-TeamsStatus.ps1 -SetStatus "Beschikbaar"

I tried to figure out where it goes work but am not able to.
I saw when running parts of the script with Powershell ISE that the variable $TeamsProcess get's a value from the "Get-Process - Name Teams" part. But when i check ($null -ne $TeamsProcess) then it looks like it is empty.

I did change the vallues in the settings.ps1 file to dutch terminology like i find in the log.txt from Teams.

Are you able to help me out with this?

Thank you!

does not exist error

Hi,

After confirming the installation steps, I only end up seeing 'Unknown' for both Teams activity and Teams status.
Running Get-TeamsStatus.ps1, results in:

Get-Content : Illegal characters in path.
At C:\Scripts\Get-TeamsStatus.ps1:54 char:16
+ ... amsStatus = Get-Content -Path "C:\Users\$UserName\AppData\Roaming\Mic ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (C:\Users\<UserN...\Teams\logs.txt:String) [Get-Content], ArgumentExcep
   tion
    + FullyQualifiedErrorId : ItemExistsArgumentError,Microsoft.PowerShell.Commands.GetContentCommand

**Get-Content : Cannot find path 'C:\Users\<UserName>\AppData\Roaming\Microsoft\Teams\logs.txt' because it does not
exist.**
At C:\Scripts\Get-TeamsStatus.ps1:54 char:16

The path does exist, and the logs.txt exists on my system. I'm not sure why it's telling me it does not exist.

Thanks for any help.

Status entity no longer updating

I've been using the script for months without any issues - I run it as a Scheduled Task at login, and by combining it with my calendar data its been great to let my kids know when I'm free, on a sensitive "do not disturb" call, or when I'm on a call with my team which they can disturb if they want to say hello.

Recently however, I'm finding that the Activity entity isn't updating correctly. If I start and drop calls the Status entity correctly changes, but Activity remains stuck on In a call.

For now I've updated my NodeRed flows to trigger off Activity, and that's fine, but I as you get useful information through Status it would be ideal to resolve that at some point.

The new Teams does not write to the same log file.

I had the opportunity to update to the New Teams experience and found that it doesn't write to the same log file that the old version does. I'm not sure if this is intended or not, but people using the New Teams experience should probably be aware that, unless something changes, this will break this powershell script.

Service wont start (paused)

Hello,

I followed the instructions to the letter to install this and although the service appears in the services list, its status is paused and it wont start.

I didn't get any errors whilst following the instructions until the last line where i get:

PS C:\Scripts> Start-Service -Name "Microsoft Teams Status Monitor"
Start-Service : Failed to start service 'Microsoft Teams Status Monitor (Microsoft Teams Status Monitor)'.
At line:1 char:1
+ Start-Service -Name "Microsoft Teams Status Monitor"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Start-Service],
   ServiceCommandException
    + FullyQualifiedErrorId : StartServiceFailed,Microsoft.PowerShell.Commands.StartServiceCommand

PS C:\Scripts>

Any ideas?

Thanks,

Status not updating when run as a service

Hello,
I think I followed your instructions completely, but had an issue, so I looked through the other issues.

If I just run the script ".\Get-TeamStatus.ps1", it creates numerous lines which state my status, and seems to send updates to Home Assistant without issue.
However, if I try running it as a service ("Start-Service -Name "Microsoft Teams Status Monitor") it doesn't update.

Would love some help! Happy to provide any logs or additional info.

I tried to see the status and it appears to be working:

PS C:\Scripts> Get-Service "Microsoft Teams Status Monitor"

Status   Name               DisplayName
------   ----               -----------
Running  Microsoft Teams... Microsoft Teams Status Monitor

Missing .\ before path in powershell

Line 27 of the Get-TeamsStatus.ps1 is missing the dot "." before the settings path
Currently written as ($PSScriptRoot + "\Settings.ps1")
Should be ($PSScriptRoot + ".\Settings.ps1")

Taskbar overlay icon hardcoded

The "status in the taskbar overlay icon" message is static / hardcoded but differs when using a different language. This is not directly noticable since the "StatusIndicatorStateService" is always in English. Instead, it should use the $lg[...] constant.

For example:

If ($TeamsStatus -like "*Setting the taskbar overlay icon - Available*" -or `
        $TeamsStatus -like "*StatusIndicatorStateService: Added Available*") {
        $Status = $lgAvailable
        Write-Host $Status
    }

should be recoded to

If ($TeamsStatus -like "*Setting the taskbar overlay icon - $lgAvailable*" -or `
        $TeamsStatus -like "*StatusIndicatorStateService: Added Available*") {
        $Status = $lgAvailable
        Write-Host $Status
    }

I will submit a PR.

Cannot get it to report status til HA- sensors

I have succesfulle created the sensors in HA, but they don not update.

Must have done something wrong i the instalation proces on my pc.

Created longl-life token and copied it into the program (Does the " have to stay or go) I have left the out.
Regardng the user. It it not clear to me whether it is the "user" on PC with is "XXX" or the user in teams "[email protected]"
I asume it is the later and have again left out the" The descriptons in the Get-TeamsStatus.ps1 and the Readme.md are not alike on this mater.

Url : Can I use my local IP-adress or do i need to use my HTTP://bussemand.duckdns.org:8123
Ran the PowerShellcommands - no errors

I realised that i had made a typeo in my first atempt after having run the powershel commands - went back and corrected the typeo and ran the powershell commands again. this time getting the error that the service already excists.

I hope yoe are able and willing to help me.

Kind regards

Christian

Implement support for Microsoft Teams Live Events

Currently the status is not updated when joining a Live Event. I need to dig into the Teams logfile to see if there is an common identifier to determine if a Live Event is joined via the client on your machine.

Issue with creating sensors - log attached

Logger: homeassistant.components.template.template_entity
Source: components/template/template_entity.py:239
Integration: template (documentation, issues)
First occurred: 16:28:04 (2 occurrences)
Last logged: 16:28:04

Template loop detected while processing event: <Event state_changed[L]: entity_id=sensor.teams_activity, old_state=<state sensor.teams_activity=Offline; friendly_name=Microsoft Teams activity, icon=mdi:microsoft-teams @ 2021-01-12T16:28:03.880826+00:00>, new_state=<state sensor.teams_activity=; friendly_name=Microsoft Teams activity, icon= @ 2021-01-12T16:28:04.149008+00:00>>, skipping template render for Template[{% if states('sensor.teams_activity') == '' -%} Offline {%- endif %}]
Template loop detected while processing event: <Event state_changed[L]: entity_id=sensor.teams_activity, old_state=<state sensor.teams_activity=Offline; friendly_name=Microsoft Teams activity, icon=mdi:microsoft-teams @ 2021-01-12T16:28:03.880826+00:00>, new_state=<state sensor.teams_activity=; friendly_name=Microsoft Teams activity, icon= @ 2021-01-12T16:28:04.149008+00:00>>, skipping template render for Template[{% if states('sensor.teams_activity') == '' -%} mdi:microsoft-teams {%- endif %}]

Teams Monitoring Computer Binary_Sensor

I see that the settings file has the following entries, but the get-teamstatus.ps1 is not doing anything with those as well as the binary_sensors aren't created.

$entityHeartbeat = "binary_sensor.teams_monitoring_computer"
$entityHeartbeatName = "Microsoft Teams monitoring Computer"

Is there more to the script that can be added?

thanks

Powershell script doesn't update in a call correctly

If the computer goes to sleep and then awakens the powershell script ceases to update HA. Also, the powershell script should force the first update based on the last activity state if the service is restarted verses waiting for a change.

Service Fails to start

Hi,

I'm having issues starting the service, it immediately goes into a pause state. There are no error messages attached to the event viewer logs.

I'm using a Microsoft account as my login, W10 Pro 2004

PS error is this

Start-Service : Failed to start service 'Microsoft Teams Status Monitor (Microsoft Teams Status Monitor)'.
At line:1 char:1
+ Start-Service -Name "Microsoft Teams Status Monitor"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Start-Service], ServiceCommandException
    + FullyQualifiedErrorId : StartServiceFailed,Microsoft.PowerShell.Commands.StartServiceCommand

Thanks

Not working for me

Hi, I followed to the letter...

There is an error in the description. Where is says:
Edit the Get-TeamsStatus.ps1 script it should say "Edit the Settings.ps1 script"

I do get the sensors (homeassistant is not new for me :-))
image

I also added the powershell lines per line (some ask for a Y) in elevated mode... no errors...

But I do not get any update or feedback from teams. I do not know where to look or start to troubleshoot...

Please advise.

Move constants outside main script

Updating the script currently asks discipline. You cannot simply drop in the new file. This could be improved by moving all constants to a separate file that is included at runtime.

Missing statuses

The Teams user can manually set an Offline status. This is not checked for in the script. I will submit a PR.

Status is always unknown

Hi, very excited about this method of updating Teams status. However, the status is always showing as unknown. Is there a log I can look at or another way to tell what it is doing?

Does this work with NabuCasa?
chrome_Aa0YY7amrh

unicode characters in USERNAME

Hi,

maybe it's not an issue, but I had a problem with configuration because I have polish letter in my username.
Entering it to config file - breaks the script.
If someone is looking for a solution - you can try to enter it in that way:

$UserName = "WojtekPi$([char]0x0105)tkowski"
instead of
$UserName = "WojtekPiątkowski"

Maybe adding that info to comment will help someone in future? :)

No need to create input entities first

I purposely didn't create the new input_boolean for the hearbeat before using the new script. It's created by HA with first use. So the instructions can be even simpler.

Status Not updating

This was working fine, however after a rebuild and reinstall of my PC, the service isn't working - runs fine if I run the script manually. Is there any logging?

Service not starting

At first the new script including separate settings didn't work. I tried to run it from the command line and that worked. Then I knew it had to be in installing it as a service.

I have been fiddling to get it working. I'm not sure what finally worked, but I think the install script needs modification. The Settings file also needs to be unblocked, I guess?

This was my install script.

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
Unblock-File .\Settings.ps1
Unblock-File .\Get-TeamsStatus.ps1
Start-Process -FilePath .\nssm.exe -ArgumentList 'install "Microsoft Teams Status Monitor" "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" "-command "& { . C:\Scripts\Get-TeamsStatus.ps1 }"" ' -NoNewWindow -Wait
Start-Service -Name "Microsoft Teams Status Monitor"

UTF Encoding for JSON

First of all i want to thank you for this great integration!

I found a "bug" while sending the command when there is a "ä, ü, ö," etc. in the set language block.
Is there anything i can do to solve this?
Works just fine then i send "Verfuegbar" for example

Invoke-RestMethod : {"message": "Invalid JSON specified."}
In C:\Scripts\Get-TeamsStatus.ps1:162 Zeichen:5
+     Invoke-RestMethod -Uri "$HAUrl/api/states/sensor.teams_status" -M ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

Multi-User?

Hello,

thanks for the Script, it works great (and much smaller solution than "Presencelight").

Is it possible to expand the function to alllow mutliple Users (each with there own Sensors)?

Like:
sensor.teams_username_status
sensor.teams_username_activity

My wife and I are both in home office and the kids are both having home schooling (also there are 4 People using Teams).

Best regards

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.