API Priority setting | Color and toggle commands

  • Hey guys,


    unfortunately I am struggling with the API. I have read the json-rpc documentation thoroughly however, I dont seem to get things working the way I hope to.


    I have a few smart relays around my apartment. The one in the living room turns on various lights and I would like for it to also turn on the backlight of the TV (Hyperion) with say a warm white to accompany the other lights in the room.

    In my understanding this could be something like:


    JSON
    {
     "command":"componentstate",
     "componentstate":{
       "component":"LEDDEVICE",
       "state":true
     }
    }


    Question


    - Do I need to fire a second request like:

    JSON
    {
      "command":"color",
      "color":[255,255,200],
      "priority":50
    }

    in order to determine the color of the LED or can I combine both in one payload?



    Question


    - Now, if I turn on my TV, I would like for Hyperion to override the led colors to mirror the media content, completely ignoring whatever signal is sent from the relay, since when I want to watch a movie I'd usually turn off the lights in the room. In this case I would not want the LEDs to turn off ^^


    However, from playing around with the API and reading the documentation it seems that manual colors will always have a higher priority than USB input.


    How can I create a scenario where the TV will always be given priority, and as soon as it is turned off, the LED behavior is handed back to the state of the relay with a pre-determined color (say warm white for instance).


    Any help is much appreciated!

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!