i have a very simple smartapp that i use to send and receive events from homeseer, but its not working and i must be missing something obvious, but it seems the subscription of events don't work.
so in my preferences section i have
section(title: "Select Devices") {
input "virtualSwitch", "capability.switch", title: "Select Switch", required: true, multiple:false
}
i then have both the updated and installed section call the init() function which contains the following code and subscription
def init() {
state.lastOnChanged = 0
state.lastOffChanged = 0
subscribe(virtualSwitch, "switch", handleEvent)
}
so this calls my handleEvent function when a switch event is recieved
which has the following very simple code
def handleEvent(evt) {
log.debug "Event Value is: ${evt.value}"
def result
if (evt.value == "on")
{
sendOnCommand()
}
else
{
sendOffCommand()
}
}
now i won't go into the next part of code. the handle event has a log.debug command to show the event value.
so now when i install the smartapp i get the following
so as you can see i have a valid subscription and when i turn on and off the switch i get the following in the log after updating the app.
app:862018-05-01 10:55:15.684:debugUpdated with token: xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
app:862018-05-01 10:55:15.683:debugUpdated with Application Id: 86
app:862018-05-01 10:55:15.682:debughttp://xxx.xxx.xxx.xxx/apps/api/86
i then turn on and off the virtual switch. in the logs i receive nothing else and i can see the following in my
AFAIK my code is correct. however the smartapps are not processing events...so there is something broken here.