
Philips Hue API Hacking - craigkerstiens
http://www.issackelly.com/blog/2012/11/10/philips-hue-api-hacking/
======
izak30
As an aside, What I really need for this system is a wall-switch that doesn't
clobber the state. Right now if you cut power completely (use the wall switch)
it loses all it's last settings and turns into roughly the visual equivalent
of a 60w incandescent bulb.

I'm trying to decide the best way to do this, the easiest would be a raspberry
pi. I'm thinking there must be some way to do it with a much ligher thing like
a xbee module.

------
remcoder
Nice work! I work at Q42 and we wrote some of the (web) software for the Hue
platform. As you might guess we're great fans of Hue and we have lots of lamps
in the office to play with (<http://www.w00tcamp.nl/image/36420335853>).

Anyway, just wanted to say that I put up a list of Hue libraries on github:
<https://github.com/Q42/hue-libs>

I added python-hue as the first entry.

To everyone else: Send us a pr if you want to get your lib on the list. Would
be cool to see support for Ruby, Scale, Closure, Haskell etc ;-)

~~~
w0utert
I like how the building says 'Huelands Spoor', I guess you're located pretty
close to the train station ('Hollands Spoor' for those not familiar with the
train stations near The Hague in the Netherlands) ;-)

~~~
remcoder
in fact you can control the lights in our office yourself using this website:
<http://www.huelandsspoor.nl/>

------
kevingadd
Why does the Hue class have an argumentless constructor that must immediately
be followed up with attribute initialization and a call to the _actual_
constructor? Kind of a nitpick, but definitely doesn't seem pythonic - or
obvious.

Cool hack though, API looks straightforward.

~~~
izak30
I haven't gotten around to writing an application with it yet, just futzing
from the terminal. I agree that it's a wart, I pretty much stopped once I got
it all working here, and until tonight I haven't had much outside interest in
this one.

~~~
timClicks
I would also change h.lights.get('l3') to h.lights[l3] by defining
__getitem__(). Possibly even cut this back to h[13], as you'll always be
referring to the lights.

~~~
masklinn
And setState should probably take kwargs rather than a dict of arguments.
Might also be cool to use a context manager for a "complex send" e.g.

    
    
        with light:
            light.bri(220)
            light.alert("select")
    

which would only send the whole request at once in __exit__, as in
"transactional" APIs.

~~~
izak30
I do really like this one. Been trying to think of a decent way to do
pipelining. If you haven't noticed, it is possible to do chaining with the
existing API, but it's one request/call.

------
burgestrand-
There’s been efforts to map out the Hue API. I’ve created a GitHub repository
for documenting the API, and host it via GitHub pages:
<http://burgestrand.github.com/hue-api/>

Through the README there’s additional links to other resources, such as the
EveryHue forum, where people from the Hue developer team appear to hang out as
well: <http://www.everyhue.com/?page_id=38>

------
codewright
It just so happens that I met Issac Kelly (the author of the post) three or
four years ago at a coffeeshop in Columbus, nearby the Short North I think.

Spoke mostly about entrepreneurship, .NET, and Python. Nice guy.

I'm mostly tinkering with Clojure these days, but the day job so to speak is
Python. No more .NET anymore :)

I moved to the bay area too!

About the post:

You mentioned that you were disappointed in the security of their
straightforward HTTP/REST implementation, what do you think would've been more
secure?

~~~
izak30
The security issue is that they're sending my data back to their sites (phone
homes) via HTTP not HTTPS. Schedules, on/off status and device hashes. At that
point if you had the traffic it would be fairly trivial to pretend you were
one of my registered devices locally (this is how I did initial testing),
possibly even over the internet back to Hue (not tested, as their webservice
hasn't quite worked for me in normal circumstances)

Also, reintroduce yourself! Coffee in Columbus talking shop doesn't narrow it
down enough for me.

------
derwildemomo
A friend of mine hacked something quite nice for/using his Hue.
<http://vimeo.com/54065245>.

------
remcoder
Here are some clips showing how we heuified the office:

strobe effect <http://www.youtube.com/watch?v=CVh4V5QyVQY>

remote control <http://vimeo.com/54163866>

------
lumawake
WeMo and Hue...looks like we have much in common ;)
[http://blog.lumawake.com/post/37648185851/ask-and-you-
shall-...](http://blog.lumawake.com/post/37648185851/ask-and-you-shall-
receive-after-dozens-of)

------
acqq
Does anybody know what the response times of commands is? Is it possible to
make a disco-like light show controlled by music or are response times too
long?

