All Projects β†’ Q42 β†’ Q42.hueapi

Q42 / Q42.hueapi

Licence: mit
C# helper library to talk to the Philips Hue bridge

Projects that are alternatives of or similar to Q42.hueapi

HueLightDJ
Hue Light DJ using Hue Entertainment API
Stars: ✭ 54 (-83.28%)
Mutual labels:  light, philips-hue, hue
Hue
πŸ’‘ A Philips Hue library written in Swift, using Combine framework
Stars: ✭ 16 (-95.05%)
Mutual labels:  philips-hue, hue
Harmonizeproject
Harmonize Project - Sync HDMI video with Philips Hue lights using a Raspberry Pi!
Stars: ✭ 252 (-21.98%)
Mutual labels:  philips-hue, hue
HueControl
Java-based framework for working with the Phillips Hue system
Stars: ✭ 14 (-95.67%)
Mutual labels:  philips-hue, hue
Pytradfri
IKEA TrΓ₯dfri/Tradfri API. Control and observe your lights from Python. Examples available. On pypi. Sans-io.
Stars: ✭ 778 (+140.87%)
Mutual labels:  philips-hue, light
Huebert
A dead-simple Philips Hue client for web and desktop
Stars: ✭ 51 (-84.21%)
Mutual labels:  philips-hue, hue
HueBridgeEmulator
Python emulator for Philips Hue Bridge
Stars: ✭ 17 (-94.74%)
Mutual labels:  philips-hue, hue
Sharpcaster
Chromecast C# SDK for Windows, Windows Phone, .NET 4.5.1, Xamarin.iOS and Xamarin.Android platforms.
Stars: ✭ 245 (-24.15%)
Mutual labels:  windows-phone, uwp
hass-hue-icons
Additional vector icons for home assistant to model Philips Hue bulbs and fixtures.
Stars: ✭ 161 (-50.15%)
Mutual labels:  philips-hue, hue
Raspberry-Pi-Clock
A quick and simple Raspberry Pi touchscreen clock with Philips hue, Tado, Dark Sky and Philips TV JointSpace API controls/data
Stars: ✭ 23 (-92.88%)
Mutual labels:  light, philips-hue
Awesome Uwp
Awesome UWP libs
Stars: ✭ 279 (-13.62%)
Mutual labels:  windows-phone, uwp
Breadplayer
Bread Player, a free and open source music player powered by UWP and C#/.NET with a sleek and polished design built for, and by, the people seeking a better alternative to Groove and Windows Media Player by Microsoft.
Stars: ✭ 267 (-17.34%)
Mutual labels:  windows-phone, uwp
Homebridge Hue
Homebridge plugin for Philips Hue and/or deCONZ
Stars: ✭ 637 (+97.21%)
Mutual labels:  philips-hue, hue
Harmonizeproject
Harmonize Project lets you sync HDMI video with Philips Hue lights using a Raspberry Pi!
Stars: ✭ 82 (-74.61%)
Mutual labels:  philips-hue, hue
Diyhue
Philips Hue emulator that is able to control multiple types of lights
Stars: ✭ 586 (+81.42%)
Mutual labels:  philips-hue, hue
hueplusplus
A simple C++ library to control Philips Hue lights on Linux, MacOS, Windows, Espressif ESP32 SDK and Arduino. Full documentation at
Stars: ✭ 48 (-85.14%)
Mutual labels:  philips-hue, hue
Q42.winrt
Useful library for data driven Windows Phone 8 and Windows 8 C# / XAML WinRT projects
Stars: ✭ 111 (-65.63%)
Mutual labels:  windows-phone, uwp
Caliburn.micro
A small, yet powerful framework, designed for building applications across all XAML platforms. Its strong support for MV* patterns will enable you to build your solution quickly, without the need to sacrifice code quality or testability.
Stars: ✭ 2,404 (+644.27%)
Mutual labels:  windows-phone, uwp
huebot
Changes a Phillips Hue light's color and flashes based on GitHub's status
Stars: ✭ 34 (-89.47%)
Mutual labels:  philips-hue, hue
Kelvin
Kelvin - The hue bot
Stars: ✭ 256 (-20.74%)
Mutual labels:  philips-hue, hue

Q42.HueApi

Open source library for communication with the Philips Hue bridge. This library covers all the Philips hue API calls! You can set the state of your lights, update the Bridge configuration, create groups, schedules etc.

