Skip to content

.Net app that controls two (green and red) Sonoff switch lights to show online status

License

Notifications You must be signed in to change notification settings

miscalencu/OnlineStatusLight

Repository files navigation

OnlineStatusLight

This is a .NET Code desktop app that controls a lighting service to show online status of Microsoft Teams

Source Services

There are currently three implementation for getting the MS Teams status:

  • WindowsAutomation - by using the Windows Automation (UIAutomation) to read the Teams status (Windows only).
  • Azure - by querying the MSGraph for the Teams Presence.
  • LogFile - by reading the MS Teams local logs file

WindowsAutomationSourceService

Implementation for MS Teams which reads the current status by using the Windows Automation (UIAutomation) to read the Teams status.

{
  "sourceService": {
	"type": "windowsAutomation",
	"windowsAutomation": {
	  "interval": 5,
      "windowName": "Microsoft Teams",
      "statusPattern": "Your profile, status @status"
	}
  }
}

This implementation will only work under Windows machines.

AzureSourceService

Implementation for MS Teams which reads the current status using the Presence API.

{
  "sourceService": {
    "type": "azure",
    "azure": {
      "interval": 5,
      "authority": "https://login.microsoftonline.com",
      "tenantId": "xxx",
      "clientId": "xxx",
      "clientSecret": "xxx",
      "redirectUri": "xxx"
    }
  },
}

This implementation required that you have an application setup in your current AzureAD, application that has granted the Presence.Read permission.

LogFileSourceService

Implementation for MS Teams which checks the Status by reading the local logs file.

"sourceService": {
  "type": "logFile",
  "msteams": {
      "interval": 5,
      "logfile": "%appdata%\\Microsoft\\Teams\\logs.txt"
  }
}

⚠️ This implementation will only work for Classic Teams app version, not for the Windows Teams version.

Light Services

Currently, there are two services supported:

  • Sonoff - to control SonOff BasicR3 WiFi smart switches.
  • Razer - to control Razer devices.

Sonoff

Details of the hardware implementation here: https://www.linkedin.com/feed/update/urn:li:activity:6895151178066579456/.

  • Red light turns on for Busy.
  • Green light turns on for Available.
  • Both lights turn on for Do Not Disturb (Presenting). Initial idea was to blink the red light but the switch makes a noise every time it is activated so I had to give up that idea.

Required configuration for this implementation:

"lightService": {
  "type": "sonOff",
  "sonoff": {
      "red": {
        "ip": "192.168.0.62"
      },
      "green": {
        "ip": "192.168.0.61"
      }
  }
}

Razer

  • Red light turns on for Busy, In a meeting and Do Not Disturb (Presenting).
  • Green light turns on for Available.
  • Yellow light turns on for Away
  • Purple light turns on for OutOfOffice

Required configuration for this implementation:

"lightService": {
  "type": "razer",
  "razer": {
      // true = will color the HeadSet device only. false = will color ALL Razer devices
      "headsetonly": true
  }
}

About

.Net app that controls two (green and red) Sonoff switch lights to show online status

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages