rudders / homebridge-http

HTTP Plugin for Homebridge
Apache License 2.0
178 stars 109 forks source link

How can i run a php site just like i would do with a browser? #5

Closed Gazura36 closed 8 years ago

Gazura36 commented 8 years ago

I just want to trigger my internal php script so that i can control my already existing actions via Siri. What do I have to do?

rudders commented 8 years ago

You should be able to add the URLs you normally use into this plugin as per the sample_config.json.

What are the urls you would normally want to call?

Gazura36 commented 8 years ago

The URL looks like this: http://192.168.1.109/insidetemppush.php Where can I edit the text I say to trigger the command and where is Siri‘s answer defined?

rudders commented 8 years ago

You need to do some research on Homekit. Essentially you use homebridge and home bridge-http together to create an "accessory". The in an iOS app such as Insteon+ you can add the Homebridge and your new Accessory. Once iOS knows you have homekit going you will be able to address the accessory by name or configure a Scene which includes your accessory.

For instance with this config you could say "Turn on My Thing" or set My Thing to 50% (singing brightness_url)

{
    "bridge": {
        "name": "Homebridge",
        "username": "CC:22:33:E3:CE:30",
        "port": 51826,
        "pin": "031-55-156"
    },

    "description": "My Homebridge!",

    "platforms": [],

    "accessories": [
        {
            "accessory": "Http",
            "name": "My Thing",
            "on_url": "http://192.168.1.109/insidetemppush.php", // (ideally pass parameters here!)
            "on_body": "{\"state\":\"On\"}",
            "off_url": "http://192.168.1.109/insidetemppush.php",
            "off_body": "{\"state\":\"Off\"}",
            "brightness_url": "http://192.168.1.109/insidetemppush.php",
        "username": "",
        "password": "",
        "sendimmediately": "",
            "http_method": "POST",
            "http_brightness_method": "POST",
        "service": "Switch",
        "brightnessHandling": "no"
        }
    ]
}```