Git Product home page Git Product logo

presencelight's Introduction

Logo

PresenceLight

NOTE: The new version of PresenceLight for now has a requirement on WebView2. If you experience issues with PresenceLight, please install from this location

.github/workflows/Deploy_Web.yml .github/workflows/Deploy_Desktop.yml

Get PresenceLight

Desktop Version

Nightly Microsoft Store Chocolatey GitHub Releases

Web Version

Web Download Site Web Container from DockerHub Web Container from GitHub Registry

App Versions

Application Type Platforms Readme
Desktop (.NET 8) Windows 10 (min Version 1803) / Windows 11 Desktop Readme
Web (ASP.NET 8) Windows, MacOS, Linux (Debian, AMD x64, ARM, ARM x64), Web Readme

What is PresenceLight?

PresenceLight is a solution to broadcast your various statuses to various kinds of smart lights. Some statuses you can broadcast are: your availability in Microsoft Teams or color of your choosing. There are other solutions that do something similar to sending Teams Availability to a light, but they require a tethered solution (plugging a light into a computer via USB). What PresenceLight does is leverage the Presence Api, which is available in Microsoft Graph, allowing to retrieve your presence without having to be tethered. This could potentially allow someone to update the light bulb from a remote machine they do not use.

Supported Hardware

Light Type
Philips Hue (Local and Remote)
LIFX
Yeelight
Philips Wiz
WLED (via serial or web API)
Any light which can be controlled via a GET or POST call to a web API

Docs

Please Contribute

I welcome all contributions here! Before you do, please read the Contributors Guide

Third Party Libraries

Presence Light would not be possible without the amazing work from the contributors to the following third party libraries!

presencelight's People

Contributors

ben-pearson avatar benlye avatar bobiene avatar dependabot-preview[bot] avatar gep13 avatar gizmohd avatar isaacrlevin avatar jakeshirley avatar jasonjoh avatar jmilthaler avatar loganjohnlong avatar plkumar avatar rajbos avatar ross-p-smith avatar snickler avatar spboyer avatar stefanstranger avatar steviecoaster avatar surecloud-bpearson avatar warthurton avatar xyolyp 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  avatar  avatar  avatar  avatar  avatar

presencelight's Issues

Repeated request for authentication

Each time I launch PresenceLight it re-authenticate via the web browser.

I have tried uninstalling and reinstalling. I have installed 2.0.69.0 using the appxbundle.

Where are the credentials stored so I can clear them completely and see if I can get it to save?

Presence question

Hello
Nice project - I am interesting in Teams graph API...
I set .net CORE to 3.1.201, after that change project compiled but on login it opened browser and after SSO I have waiting indicator only.
1.What can be issue?
2. I am looking for developing application for presence sync in windows service - is it possible to accomplish or it will always open new browser for login into Teams account?

Sync with Accent Color: Brightness

Hi, whenever I sync with my Accent Color and HueBridge the lamp never goes over around 30% brightness, although in the PresenceLight Settings the brightness is set to 100.

Brightness is 100 for Teams and manual Color settings.

When I override the brightness in my Hue-Control it is automatically resettent by PresenceLight to around 30-40%

Expected behaviour: PresenceLight Brightness control also effects brightness when set to "Sync with Windows Accent Color"

Bug: PL not starting anymore

I tried to reinstall but it is saying that I'm trying to install version 1.0.50 when I download from the nightly build (v 1.0.163)
However, both versions are not starting since this morning anymore.

Ability to manually PAUSE the light presence syncing

Could you extend the working hours feature to also allow a manual PAUSE toggle on this settings - if we just want to stop it syncing for a particular period and manually set/re-enable without having to exit the app!

Enhancement: Hue cloud API

Would there be any way to configure the application to use the Hue cloud API? A lot of users these days use VPN so their hue bridge on their LAN would not be accessible as all traffic is routed through the VPN.

Improvement: Clustering on the UI

Hi Isaac, only last night I understood some of the behaviors and how this is organized in the UI.
I have to choose either (!)

  • Set Graph presence
  • Set Color OR
  • Sync Windows Theme
    and PL will immediately use the setting, including logging out in case Graph Presence is deactivated.
    Assuming my understanding is correct, wouldn't it be a nice move forward to structure the UI in the same way as the logic?
    image

Docker container?

Would there be any way to deploy the build in a docker container since you're using new modern build methods?

Light shows purple instead of read for "Focusing" status

I have time blocked on my calendar as "Focus" time, configured using Dynamics. In Teams, the status shows as "Focusing" and it's similar to Do not Disturb. The color is red in Teams, by the app shows it as Purple. I'd expect it to be red.

Idea: Allow custom mapping of colours to status

it would be great to be able to choose the colors that you want displayed for each status vs. the pre-defined colours.

Effectively taking some of the work from #56 and making similar options with colour pickers available in settings would allow for custom colouring.

Admin required when I run it from my account

Hey,

Great app! All works perfectly when I use the Windows Store version, but when I download the master source and try to get it working as an app on my tenant (because I need to make changes for my environment), every time I try and authenticate, it says that I need an admin to approve my use of Presence.Read - I really don't understand, Presence.Read does not require admin approval, and it works perfectly without needing admin permission when using your windows store app.

My permissions on Azure are:

offline_access
openid
Presence.Read
User.Read

(I added offline_access and openid for testing, but don't need them)

What am I missing?

Thanks

Bug? PresenceLight changes light color if started outside of sync hours

It seems that PresenceLight doesn't respect the working hours setting on initial startup. If I reboot my machine (or restart the app) outside of my configured working hours my lights are changed to match my teams presence, however, any subsequent change to teams presence doesn't change the lights.

It's like the app doesn't check the working hours setting on initial startup, only on subsequent poll cycles.

Home scenario: Possible status situations

Thanks, for your app. Works as expected.

While currently working from home I'm coming to the conclusion, that the Online status (Graph API: availability) isn't as helpful to indicate my family what's "needed".

In general I see two dimensions:
a) I don't want to be distracted: (Important) presentation I'm giving, (intense) 1on1, anything that shouldn't be disturbed.
b) Avoiding awkward moments broadcasted into my call/meeting, mostly with camera and/or mic on.

So the distinction is more around the following parameters:

  • Being in a call / meeting?
  • Presenting / not presenting?
  • Mic on / Muted
  • Camera on/off

Regarding status this leads to the following states to signal:

Red flashing: really don't disturb - don't even tell me anything or ask anything
Red: In a call / meeting -- Mic / Video on -- I might be able to react
Yellow: In a call / meeting -- Mic / Video are on, be aware, but's it's ok for me to disturb
Green: Might be in a call or not -- but: Mic/video off -- Let's talk
Off: Bulb turned off.

So in general, the Graph API: activity status might be a better indicator, combined with the not available "Muted/Unmuted" & "Video On/Off" status. plus potentially some calendar flagging / interpretation and the unknown fact of "number of participants in the call/meeting".

For a faster implementation a kind of category selection to select a light status from the above list combined with the API-activity value might be a starter.

Just my 2c!

Enhancement: Stop/Pause updating my status

At some points in the day I would like to set my lamp free of the reigns of my Teams presence. Maybe we could add a right click action to pause updates? Even nicer if we could time the pause.

Thanks!

2.0.85.0 Install fails

Trying to upgrade or install the new nightly fails.

App installation failed with error message: Deployment Add operation with target volume C: on Package 37828IsaacLevin.197278F15330A.Nightly_2.0.85.0_neutral_~_jvewcxq8vj8qt from: (PresenceLight.Package_2.0.85.0_x86.appxbundle) failed with error 0x80190193. See http://go.microsoft.com/fwlink/?LinkId=235160 for help diagnosing app deployment issues. (0x80190193)

After a reboot have uninstalled and tried fresh with the same above.

Question: Recommended Release channel

Which of the 3 Release channels is recommended?
After using the MS Store channel I had to manually deinstall the old nightly link.
Would be nice to update the installation part of the guide.
Good progress, thank you Isaac. Keep going 👯

Hue Connection has a timeout?

Hi,
after a few days (im not sure how many exactly) I have to fully reconfigure my Hue connection. Is this a limitation by my Hue Gateway (which is no original one, its a deconz-gateway that emulates the Hue Bridge?) I have other Software like the Hue Essentials App on iOS running with my Bridge without having the need to reconnect (ever).

Cheers
hmrc87

Failing to install via chocolatey

Received the following when trying to update (and install after an uninstall/install)

ERROR: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Deployment failed with HRESULT: 0x80073CFF, To install this application you need either a Windows developer license or a sideloading-enabled system.

Deployment of package 37828IsaacLevin.197278F15330A_2.0.64.0_neutral_split.scale-100_jvewcxq8vj8qt with package origin Unknown failed because no valid license or sideloading policy could be applied. A developer license (http://go.microsoft.com/fwlink/?LinkId=233074) or enterprise sideloading configuration (http://go.microsoft.com/fwlink/?LinkId=231020) may be required.

NOTE: For additional information, look for [ActivityId] 6ad59df8-3fe8-0002-0a74-596be83fd601 in the Event Log or use the command line Get-AppPackageLog -ActivityID 6ad59df8-3fe8-0002-0a74-596be83fd601

The install of presencelight was NOT successful.
Error while running 'C:\ProgramData\chocolatey\lib\PresenceLight\tools\ChocolateyInstall.ps1'.
See log for details.

Fixed by creatng HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Appx\AllowAllTrustedApps as DWord and setting value to 1

I had not seen this message show up before. I've not had a new group policy pushed to my domain joined machine that I'm aware of.

Lifx Not Working

Unable to connect to Lifx and getting error. Also it cleared my previous settings (api key) and it's unable to save settings.
image

Authorization

I'm sorry this is not a direct issue in your application, but rather a question concerning the authorization.

We really love the work you've done here and would like to use it now we work from home more often. As we work from an Active Directory Domain where we (as an client) have to submit the authorization request to the IT of our organization, the authorization is (sadly) a breaking issue for us.

We understand the need of some of these requests and although the request for accessing certain data is explained, I was wondering what the need is for Read presence information of all users in your organization. Could you perhaps elaborate on this?

Also, is it possible to connect it in some other way? As we read that it could be done with Windows 10 Theme, but we are unsure how the application or usage should be done.

Thank you so much.

After configuration the Hue API is never called

After configuring the app, it checks my presence from Graph as expected, but never calls the Hue API to set the color of my selected lamp. The ddlLights.SelectedItem is always null here:

if (!string.IsNullOrEmpty(Config.HueApiKey) && !string.IsNullOrEmpty(Config.HueIpAddress) && ddlLights.SelectedItem != null)
{
    await _hueService.SetColor(presence.Availability, ((Light)ddlLights.SelectedItem).Id);
}

Whenever I select a lamp in the dropdown, after clicking Save the dropdown goes back to being empty. The selected lamp never goes into the settings.json either.

I think it would be better to write the ID of the lamp into settings.json and use that value instead of relying on the SelectedItem dropdown.

Idea: Different brightness levels per lighting type

I currently have both Hue and Lifx bulbs setup to reflect my presence. I would love to be able to set brightness individually vs. globally as the brightness of the lights is different as well as the locations in which they are positioned have different background light levels.

Brightness settings for LIFX less then 100% dims them to 0%

Hi Isaac, I am using this app simply to control my LIFX lights at work to set light colors manually. Sadly, my work wont allow the auto integration for Teams Presence. So, I manually pick red and green colors based on being in a meeting or not. I go to the settings tab, and change brightness to 80% (then click save) and then go to Set Light Colors tab, choose my color, then click Set Color. When I do this, my lights appear to turn off, but in reality it seems to be setting them to 0% (so they appear off). I go into the LIFX app and can see they are still on and I check their current brightness and can see they are set to 1%. In reality, they are not set to 1% because the lights simply are not on. Anyhow, hoping this is something that can be addressed in future updates. I'd like to be able to set my proper brightness.

Feature Request - Generic API calls

Would it be possible to add a generic API option rather than using a specific vendor APIs? That is, just a list of URI fields that the user can populate with specific URIs for each Teams status (or colour).

Background - I have a bunch of LED light strips with IR controllers. I use an IR blaster device from this project to control them, and I can control that device locally with a REST API call.

E.g. to set the strip to red I GET this URI:

http://192.168.1.9:80/msg?code=FF9867:NEC:32&address=0xff&pass=blast&repeat=3&simple=1"

So if your PresenceLight app gave me a 'Custom API' page with set of fields where I can map each presence value to a URI, it could control my LED lights.

I imagine that this could be useful for a few people who want to use generic/custom hardware solutions (v2 of mine is to replace the IR strip controller with a customised ESP8266 and eliminate the IR).

PS. I did look at trying to implement this myself, but I haven't developed a modern Windows App before so I'm stuck at figuring out how to do that. I've cloned your code but when I run it locally it doesn't behave properly - no login prompt and the UI doesn't work properly.

Disable Presence Light

How do you disable the app once it's been installed and configured? I had to remove it to control my lights manually.

Integration with Homebridge / Homekit?

I know this might be a bit far reaching but I am running a lot of things with Homebridge. It allows for many custom API to be running on Homekit which is much more restrictive.
The advantage is that you can use a more open environment as well and are not as tied to a specific vendor.
Thanks in advance

Error when attempting to run Blazor version on a Mac

When I attempt to run the Blazor version 2.0.82 on Mac OS 10.14.6, I'm encountering the following error:
A fatal error was encountered. The library 'libhostpolicy.dylib' required to execute the application was not found in '/Users/xxx/2.0.82_macOS/'. Failed to run as a self-contained app.

To launch it, I'm running dotnet PresenceLight.exe - I added the .exe extension to the executable since running 'dotnet PresenceLight' returned the following error:

Could not execute because the specified command or file was not found.
Possible reasons for this include:
  * You misspelled a built-in dotnet command.
  * You intended to execute a .NET program, but dotnet-PresenceLight does not exist.
  * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.

In case it's helpful, here's the output from dotnet --info

.NET SDK (reflecting any global.json):
 Version:   5.0.100-preview.6.20318.15
 Commit:    4356580024

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.14
 OS Platform: Darwin
 RID:         osx.10.14-x64
 Base Path:   /usr/local/share/dotnet/sdk/5.0.100-preview.6.20318.15/

Host (useful for support):
  Version: 5.0.0-preview.6.20305.6
  Commit:  4ba9ecaabd

.NET SDKs installed:
  3.1.301 [/usr/local/share/dotnet/sdk]
  5.0.100-preview.6.20318.15 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 3.1.5 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.0-preview.6.20312.15 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.0.9 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.0-preview.6.20305.6 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

Any pointers on what I might be doing wrong?

Enhancement: Only update Lifx color based on status change difference

I noticed that after every Graph poll you update the Lifx API even if the status hasnt changed. Was that intentional ?

I tried a quick code change that only updates the Lifx APi if the status has changed. If it has, update the Lifx API and store the status in readiness for the next poll.

Less hits on the API ;-)

