Skip to content

Control your Philips Hue system with simple HTTP GET requests.

License

Notifications You must be signed in to change notification settings

100prznt/HueHook

Repository files navigation

HueHook

Control your Philips Hue system with simple HTTP GET requests. POST parameters are not needed!

HueCmd

You can find a seperate README.md for HueCmd, now. Browse to HueCmd/README.md

How to use

Start the program

Since version 1.0.19

Before the first program start, a settings file must be created. You can modify the example file, found in ExampleData/HueHookSettings.xml. The file must be in the same directory as the program and named HueHookSettings.xml. See next point Settings for detailed informations.

Up to version 1.0.18

Run the HueHookServer.exe with 2 start parameters.

  • parameter 1: IP of the hue-bridge
  • parameter 2: authorized username to access the bridge*

To obtain this parameters you can start the program with a shortcut. Append the parameters to the target path, e.g. C:\path-to-program\HueHookServer.exe 192.168.0.1 my-app-key.

Settings

The program settings are stored in a xml-formated file, named HueHookSettings.xml. This file have one root node <HueHookSettings>, which have several child nodes.

Node Description
<BridgeIp> ⚠️ IP address of the Philips Hue Bridge
<BridgeUsername> ⚠️ authorized user on the Philips Hue Bridge*
<LocalServerIp>
<LocalServerPort> port of the HueHookServer
<WhiteList> ⚠️ this node contains child nodes (<IpAddress>) for each IP address of allowed client

⚠️ required setting

An example you can find under ExampleData/HueHookSettings.xml.

* to get an new username see the Getting Started article on my blog.

After successfully initialization the programm prints the server address (ip and port).

Use the program

Call the urls described below, each url starts with the address (ip and port) and have some optional parameters:

Description Name Value Light Group Scene
⚠️ URL /*.hue /light.hue /group.hue /scene.hue
⚠️ ID id 0 - 254 ✔️ ✔️ ✔️
On state on 0, 1 ✔️ ✔️
Hue hue 0 - 65535 ✔️ ✔️
Saturation sat 0 - 254 ✔️ ✔️
Brightness bri 0 - 254 ✔️ ✔️
Color Temperature ct 153 - 500 ✔️ ✔️

⚠️ required parameter   ✔️ parameter allowed   ❌ parameter not allowed

The URL must at least be made up of the required parameters (:warning:). In addition, further allowed parameters (:heavy_check_mark:) can be appended. The parameters are appended to the URL as a query string (name/value pairs), see the example below.

Example

The url http://192.168.0.1/light.hue?id=1&on=1&bri=127 means, switch on the light with id 1 and setup the brightness to a value of 127.

Security

  • Since version 1.0.14 access is only allowed from the same computer on which the program is running.
  • Since version 1.0.15 access is managed by a whitlist file, this file contains whitlisted ip-addresses (each per line). The file must be in the same directory as the program and named ip-whitelist.txt. An example you can find under ExampleData.
  • Since version 1.0.19 the whitelist is defined in the settings file. See Since version 1.0.19.

Releases

This project build on the continuous integration (CI) platform AppVeyor and released in the Release-Feed.

AppVeyor Build
AppVeyor Tests

GitHub Release
GitHub (Pre-)Release (Pre-)Release

Credits

  • Elias Ruemmler - Initial work - 100prznt

Under Contributors you can see more project supporter.

Open Source Project Credits

  • Q42.HueApi C# helper library to talk to the Philips Hue bridge

License

This project (HueHook) is licensed under MIT License.
Refer to LICENSE for more information.

license