Control Hyperion through a small web server


  • And like i said, something stupid simple, that worked! More upset now that i didnt see that. Now i just gotta get my pi's accessible from google home outside the network.


    Thank you thank you thank you!

  • You are most welcome - glad it worked!


    Can't help you with the rest, no idea how Google Home works. My SmartThings hub is on my local network, so it can call the endpoint directly. You are probably going to have to open a hole in your firewall and port forward from your router to port 8080 on your Pi's internal IP address. Good luck!


    milhouse

  • You are most welcome - glad it worked!


    Can't help you with the rest, no idea how Google Home works. My SmartThings hub is on my local network, so it can call the endpoint directly. You are probably going to have to open a hole in your firewall and port forward from your router to port 8080 on your Pi's internal IP address. Good luck!


    milhouse


    Yep, i've got that part working now. Now i just have to set up different recipes on ifttt. Right now its just set to the one effect and i can have it set any color i specify. One thing to note is that google does not capitalize the words said so it calls /effect/candle instead of effect/Candle. I could rename all my effects to all lower case, but figure its probably just as easy to set a recipe for the few i actually want to use via voice. I do want to go in and create an option to control the brightness. Then i will have to go back and redo my pi setup on my tv to openelec and run the same.

  • milhouse, if you're still around, I wanted to reach out here bc something happened a couple months ago and for the life of me I cannot figure out the issue.


    I have not changed anything on my setup, yet I can no longer send HTTP commands to my rasp pi hyperion server. Hyperion and the web control/remote still work just fine. I've tried reinstalling bottle and bottledaemon (though I'm not sure if I should have done a clean uninstall). I also checked for leftover files that need to be cleaned up.


    I think my main problem is I do not know how to troubleshoot why the server will not accept requests or that it is even running properly on the pi. Is there something on the pi I can do to confirm this?


    Here's the same command I've always used after rebooting my pi:



    Here's the expected web message I'm getting.




    Just hoping someone can help with an idea as not being able to automate this is killing me!

    • Offizieller Beitrag

    nards1134 There is no need using a WebServer to trigger hyperion-remote any longer.

    You can now directly control Hyperion.NG via JSON-API commands.

    Just have a look at the documentation.

  • Thanks, but I'm not really sure how to do that. Is it a simple URL that I can put into my browser? I was previously using an HTTP switch inside Smartthings.


    I'm somewhat technical but do not fully understand the concept behind JSON and how to send commands.


    To clarify, I'm simply looking to create a virtual HTTP switch (this part I know how to do) where I can send a URL that disables Hyperion (or sends a black color command) when switched off. I've tried following the JSON instructions but I believe I would need a console to post those commands. In addition, I've turned off API authentication and I'm getting "no authorization" issues. I tried turning on and creating a token but still no luck.

    • Offizieller Beitrag

    Sample of using “http bot” on iOS


    First screen you give the url and the POST command, and the Params/Post Data section, you provide the JSON command.

    • Offizieller Beitrag

    Here is another sample with iOS shortcuts


    You can use command = system and subcommand = suspend to put Hyperion to bed and wake it up with subcommand = resume


    You can also use subcommand = toggleSuspend

    Then you have a toggle button…


    Sorry that the screens are in German, but I am confident that you will figure it out :)

  • Thanks for suggestions all. It still may be a bit too advanced for me. I'm mostly android, although I do have an iPad that I could potentially use for this.


    I'd really love some method I could setup using my imac or even on the pi itself that runs hyperion. I'm not sure why the bottle server method stopped working. I've tried reinstalling it to no avail, and there are no files to clean up anymore so that tells me that maybe it's not even starting up anymore.


    Basically I was hoping to be able to pop a URL into Smartthings HTTP switch as I used to do. This way I can automate it using the power meter smart plug on my TV. When it detects a certain amount of power, turn on Hyperion. Currently I have a shortcut to the remote and I just open it on my phone and turn it on. I'm not sure if trying to use HTTP bot on iOS gives me any real advantage over that other than maybe one less click?

    • Offizieller Beitrag

    Hey Lord-Grey,

    question to your post #29
    I´ve multiple instances, so is it possible to send this POST command for a definied instance? In normal case I start my hyperion with "command = system" but in a few times I must start an instace manuell.

    So you have a solution for me?

    Thx Joe

    bananajoe86


    The suspend and resume sub-command should stop or start all components for all instances.
    Depending on the LED type, the LED device requires retries to get active....
    I would suggest you first explore what has been written to the log, why one or another instance did not resume successfully.

    Then you (or we) can fix the root cause..... or you have a good explanation why you just need being more patient :)


    Besides that you are able to run API commands against a selected instance.

    Unfortunately, you need to run two commands via the same session. First the instance selection and second the command.
    Most standard tools do not support that kind of http command chaining.
    An alternative option is to use WebSockets and issue both command via the same WebSocket established.


    Note: System commands are on system and NOT on instance basis.

    • Offizieller Beitrag

    Basically I was hoping to be able to pop a URL into Smartthings HTTP switch as I used to do.

    A pure url incl. a command is currently not supported.

    'm mostly android, although I do have an iPad that I could potentially use for this.

    The screenshots are there to give you an idea about the concept. Similar apps are available on Android.
    There is no need to have an iOS device to make use of Hyperion's API.

  • Lord-Grey, are you 100% sure that this is not possible anymore, even with the instructions by milhouse? Did something change with Hyperion that disables or does not allow the bottledaemon to function? The original point of this thread was using a RaspPI setup and giving the ability to send an http command. I was using this fine up until a few months ago.


    I do not understand what would have changed, but I can say for sure everything was working fine. I do not know how to test whether the server is running on my Pi and I have not gone through the process of starting from scratch (which I may consider). I don't think the JSON is an option for me bc I do not know how to program and create an automation with my ST hub. The easiest option is using the Hyperion remote on my phone at the moment.

Jetzt mitmachen!

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