Skip to content

Desktop Application that control my philips hue lights.

Notifications You must be signed in to change notification settings

AbuSuudy/Philips-Hue-Desktop

Repository files navigation

Philips Hue Desktop

Square44x44Logo altform-unplated_targetsize-256

Often times when I'm on my desktop and the blinding lights of the screen in a darkroom is hurting my eyes 👀. My phone that's able to control the Philips hue light is on the opposite of my room. The simple answer would be to pick up my phone to control my lights or just use the light switch. Nope, that would be too easy so let me develop a desktop application app that uses the Philips hue API so it would allow me to do this from the comfort of my Herman Miller throne 💺


Demo.mp4

Set up

In the philipsHueService.cs you would need to populate philipsHueBrigeIp with ip of your bridge which could be found on https://discovery.meethue.com/ if it's connected to your local network.

        private static string philipsHueBridgeIp = "";               

You would need to generate a username that would be used on all the endpoints. You could use https://{philipsHueBridgeIp}/debug/clip.html as a playground to set up the user. Once you press the button on your bridge and call the endpoint below on the playground you would get the username generated.

SuccessResponse-1

You would populate the philipsHueService.cs generatedUsername with the returned result. If you need more information go to https://developers.meethue.com/develop/get-started-2/

        private static string generatedUsername = "";               

Patterns used

Model-View-ViewModel (MVVM) is a UI architectural design pattern for decoupling UI and non-UI code. With MVVM, you define your UI declaratively in XAML and use data-binding markup to link it to other layers containing data and commands. The data binding infrastructure provides a loose coupling that keeps the UI and the linked data synchronized and routes user input to the appropriate commands.

When using the MVVM pattern, an app is divided into the following layers:

  • The model layer defines the types that represent your business data.
  • The view layer defines the UI using XAML markup.
  • The view-model layer provides data binding targets for the view.

Kelvin to RGB background

The algorithm used to change the background colour by mapping the Kelvin values to an RGB value could be found here https://tannerhelland.com/2012/09/18/convert-temperature-rgb-algorithm-code.html

About

Desktop Application that control my philips hue lights.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published