This library targets .netstandard2.0 and .net45! Download directly from NuGet Q42.HueApi on NuGet.

  • Support for Hue Entertainment API (requires .NET 4.7.1+ or netstandard2.0)
  • Support for the Hue Remote API
  • Multiple Color Converters

How to use?

Some basic usage examples

Bridge

Before you can communicate with the Philips Hue Bridge, you need to find the bridge and register your application:

	IBridgeLocator locator = new HttpBridgeLocator(); //Or: LocalNetworkScanBridgeLocator, MdnsBridgeLocator, MUdpBasedBridgeLocator
	var bridges  = await locator.LocateBridgesAsync(TimeSpan.FromSeconds(5));

	//Advanced Bridge Discovery options:
	bridges = await HueBridgeDiscovery.CompleteDiscoveryAsync(TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(30));
	bridges	= await HueBridgeDiscovery.FastDiscoveryWithNetworkScanFallbackAsync(TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(30));
	bridges = await HueBridgeDiscovery.CompleteDiscoveryAsync(TimeSpan.FromSeconds(5));

Register your application

	ILocalHueClient client = new LocalHueClient("ip");
	//Make sure the user has pressed the button on the bridge before calling RegisterAsync
	//It will throw an LinkButtonNotPressedException if the user did not press the button
	var appKey = await client.RegisterAsync("mypersonalappname", "mydevicename");
	//Save the app key for later use

If you already registered an appname, you can initialize the HueClient with the app's key:

	client.Initialize("mypersonalappkey");

Control the lights

Main usage of this library is to be able to control your lights. We use a LightCommand for that. A LightCommand can be send to one or more / multiple lights. A LightCommand can hold a color, effect, on/off etc.

	var command = new LightCommand();
	command.On = true;

There are some helpers to set a color on a command:

	//Turn the light on and set a Hex color for the command (see the section about Color Converters)
    command.TurnOn().SetColor(new RGBColor("FF00AA"))

LightCommands also support Effects and Alerts

	//Blink once
	command.Alert = Alert.Once;
	
	//Or start a colorloop
	command.Effect = Effect.ColorLoop;

Once you have composed your command, send it to one or more lights

	client.SendCommandAsync(command, new List<string> { "1" });

Or send it to all lights

	client.SendCommandAsync(command);

Support for Hue Entertainment.

Check out the Q42.HueApi.Streaming documentation
Read about the Philips Entertainment API

Remote API

There is also a Philips Hue Remote API. It allows you to send commands to a bridge over the internet. You can request access here: http://www.developers.meethue.com/content/remote-api
Q42.HueApi is compatible with the remote API. There's a sample app and documentation can be found here: https://github.com/Q42/Q42.HueApi/blob/master/RemoteApi.md

Color Conversion

The Philips Hue lights work with Brightness, Saturation, Hue and X, Y properties. More info can be found in the Philips Hue Developer documentation: http://www.developers.meethue.com/documentation/core-concepts#color_gets_more_complicated It's not trivial to convert the light colors to a color system developers like to work with, like RGB or HEX. Q42.HueApi has 3 different color converters out of the box. They are in a seperate package and it's easy to create your own color converter.

The Q42.HueApi.ColorConverters NuGet package contains:

  • Original: The original converter based on a large XY array.
  • Gamut: Uses the provided Gamut (type) provided by each light.
  • HSB: Converts based on Hue, Brightness and Saturation.

How to use a color converter? Add one of the following usings:
using Q42.HueApi.ColorConverters.Original
using Q42.HueApi.ColorConverters.Gamut
using Q42.HueApi.ColorConverters.HSB

This will add extension methods to Light, State and LightCommand. So you can set the color using new RGBColor() and convert the State back to RGBColor

Pull Requests with improvements to the color conversion are always welcome!

How To install?

Download the source from GitHub or get the compiled assembly from NuGet Q42.HueApi on NuGet.

Credits

This library is made possible by contributions from:

Open Source Project Credits

  • Newtonsoft.Json is used for object serialization

License

Q42.HueApi is licensed under MIT. Refer to license.txt for more information.

Contributions

Contributions are welcome. Fork this repository and send a pull request if you have something useful to add.

Build status

Related Projects

Apps that use Q42.HueAPI

Are you using Q42.HueAPI? Get your app listed here! Edit this page and send a pull request.

Windows

Windows Phone

WinForms

Xbox One

Android

Command Line Tools - Windows, Linux (x64 & ARM) and Windows 10 IOT (ARM)

Other

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].