Although the iOS SDK for Philips Hue is perfectly simple to use, the world of json is new to me. Can I (and how do I) send json to the Hue bridge directly from a mac Terminal?
Asked
Active
Viewed 1,941 times
2
-
take a look at `curl` – Sam Axe Jan 09 '14 at 07:45
1 Answers
2
You need to know the IP address of your bridge. Usually you can see it on this page: https://www.meethue.com/api/nupnp
Once you have that you can create a new user for yourself on your bridge (note the escaping of quotes):
curl -X POST -d "{\"devicetype\":\"Console\",\"username\":\"yourusername\"}" http://<yourbridgeip>/api
From then on you can turn on your lights with something like this:
curl -X PUT -d "{\"on\":true}" http://<yourbridgeip>/api/yourusername/groups/0/action
See http://developers.meethue.com/ for other examples.

Christiaan
- 2,637
- 21
- 26
-
this is a correct answer. See: https://developers.meethue.com/develop/get-started-2/ – ranemirusG Aug 31 '23 at 01:29