JSON-Server not working

  • Hi everybody,


    yesterday i installed my hyperion completly new on a raspberry 4.

    I used the raspberry os and the installation information from the user manual (-> RPi/Debian/Ubuntu)

    Every works fine including controlling the WLED!


    Then I tried to control my hyperion with the Openhab-Binding für Hyperion, which uses the json server. The problem is, that it doesnot work.


    OK - I saw in the debug log in hyperion, that there is a new connection and then closed:

    2022-02-03T09:14:38.820Z [ JSONSERVER] (DEBUG) (JsonServer.cpp:121:closedConnection()) Connection closed for ::ffff:192.168.178.xx
    2022-02-03T09:14:41.821Z [ JSONSERVER] (DEBUG) (JsonServer.cpp:105:newConnection()) New connection from: ::ffff:192.168.178.xx
    2022-02-03T09:14:41.839Z [ JSONSERVER] (DEBUG) (JsonServer.cpp:121:closedConnection()) Connection closed for ::ffff:192.168.178.xx
    2022-02-03T09:14:44.855Z [ JSONSERVER] (DEBUG) (JsonServer.cpp:105:newConnection()) New connection from: ::ffff:192.168.178.xx
    2022-02-03T09:14:44.871Z [ JSONSERVER] (DEBUG) (JsonServer.cpp:121:closedConnection()) Connection closed for ::ffff:192.168.178.xx
    2022-02-03T09:14:47.873Z [ JSONSERVER] (DEBUG) (JsonServer.cpp:105:newConnection()) New connection from: ::ffff:192.168.178.xx


    then i tried to control the hyperion using the json interface as described in the user manual

    -> https://docs.hyperion-project.org/en/json/#http-s-json


    But I get the 404 error ..


    Could it be possible, that the json-server is not runing?

    How could I start the json server?


    Many thanks in advanced,

    Andreas


    PS: I tried to solve it with the manual and with google, but I can't find any real solution :(

    • Offizieller Beitrag

    I just tested with openHAB myself and everything works...
    Doing updates on setting Color (see screenshot) works.

    openHAB opens and closes everytime the session for one command. That is ok.



    Have you tested that your LED Device works in general, using Hyperions Remote-Control to set a color or effect?
    Is openHAB Brightness > 0?


    On the 404 http error:
    I guess you are using the API wrongly....

    Just try with the following command:

    curl -X POST -i 'http://ubuntu2004.fritz.box:8090/json-rpc' --data '{"command" : "sysinfo"}'

    Replace "ubuntu2004.fritz.box" with the hyperion's server name or IP-address

  • Many thanks for your answer!


    1) It was my fault - the json server is working if i use the curl command .. i get some system information ..


    2) in Openhab i can switch the e.g. LED from "on" to "off" - but after a few seconds it switches automatically back to the initial state "on"


    in the meantime i restarted hyperion and I also reinstalled the hyperion binding .. i always get the same as described in 2)


    I also tried to switch on/off the led device using json:

    curl -X POST -i 'http://192.168.178.XXX:8090/json-rpc' --data '{"command":"componentstate","componentstate":{"component":"LEDDEVICE","state":false}}'

    => that works :)


    .. perhaps anybody knows a solution for the openhab binding in this forum .. but I guess I will go to openhab forum ..

Jetzt mitmachen!

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