isaacrlevin / presencelight Goto Github PK
View Code? Open in Web Editor NEWPresenceLight is a solution to broadcast your various statuses to light bulbs.
License: MIT License
PresenceLight is a solution to broadcast your various statuses to light bulbs.
License: MIT License
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.
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.
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.
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.
Whenever I set the color manually I'm kicked out the account and change get lost.
ITs great to have the working hours - need a setting to allow a preferred behaviour on what happens to the light after it crosses the workday boundary - idea would be to allow
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.
After installing 2.0.79.0 i cannot
thoughts?
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!
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
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
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.
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
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.
The new Light Syncing Schedule (working hours) does not seem to "save" the setting between session/re-starts of the app.
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?
All settings lost and not maintainable
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.
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 ;-)
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!
Feature: Add ability to quickly turn on/off syncing for Presence using right click and menu selection on the icon once its minimized to the quick access status area
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.
...and authentication "takes forever"
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.
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?
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 👯
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.
Have you thought about using the approach Embrava uses for their status light (using purple-sh #B03CDE instead of a darker red #800000 like it is today?
Speaking from experience, the kids do not care 😀
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?
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.
How do you disable the app once it's been installed and configured? I had to remove it to control my lights manually.
Would be awesome to control a timeboxed presence per right mouse click on the app icon
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?
Minor nit- under step in readme, "Install a User Certificate for the WPF App (included at URL of Installer)" include verbiage for installation in Trusted People, not automatically.
Would there be any way to deploy the build in a docker container since you're using new modern build methods?
Hi Isaac, is this "by design"?
I need to authenticate every time I start PresenceLight.
Cheers
Fred
Hi Isaac, only last night I understood some of the behaviors and how this is organized in the UI.
I have to choose either (!)
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"
LIFX API key is visible when logging into https://cloud.lifx.com only once, it should persist in PresenceLight, otherwise first-run setup including request of a new token must be done every time it is run.
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?
Hey there, Installed via choco. Installed fine, but the shortcut in start menu was wrong, had to update it to the correct exe path.
A color, a dimming and an on/off switch.
Currently, If I stop PL, the hue band switches to bright white
Dimming would be good as the light could be little less bright while PL is on.
Maybe I've overseen a setting?
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:
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!
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.