Support for Philips Hue System (1 Viewer)

pur_berger

Super User
  • Team MediaPortal
  • Super User
  • May 14, 2007
    1,679
    309
    52
    Vienna
    Home Country
    Austria Austria
    Ah - why do you need to send the on commend anyway - if I understand correct you only need it one time to turn the lights on and only the color afterwards.The title in the API List of the commend is

    //Turn the light on and set a Hex color for the command

    and in the FAQ it says "Don’t always send ‘ON’ Once you have sent the ‘ON’ attribute to a light", so

    SetColor(color)

    should be enough?

    And as (at least I) have a group of lights (1 RGB Stribe and one Bloom or what's it called) only 1 command / second is fine - otherwise overflow.

    But I can't code at all only trying to understand wht the docu says :)


    Over All I have the feeling that only Red or Red like colors are displayed correct. That's why I thought that maybe the RGB - 2D conversion is not working as it should - I understood that there are some formuals needed to do this

    http://stackoverflow.com/questions/22564187/rgb-to-philips-hue-hsb/22649803#22649803

    as it also describes to make green and blue more vivid
     

    Rick164

    MP Donator
  • Premium Supporter
  • January 7, 2006
    1,335
    1,006
    Home Country
    Netherlands Netherlands
    SetColor should indeed be enough but would need a few adjustments, will be changed in the next version and hopefully that will work as expected :)

    The color remapping code is very nice, apparently it's common and Philips doesn't go into much detail so somebody fixed it themselves.
    Will need to check and see how it would fit in nicely but don't see why we can't add it in the next version.

    Thanks for the help btw, some things I need to figure out while coding and finding good docs and examples do help :)
    Writing in Python might have been easier as there are tons of examples for it out there while most of the C# libraries (except Q42) I'm finding are either incomplete or have a large code base which makes it harder to integrate as in no docs / lots of code for simple commands etc..

    Gonna publish the current version a little earlier, this doesn't have all the changes yet but you can test it out:

    Changelog

    - Re-use ColorCommand, in theory should work but dunno if the Hue Bridge needs a new command every time so needs testing.
    - Small change to SSDP bridge locator which will hopefully solve connectivity issues.
    - Output BridgeIP to log on color send, debug function as I want to know if something is wrong there.
    - use Color.TurnOn() only once to start up color sending.
    - Normalize Bridge IP to prevent connection errors, for now only removes ":80" to comply with Q42 API.

    Download AtmoHue 0.0014
    http://1drv.ms/1woldUE
     
    Last edited:

    pur_berger

    Super User
  • Team MediaPortal
  • Super User
  • May 14, 2007
    1,679
    309
    52
    Vienna
    Home Country
    Austria Austria
    You are the hero here ss you do the coding:)

    Im on the road and have no access till Monday evening but looking forward to test it then.
     

    pur_berger

    Super User
  • Team MediaPortal
  • Super User
  • May 14, 2007
    1,679
    309
    52
    Vienna
    Home Country
    Austria Austria
    hm - not working as expected. When using color rotation ( the buidl in) teh transition time is as long as ever - but I would assume it's still sending on all the time. For the atmowinpart it turns off teh light after the first command - and won't turn on again (as teh on function isn't thereanymore).

    The question is why is it turniong off? When I restart teh application its turning it on but only for the first input,
     

    Rick164

    MP Donator
  • Premium Supporter
  • January 7, 2006
    1,335
    1,006
    Home Country
    Netherlands Netherlands
    Think it's due to the re-use of the Command object, reverted that change and new version is below :)

    Also we're currently reworking Atmolight so that it fully supports Hyperion and test version for it already works very well, only downside of Hyperion is that it only supports one device at a time (Hue or LED strips) but that might change in the future as it's on their to-do list.
    So for Mediaportal that would be the better solution I think however Hyperion does require more time to setup properly.

    Changelog

    - Removed re-use of ColorCommand

    Download AtmoHue 0.0015
    http://1drv.ms/1rqfw2j
     
    Last edited:

    pur_berger

    Super User
  • Team MediaPortal
  • Super User
  • May 14, 2007
    1,679
    309
    52
    Vienna
    Home Country
    Austria Austria
    OK - seems to be a little faster - when using now 2250 the delay between sending the color and displaying on the light seems to be smaller - but still far away from 1000ms. But defenitkly going in the right direction :). THX!
     

    Rick164

    MP Donator
  • Premium Supporter
  • January 7, 2006
    1,335
    1,006
    Home Country
    Netherlands Netherlands
    Thanks, next up is getting some timers in the logger so we can measure the delays a bit better.
    Gonna get myself a Hue device soon so can test it here as well, new version will be up in the next couple of days.
     

    Users who are viewing this thread

    Top Bottom