This object is in archive! 

Phillips Hue basic HTTP control

Alberto Macias shared this idea 7 years ago
Under Consideration

Community,


I have seen several posts on these community regarding Phillips Hue. We all know that Phillips Hue integration with Zipato still must be polished, especially if you have several bulbs / lamps at home, is hard to keep up good control using zipato. These are the main problems that I see;


1. Every time you add a new bulb to the Hue bridge, the complete system needs to be deleted from Zipato and bridge re-included. That means any scene or rule you have will no longer be good and need to be fixed manually.


2. Hard to achieve same colors using zipato scenes, rules or even with manual control.


3. Scenes are sometimes unreliable to turn ON/OFF or change status of some bulbs. Specially if you have many bulbs in a group.


As I mentioned I saw a few posts where many users rather use HTTP commands than going through all these but I never seen a complete example or steps required to do this. Specially for people that are not familiar with HTTP programming (like myself) this could be difficult, so I had to spend some time learning how to do this and I want to share this with the community, I can say it is indeed much faster and reliable to handle phillips hue with HTTP commands, you can create scenes easily on the Hue bridge and just call them using Zipato, which helps avoiding three main problems mentioned above.


1. Need to know your Hue bridge IP - you can find this by logging into your hue account using their web page (https://my.meethue.com/en-us/), go to settings, my bridge, more bridge details and there is its current IP address. Another way is to log into your router but I think this is easier and you can do it remotely.


2. Create a developer’s account - This step is not required but it is highly recommended, go to https://developers.meethue.com/ and create your account. Read through “getting started” section.


3. Create a username – While on the same network go to http://< replace with your bridge ip address>/debug/clip.html and once you see debug screen type the following;


a. URL http://<replace with your

bridge ip address>/api/ or just /api


b. Message Body – {“devicetype”:”my_hue_app#<replace with any username>”}


c. Press the Hue Bridge Button Once


d. Press PUT on debug Screen


e. Confirm you get a Command Response - You should get a response saying “Success” and “username” followed by a lot of numbers. Copy and save this number, it will be required on HTTP commands.


4. Get all your groups/lights/scenes – Using the debug screen type in the URL /api/<replace with the username number>/groups and press GET. Copy all text and save it, repeat the steps but with /api/<replace with the username number>/lights and /api/<replace with the username number>/scenes. This is so you have reference for later.


5. Test turning ON a group from Zipato – Go to zipato and create a test rule, add an HTTP command and type the following;


a. Method – PUT


b. URL - http://<replacewithyourhueIP>/api/<replacewithuserID>/groups/<replacewithgroupnumber>/action


c. Body - {"on": true}


6. Test turning OFF a group from Zipato – Go to zipato and create a test rule, add an HTTP command and type the following;


a. Method – PUT


b. URL - http://<replacewithyourhueIP>/api/<replacewithuserID>/groups/<replacewithgroupnumber>/action


c. Body - {"on": false}


7. Test recalling a scene from Zipato – Go to zipato and create a test rule, add an HTTP command and type the following;


a. Method – PUT


b. URL - http://<replacewithyourhueIP>/api/<replacewithuserID>/groups/<replacewithgroupnumber>/action


c. Body - {"scene": "<replacewithsceneID>"}, you can find the scene ID for each group on the text saved for the SCENES GET command.


8. Test setting a group on “Color Loop” effect from Zipato – Go to zipato and create a test rule, add an HTTP command and type the following;


a. Method – PUT


b. URL - http://<replacewithyourhueIP>/api/<replacewithuserID>/groups/<replacewithgroupnumber>/action


c. Body - {"on": true,"bri": 254,"effect": "colorloop"}


You can keep browsing the developers site for more reference of how to operate lights, how to set specific colors, etc. I only posted this since I think is the basic commands anyone would like to use on their system. Hope it’s helpful.

Replies (4)

photo
1

Hi, Alberto.

Thank you very much for your time and your initiative.

"ERES UN CRACK"

photo
2

De nada, supuse que seria un buen aporte ya que no hay ejemplos concretos en ninguno de los posts. Saludos Francisco!

photo
photo
1

Thank you very much for your work. Just one question: If one has included the hue system as "Zipato" - devices then your tipp works in addition!? Because you go the direct way via http and this does not interfere with your adivce.

photo
1

No problem. Yes it does, actually I have my hue added to Zipato and both ways work. I did this as a test originally, when I realized is more consistent and there is no need to delete/add again is when I decided to share.

photo
photo
2

Hi everybody, I would point out that to update your hue hub status (e.g. after adding or removing a new bulb), you don't have to remove and then re-add it.

You simply add it as for a new hub, WITHOUT prior deleting it.

Doing so, you refresh the status of your hub in Zipato without losing any setting and without having to update your rules.

I did it a lot of times ;-)

photo
1

Trying to do this, managed to turn on hue from debug screen put command.

Then i try from rule in zipato with http request and it doesent work.


I think it could be port forwarding or firewall related but how can i proceed?


Could also be something wrong in the http request, should header field be empty?


Eny help apreciated, regards

Leave a Comment
 
Attach a file