Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Philips Hue

  1. #1
    Automated Home Sr Member
    Join Date
    Jul 2004
    Posts
    57

    Default Philips Hue

    Hi all,

    I've just purchased a Philips Hue bridge which allows my three existing Philips LivingColors LED lights to be controlled via REST HTTP calls (and an iPad!). Before setting off on a Christmas project to rustle up a python xAP/Hue interface so I can use them with Cortex, has anyone done this before?

    My alternative is to use a simple command line tool to control the lights which is called from a macro, but that doesn't seem very elegant, any other ideas?

  2. #2
    Automated Home Legend Karam's Avatar
    Join Date
    Mar 2005
    Posts
    863

    Default

    Cortex API? But then xAP route might be just as good. If using macro type method might be worth linking to the state of a virtual light object to give some aspects of automation. Of course if someone changes light states via an external application then things will get in a mess.

  3. #3
    Automated Home Ninja Andrew Millne's Avatar
    Join Date
    Nov 2007
    Posts
    269

    Default

    Did you make any progress with this pbj? I'm looking to do something similar but some native Cortex support for Hue would be great if possible. http://www.developers.meethue.com/tools-and-sdks

  4. #4
    Automated Home Ninja Andrew Millne's Avatar
    Join Date
    Nov 2007
    Posts
    269

    Default

    I made a start on this but unfortunately the hue API requires the PUT method to be used and the Cortex API only allows for Get and POST. Also rather than a key/value list would it be possible to get a raw message body area?

    For a post request...

    Sent
    http://192.168.1.140/api/myapikey/li.../state?on=true

    HTTP/1.1 400 Bad request

    PUT requests made outside of cortex are working correctly.

    DELETE method is also used in the hue API but I haven't come across a need for it yet

  5. #5
    Automated Home Sr Member
    Join Date
    Jul 2004
    Posts
    57

    Default

    Hi Andrew,

    I ended up using powerscript to create a command line. It's not terribly elegant, but does the job. Of course that means there's no possibility of feedback from the light, but I don't think the Hue offers that anyway.

    Peter

  6. #6
    Automated Home Ninja Andrew Millne's Avatar
    Join Date
    Nov 2007
    Posts
    269

    Default

    The Hue API does feature a JSON response with "success" reported on a successful command.

    Aside from the issue of no PUT/DELETE, I only seem to be encountering one other minor issue with the lights. I've replaced some of the lamps on a QLD circuit with hue bulbs and occasionally they don't want to come on even though I've reset the rates to immediate. No amount of toggling the circuit on/off brings the bulb back to life, I have to take the bulb out of the holder and pop it back in. I don't have this issue with lamps on a relay switched circuit. With API support in Cortex I hope I'll be able to overcome this by leaving the dimmer circuit on all the time and adding a virtual light object to send on/off api commands to the hue lamps to retain the occupancy sensing capabilities of Cortex. This should also allow me to automate some other desk/floor lamps around the house where I neglected to install Idratek switched sockets.

    I'm on hold until if/when we can get PUT/DELETE support in the cortex API however. Karam?

  7. #7
    Automated Home Legend Karam's Avatar
    Join Date
    Mar 2005
    Posts
    863

    Default

    Ok we'll look into it. My guess with these things is - never as simple as it sounds

  8. #8
    Automated Home Ninja Andrew Millne's Avatar
    Join Date
    Nov 2007
    Posts
    269

    Default

    Quote Originally Posted by Karam View Post
    Ok we'll look into it. My guess with these things is - never as simple as it sounds
    Thanks, much appreciated.

  9. #9
    Automated Home Legend Karam's Avatar
    Join Date
    Mar 2005
    Posts
    863

    Default

    Forgot to answer the other question. All I can guess at is it might be due to the current leakage through the output filter capacitors. If, for experimental purposes and you have some soldering capability, you want disconnect these then e-mail me for instructions. LED loads are very different to incandescent so my quick guess is that disconnection will not have a significant effect on the filtering characteristic anyway.

  10. #10
    Automated Home Ninja Viv's Avatar
    Join Date
    Dec 2004
    Posts
    284

    Default

    We have a development version which allows the 'PUT' command.
    Also allows 'Body Text' to be defined as required.
    Changes have also be made to decode a json array as the first element.

    Cortex release will be updated soon with the latest changes.

    Thanks to Andrew for his help testing.

    Viv

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •