I’m trying to make the simplest SmartApp I can and have it run in the simulator. No matter what I try I get “Access is denied”.
definition(
name: “simple”,
namespace: “nkijak”,
author: “Nick Kijak”,
description: “hello world”,
category: “Convenience”,
iconUrl: “https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png”,
iconX2Url: “https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png”,
iconX3Url: “https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png”,
oauth: [displayName: “SimpleStatus”, displayLink: “”])
preferences {
section (“Allow external service to control these things…”) {
input “switches”, “capability.switch”, multiple: true, required: true
}
}
mappings {
path(“/state”) {
action: [
GET: “listState”
]
}
}
def installed() {
log.debug “installing”
subscribe(switches, “switch”, handleSwitchEvent)
}
def updated() {
unsubscribe()
subscribe(switches, “switch”, handleSwitchEvent)
}
def handleSwitchEvent(e) {
logField(e) { it.toString() }
}
def listState() {
log.debug “listing state”
def resp =
switches.each { resp << it }
return resp
}
private logField(evt, Closure c) {
log.debug “The souce of this event is ${evt.source} and it was ${evt.id}”
}
I created a new location with just a switch. I’m using the token and URL from the bottom of the simulator. I don’t see any errors in the logs when “operating” the switch in the simulator.