Early timeout in authentication

If I take like 1 min before signing in PL is accepting it but acts like there is no connection to Hue/Teams
Can the timeout be increased?

updating build number per update

it easier to see if there is a new build. Currently version 1.0.157.0 is available. Information marks 1.0.136.0. And on the wish list is a small version history :)
image

Yeelight fails on connect

Exception Message: An invalid argument was supplied.
Stack


assembly | YeelightAPI, Version=1.7.0.0, Culture=neutral, PublicKeyToken=null
-- | --
  | level | 10
  | line | 0
  | method | YeelightAPI.Device+<<Watch>b__50_0>d.MoveNext

@plkumar can you look at this?

First run, setting AAD options with no appsettings.json causes exception

When running this the first time in Visual Studio, I get the message about not being setup to login. On the Settings tab, I add my app ID and tenant ID, then click Save.

The app breaks on an uncaught System.InvalidOperationException in CreateAuthorizationProvider: "Authority should be in the form /, for example https://login.microsoftonline.com/common"

This is caused by the values for app ID and tenant ID not being updated in the _options member when the settings are saved. The authority string is formatted here:

var authority = $"https://login.microsoftonline.com/{_options.TenantId}";

Since _options.TenantId is empty, MSAL's validation throws.

I fixed this by adding the following lines in CheckAAD:

_options.ClientId = Config.ClientId;
_options.TenantId = Config.TenantId;
_options.RedirectUri = Config.RedirectUri;

I put it there because I noticed you did similar transfer from Config to _options in the CheckHueSettings function.

Let me know if you want me to send over a PR for this.

No sign in showing

2.0.79.0 - installed and NO sign-in showing in tab - cannot get it to work any longer

image

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.