WebIOPi and Harmony Hub

207 Views Asked by At

My end goal here is to turn on my tv using my Pi. I've already setup and configured everything I can think of, I can access the pi remotely via http, but I constantly get a 404 when trying to call a macro via the REST API. Script runs fine on its own, just can't seem to be called from http.

At this point, I'd take any solution that can be executed via http. Php, cgi, etc, don't care, I just need it to run beside the current setup.

Added to config file as follows:

myscript = /home/pi/harmony.py

harmony.py

import webiopi
import sys
import os
@webiopi.macro
def HarAll():
    os.system("/home/pi/Desktop/harmonycontrol/HarmonyHubControl [email protected] passwort start_activity 6463490")

When I attempt to access http://piaddress:8000/macros/HarAll I get a 404. I'm positive I'm missing a step here, for some reason, webIOPi simply isn't adding the macro to the web server.

1

There are 1 best solutions below

0
Justin Piercey On

Got it figured out, this whole time I was trying to test it instead of just adding it to the app I made, I was sending http GET from web browser instead of http POST. Works perfectly.