I am banging my head against a wall trying to figure out how this action actually works.
Since it is a custom function developed by Physical Graph, I was hoping there would be reference API documentation on how it functions, working examples, etc.
I have a kludge working with a SmartApp but am trying to use a local hub action to pull an image from a local camera, and can’t see to get a response.
This platform is supposed to be open, but there is a seriously lacking documentation issue with most functions.
Can someone provide the full command set for physicalgraph.device.HubAction?
I’ve seen it used this way:
def hubAction = [new physicalgraph.device.HubAction(
method: "POST",
path: uri,
body: command,
headers: [Host:getHostAddress(), "Content-Type":"application/x-www-form-urlencoded" ]
), delayAction(1000), refresh()]
hubAction
But trying to subscribe to any response seems impossible without understanding this method furthur.
and this way:
def res = new physicalgraph.device.HubAction("""GET /blah HTTP/1.1\r\nHOST: $ip\r\nAuthorization: Basic $userpass\r\n\r\n""", physicalgraph.device.Protocol.LAN, "${hosthex}")
Can someone provide working examples of how to get basic GET and POST (with or without Authorization) local hub queries?
I spent 5 hours last night desparately trying to do a simple GET to a webcam and return the image. This shouldn’t be this hard and shouldn’t require me to port forward my cameras for it to work.