AI Control | Know-how
  • Xin chào - Hello!
  • FAQ - Hỏi - Đáp
    • Sử dụng ứng dụng Savant Pro App
  • Các ý tưởng về tự động hóa nhà ở
    • Nút nhấn thông minh ON OFF
    • Điều khiển Dimmer - 1 Phím
  • Savant Tips & Tricks
    • Savant - Ring Doorbell & Cameras
      • Savant - Ring X
      • Ring X - Warranty & Support
      • Ring X Line
    • Xác định và khắc phục các sự cố tích hợp Camera
    • Thiết bị khuyến nghị sử dụng khi Kiểm tra và Bảo trì hệ thống
    • Savant Hosts
      • Yêu cầu cài đặt Mac OS & Savant daVinci OS
      • So sánh tính năng Savant Host
    • Hiển thị mật khẩu Camera trong Racepoint BluePrint
    • So sánh truyền thông RS232 vs RS485
      • Sơ đồ chân cổng giao tiếp RS-232, RS-485
      • Sự cố thường gặp với RS-232 và RS-485 Savant
    • Savant REM-4000i
      • REM-4000 - không hiển thị hình ảnh.
      • REM-4000 Screen - Bị nháy
    • Savant Pro Remote Troubleshooting Guide REM-1000
    • Thiết lập Google DNS trên các thiết bị Savant Music Streamer
    • Sử dụng Trigger
    • Workflow gửi email
    • Trigger từ keypad điều khiển
    • Sử dụng Trigger - Lighting Scene
    • Thiết lập Countdown Timer
    • Apple TV Homekit - Savant
  • Thi công, lắp đặt - Tips & Tricks
    • Lưu ý lắp đặt chuông cửa Savant / 2N
    • Lắp đặt đế âm tường cho công tắc, ổ cắm, màn hình cảm ứng
    • Tủ điện thanh DIN âm tường thường gặp
  • AI Control
  • Savant
  • Legrand Việt Nam
  • Điều khiển điều hòa không khí VRV/VRF
    • Daikin VRV
    • Panasonic
    • Gateways - 3rd Parties
    • Mitsubishi VRF
    • Hitachi Hisense
    • Toshiba VRF
    • DR-Fan ERV Modbus Protocol
  • Điều khiển Rèm cửa, động cơ
    • Rèm cửa tự động RS485
    • Các loại điều khiển động cơ qua tiếp điểm khô - Dry Contact
    • Dooya Motors - Động cơ rèm Dooya
    • A-OK Motors | Động cơ rèm A-OK
    • Rèm cuận Somfy RS485
    • TOSO Motors - Động cơ rèm Toso (Progress 50)
    • Động cơ rèm kéo ngang Forest RS485
    • Điều khiển động cơ Novo
  • Điều khiển chiếu sáng
    • Lutron RA2 Select
      • Geo Fencing
    • Philips Hue
      • Tạo User ID và tìm ID bóng đèn - Hue Bridge - Savant Integration.
      • Philips Hue Developer Program API Authen
      • Philips Hue - Geo Fencing
    • DALI
      • DALI - Yêu cầu chung
  • Vantage Controls | Legrand Integrated Systems
    • Hướng dẫn thiết kế đi dây điều khiển Vantage Infusion Bus
  • KNX | EIB
    • KNX Datapoint types
  • ☀️THÔNG TIN THAM KHẢO
    • Tham khảo - P1
      • RJ11 - RJ12
  • Điều khiển Audio/Video
    • Điều khiển Audio Video
    • Mã IR điều khiển Tivi Samsung
    • Bảng mã IR điều khiển Tivi Sony
    • Bảng mã IR điều khiển máy chiếu Sony
    • Điều khiển máy chiếu Barco
  • ĐIỀU KHIỂN TIVI
    • Samsung TV
      • Samsung Tizen TV
  • An ninh
    • Khóa điện tử Yale - Savant
  • LIVING NOW 2M
    • Kỹ thuật chôn box
Powered by GitBook
On this page
  • Follow 3 Easy Steps
  • So let’s get started…
  • Turning a light on and off

Was this helpful?

  1. Điều khiển chiếu sáng
  2. Philips Hue

Philips Hue Developer Program API Authen

PreviousTạo User ID và tìm ID bóng đèn - Hue Bridge - Savant Integration.NextPhilips Hue - Geo Fencing

Last updated 3 years ago

Was this helpful?

Follow 3 Easy Steps

Step 1

First make sure your bridge is connected to your network and is functioning properly. Test that the smartphone app can control the lights on the same network.

Step 2

Then you need to discover the IP address of the bridge on your network. You can do this in a few ways.

