NickW
(Nicholas Wilde)
3
You can trigger a Hello Home action using a REST Endpoint.
Here’s a tutorial on Tasker and ST:
As for the endpoint that incorporates the phrases, look at Ubi - prod SmartApp under the My Apps category.
The code you’d need to add is:
...
path("/phrases") {
action: [
GET: "listPhrases"
]
}
path("/phrases/:phraseName") {
action: [
GET: "executePhrase",
POST: "executePhrase",
]
}
...
def listPhrases() {
location.helloHome.getPhrases().label
}
def executePhrase() {
def phraseName = params.phraseName
if (phraseName)
{
location.helloHome.execute(phraseName)
log.debug "executed phrase: $phraseName"
}
else
{
httpError(404, "Phrase not found")
}
}
1 Like