The weird part, other than that it use to work, is that it always responds to Off, but not On. If I comment out statusCheck, it responds to both On and Off (by the way, if statusCheck is included, the debug line never executes). Lastly, regardless of what statusCheck does (i.e. an empty function or something useful), if it’s there, On’s do not execute (no errors, no debug statements, nothing). Removing and reinstalling the smart app didn’t fix it either.
Sorry to correct you, but not a known issue with SmartApps.
The known issues that your link refers to points out issues with routines controlling devices, email issues, etc. (although they’re fine now according to the status page).
Thanks, @JDRoberts, but the status page makes no mention of my issue. I would expect it to show up under SmartApp execution.
It was both smartapps and routines, although the status page announcement only mentioned routines, the thread I linked to discusses both and gave a smartapp example in a screen shot. You make be seeing yet another problem, that’s always possible.
I think @ady624 ran into a similar issue, couple of weeks ago, but it was supposed to be fixed. I looked for the conversation on the CoRE thread, but I couldn’t find it. Maybe Ady can chime in.
Other than statusCheck, yes, it’s all the code. Any function called causes the On to fail 100% of the time - none of the code executes (not even the debug line). I can call statusCheck with nothing in it other than a debug statement (or empty for that matter) and it will fail to run (I tried it). BUT Off always works - 100% success (???).
I had stripped virtually everything out as shown below and it was failing.
I should have tried this earlier, but creating a new app and pasting in the original code, and (now) it works. Somehow an error or corruption occurred and was associated with the original app. When I came home I noticed that off worked, but on didn’t. I checked live logging and noticed that on appeared not to fire. I wish I knew what caused the corruption. Thanks for the help.
One thing I noticed, during the three months I’ve had ST (wow, just three months) - if you try to set a “wrapper” into the state, the whole app fails with NO logs, NO errors, NO nothing. Make sure you’re not saving a Device, an Event, a SmartApp, etc. into any state variables. If you do…
If you copy the non-stripped version into a new SmartApp, does it work?
Yes. Copying the exact code and pasting as a new app - Yes. I had deleted it from the mobile app and re-installed - didn’t work. Sorry. I should have deleted the SmartApp from the IDE and re-added it.
I wasn’t trying to set a wrapper - thanks for the heads up.
I can get the Off to execute, but the On won’'t execute if there is anything in the function other than a debug statement. I noticed the issue today. It worked yesterday for me. The code has worked for over a year.
Interesting,do you have a similar situation where you have 2 different groups of devices with the same capability? Where the handler works for one set but not the other?
I do. I did get my issue fixed (at least for now). Deleting the app from the IDE, re-adding it, and subsequently re-installing it fixed my issue. All of which would imply some sort of corruption (in the cloud).
Why are you subscribing to two sets of the same capability type for the same method. In theory that should work but try consolidating. If that works we’ve found a bug but will have fixed your issue.