NOTE – When you are ready to make a production app, you need to discover the bridge automatically using .

1. Use an mDNS discovery app to find Philips hue in your network. 2. Use our broker server discover process by visiting 3. Log into your wireless router and look Philips hue up in the DHCP table. 4. Hue App method: Download the official Philips hue app. Connect your phone to the network the hue bridge is on. Start the hue app. Push link connect to the bridge. Use the app to find the bridge and try controlling lights. All working — Go to the settings menu in the app. Go to Hue Bridges. Select your bridge. The ip address of the bridge will show.

Step 3

Once you have the address load the test app by visiting the following address in your web browser.

https://<bridge ip address>/debug/clip.html You should see an interface like this.

Using this debugger utility you can populate the components of an HTTPS call – the basis of all web traffic and of the hue RESTful interface.

1. URL: this is actually the local address of a specific resource (thing) inside the hue system. It could be light, a group of lights or many more things. This is the object you’ll be interacting with in this command.

2. A body: this is the part of the message which describes what you want to change and how. Here you enter, in JSON format, the resource name and value you’d like to change/add. 3. A method: here you have a choice of the 4 HTTPS methods the hue call can use. GET: this is the command to fetch all information about the addressed resource PUT: this is the command to modify an addressed resource POST: this is the command to create a new resource inside the addressed resource DELETE: this is the command to deleted the addressed resource 4. Response: In this area you’ll see the response to your command. Also in JSON format.

So let’s get started…

First let’s do a very simple command and get information about your hue system.

Fill in the details below leaving the body box empty and press the GET button.

URL

/api/newdeveloper

Method

GET

You should see a response like below:

Congratulations you’ve just sent you first CLIP command!

Now this is the command to fetch all information in the bridge. You didn’t get much back and that’s because you’re using an unauthorized username “newdeveloper”.

We need to use the randomly generated username that the bridge creates for you. Fill in the info below and press the POST button.

URL

/api

Body

{"devicetype":"my_hue_app#iphone peter"}

Method

POST

This command is basically saying please create a new resource inside /api (where usernames sit) with the following properties.

Go and press the button on the bridge and then press the POST button again and you should get a success response like below.

Congratulations you’ve just created an authorized user (1028d66426293e821ecfd9ef1a0731df), which we’ll use from now on! Now if you do the first GET command again you should get a whole lot more information about what lights you have and their states. This data is all in JSON format so can be easily processed by your applications.

Turning a light on and off

Okay now that we have a username with permission to use the system lets start having some fun.

Each light has its own URL. You can see what lights you have with the following command:

Address

https://<bridge ip address>/api/1028d66426293e821ecfd9ef1a0731df/lights

Method

GET

You should get a JSON response with all the lights in your system and their names.

Now let’s get information about a specific light. The light with id 1.

Address

https://<bridge ip address>/api/1028d66426293e821ecfd9ef1a0731df/lights/1

Method

GET

In this response you can see all of the resources this light has. The most interesting ones are inside the state object as these are the ones we’ll have to interact with to control the light.

Lets’ start with the “on” attribute. This is a very simple attribute that can have 2 values: true and false. So let’s try turning the light off.

Address

https://<bridge ip address>/api/1028d66426293e821ecfd9ef1a0731df/lights/1/state

Body

{"on":false}

Method

PUT

Looking at the command you are sending we’re addressing the “state” object of light one and telling it to modify the “on” value inside it to false (or off). When you press the PUT button the light should turn off. Change the value in the body to true and the light will turn on again.

Now let’s do something a bit more fun and start changing some colors. Enter the command below.

Address

https://<bridge ip address>/api/1028d66426293e821ecfd9ef1a0731df/lights/1/state

Body

{"on":true, "sat":254, "bri":254,"hue":10000}

Method

PUT

We’re interacting with the same “state” attributes here but now we’re modifying a couple more attributes. We’re making sure the light is on by setting the “on” resource to true. We’re also making sure the saturation (intensity) of the colors and the brightness is at its maximum by setting the “sat” and “bri” resources to 254. Finally we’re telling the system to set the “hue” (a measure of color) to 10000 points (hue runs from 0 to 65535). Try changing the hue value and keep pressing the PUT button and see the colour of your light changing running through different colors.

When you press the POST button you should get back an error message letting you know that you have to press the link button. This is our security step so that only apps you want to control your lights can. By pressing the button we prove that the user has physical access to the bridge.

Now you understand the basics of the commands you can send to hue through this tool – but we can also send the commands as part of an app. Intrigued now? Read more at (developer account required).

Hue Bridge Discovery Guide
https://discovery.meethue.com
Core Concepts