This may already exist but I couldn’t find it. I know that you can make web requests out but what I would like to do is have an address that I make a web request to and it triggers actions in web core. Currently I have almost all my stuff automated through webcore, however, I do have some diy projects that I have Stringify handling when web requests are fired. Stringify just got purchased by Comcast so I imagine it’s probably about time to get those actions migrated into here.
Web request as a trigger
If I understand what you are asking…
“How can I execute a piston from something outside of webCoRE?”
Open the piston, and use the “External URL”…
Ahhhhhh that is super simple. Thanks guys. I should have known that all mighty webcore has thought of everything!
That is all working fantastic so now I am trying to get webcore to put a post request to call a function on one of my particle photon devices… I do have a device type handler that talks to it okay and achieves stuff but it requires creating a switch in smartthings and somethings I’d just like to run behind the scenes via webcore.
Here is the snapshot of my code that works as a device handler how do I get this entered as a web request in core? Everything I have typed in so far has failed to work.
httpPost(
uri: “https://api.spark.io/v1/devices/${deviceId}/poolon”,
body: [access_token: token, command: relaystate],
) {response -> log.debug (response.data)}
}
basically deviceID and token are variables that are input through the device settings pages… I have replaced those with the actual values in core. Im sure its a stupid format error or something so how would this look in webcore to do the same thing. oh and relaystate is also just a 1 or a 0 based on switch position
so instead of relay state I would like my command to be “away”
Please use something like below. You will have to pass the parametrs as variables in with Content type FORM.