[NG] JSON Server not fully implemented?

  • I started playing with the Json server yesterday with a view to use it to remote control Hyperion.
    https://docs.hyperion-project.org/en/json/
    Is the Json Server complete and working? I'm getting unexpected results:




  • I have "First LED Hardware Instance" and "TV Test 1".


    I have "Selected instance: TV Test 1" in the GUI.


    I'm new to hyperion, so i'm not 100% if that's what you mean by "hyperion instance".


    Sorry for being noob ;) We all start somewhere, some time!

  • Ok, i sent this:

    Code
    {
      "command" : "instance",
      "subcommand" : "switchTo",
      "instance" : 1
    }


    and now it is responding to my commands. :) The docs state that the "It's possible that an instance will stop while you are connected". What does this mean? Why would an instance stop?

  • I've created a token and enabled "Local API Authentication", but i am able to control Hyperion via json without passing the token.


    The need for authentication seems to be ignored?

  • I'm still working on this.


    I'm trying to send TCP packets to port 19444 (the port defined in Network settings for JSON Server).


    I can send led device on/off commands to the default instance (instance 0), but cannot control instance 1.


    Select instance 0 in the webgui, then go to dashboard and watch "LED Device"


    Send:
    {"command": "componentstate","componentstate": {"component": "LEDDEVICE", "state": true}}\n


    {"command": "componentstate","componentstate": {"component": "LEDDEVICE", "state": false}}\n


    The LED device turns on then off.


    Now select instance 1 in the GUI and send:


    {"command": "instance","subcommand": "switchTo","instance": 1}\n


    {"command": "componentstate","componentstate": {"component": "LEDDEVICE", "state": true}}\n


    {"command": "componentstate","componentstate": {"component": "LEDDEVICE", "state": false}}\n


    The instance doesn't turn on/off.


    This process works for POST to http://192.168.1.95:8090/json-rpc, but doesn't seem to work for TCP.


    I'm using "packet Sender" to send TCP: https://packetsender.com/#Download

    Edited 2 times, last by jjuk ().

  • It's either order or timing. Try sending it all at once. This is what works for me:
    {"command":"instance","instance":1,"subcommand":"switchTo"}\n{"command":"componentstate","componentstate":{"component":"LEDDEVICE","state":true}}\n

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!