Help with JSON control

  • I'm trying to figure out JSON control, but responses back from hyperon are all errors. I am not sure if something isn't enabled - I have no authentication set up. hyperon.ng is running on an i3 nuc (ubuntu). I'm using the Chrome app - Advanced Rest Client.


    following the docs I'm sending the following application/json to http://ip:8090/json-rpc


    [INDENT]{"command":"serverinfo","tan":1}[/INDENT]


    And getting this back:


    [INDENT]{
    "command": "",
    "error": "Errors during message parsing, please consult the Hyperion Log.",
    "success": false,
    "tan": 0
    }[/INDENT]


    log shows:


    Failed to parse json data from JsonRpc@::ffff:192.168.1.216: Error: illegal value at Line: 0, Column: 0

    • Offizieller Beitrag

    @tube0013 Try


    curl -X POST -i http://localhost:8090/json-rpc --data '{"command": "serverinfo", "tan":1}'


    The RPC API is not a REST-API. Do not send Headers.


    The Advanced Rest Client always sends minimum the content header. This is why it fails.

  • Did you figure this out? Lord-Grey, I'm attempting the same thing using the Chrome Rest Client, but I cannot figure out how to prevent headers from being sent.


    I've been searching everywhere trying to find some examples of how to send commands via HTTP in order to control hyperion. Is this not as easy to do as it was with legacy hyperion? I had a smartthings uri switch that I could turn my lights black with and honestly can't figure out anything close to being able to do that at this point.

    • Offizieller Beitrag

    nards1134 Not sure what are you expecting from me. I just provided the background why a solution does not work as it is not fit for purpose.
    There are other options out there e.g. curl, if you would like to test some commands.
    If you like using a Browser Plug-in, the Firefox REST Client works:

  • Sorry, I was just trying to understand better. I do not know anything about json or curl. I was just simply trying to send the command listed in the documention. I have no dev experience but I was trying to use a similar technique that I used with the old hyperion. I could put HTTP://hyperionIP/color/000000 into a browser to turn my leds black (essentially off). This was then put into a smartthings URI switch device so that I could control through Alexa.


    I have no idea how to go about controlling the new hyperion remotely.

  • I've done some researching but it's hard when you don't have a background and really don't know where to start. The remote option is ok but I really need to figure out some automation since I've got a house full. I had my old hyperion switch turn off automatically when the smart outlet on the TV detected a significant voltage drop. Was doing this with webcore. I'm sure there are creative ways to set this up, but I don't have the time I used to have before the plethora of kids.


    Thanks for the input everyone.

  • UPDATE:


    Lord-Grey , all is good now using the REST client from your screenshot in firefox. I was using Advanced Rest Client that tube0013 was using in chrome. Guess it's not out of the box ready.


    Now on to figuring out how to pull this into Smartthings, or Alexa!

Jetzt mitmachen!

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