Official release -
https://github.com/FlyingDiver/Indigo-H ... /tag/2.0.3Pending in the Plugin Store.
Some of the device states have changed names. Proxy devices need to specify the http(s) server they're associated with.
Proxy devices now work as intended. I'll update the Wiki soon. In the meantime, here's the short form:
Set up an http(s) server device.
Create a proxy device and specify the server it's associated with.
Copy the "hook_url" device state and use it to set up the webhook on the server (IFTTT or whatever).
Set up a trigger for "Proxy Request Received" for that Proxy Device.
If you're using a webhook instead of the old setvar method, then the server must me sending you complex data. So you'll need a script to handle it. Here's a command I tested with:
- Code: Select all
curl -k -X POST -d "{u'go': u'back', u'foo': u'bar'}" "https://username:password@kraken.local:5556/webhook-1413643748?foo=bar&go=back"
I put this code in a script action in the trigger:
- Code: Select all
import json
hookdata_json = indigo.devices[1413643748].states["hookdata_json"]
hookdata = json.loads(hookdata_json)
indigo.server.log("request from {} for {}, vars = {}".format(hookdata['request']['client'], hookdata['request']['path'], hookdata['vars']))
indigo.server.log("payload = {}".format(hookdata['payload']))
And got this in the log:
- Code: Select all
Trigger Webhook trigger
Script request from 127.0.0.1 for /webhook-1413643748, vars = {u'go': u'back', u'foo': u'bar'}
Script payload = {u'go': u'back', u'foo': u'bar'}
That should get you started.