Using my SHM Delay Beta app that was modified to work with STHM in new app, a user reported that Child app profiles created in new app, specifically User keypad pin codes, are created but do not function with the SHM Delay application. I suspect this also applies to all child profiles used by SHM Delay.
I followed up by trying this on my Android 9 phone and noticed the following:
User Pin Child Profile is created in new app, but does not function with the SHM Delay Smartapp
The smartapp’s logic to automatically generate a profile name does not function in new app
The new app’s Child Profile does not show in Classic app
Child profiles created in Classic work in new app
Live logging had no errors
How can this be reported to the SmartThings staff for resolution?
I looked at my code and found some logic in a number of places where the child app is checked to be complete. There was a bug in Classic so I made changes as shown below, however nothing changed. User Profiles (Child apps) created in the new ST app still do not show up in Classic and fail to function when used, meaning the pin code is rejected.
Sample original code used with Classic
if (app.getInstallationState() == ‘COMPLETE’) //note documentation shows as lower case, but returns upper
changed to
if (app.getInstallationState().toUpperCase() == ‘COMPLETE’) //note documentation shows as lower case, but returns upper
While testing today I found the SHM status was not updated to armed when I armed from a keypad. I found this in modefix that is the likely culprit, reverted to using Routines and all is working again. However to fix it I need to know if the app is running in the Classic app or the New ST app. I assume the Groovy smartapps run from the same source and definitions in two separate virtual machines, but that is just a guess.
def theAlarm = evt.value //off, stay, or away Alarm Mode set by event value
def fromST=true //event is assumed from Smarthings subscribe till proven otherwise
try
{
if (evt.childid)
fromST=false
}
catch (e)
{}
Questions
How do I access / view the new ST app’s error log?
How do I determine if the app is running in Classic or the new ST app?
RBoy
(www.rboyapps.com - Making SmartThings Easy!)
5
I believe SmartApps run in the ST Cloud. The Classic app and new ST app are just UI front ends to configure the SmartApp and display the notifications Etc.
Put some debugging code into the SHM Delay app and found the reason why child apps created in new ST app fail to be used with my logic:
They are created with an INCOMPLETE status in new ST app, my app uses only COMPLETE status
Additionally I found deleting the Incomplete child app in new ST app does not appear to fully delete the child app in Classic. Once deleted It does not show in either app, but it shows in the app’s debugging log after it’s deleted when the User child app’s are searched for the pin number entered on the keypad.
3:41:20 PM: debug user data INCOMPLETE SHM Delay User 9099 Testing (Created with new ST app)
3:41:20 PM: debug user data COMPLETE SHM Delay User 9999 Panic Pin (Created with Classic app)
Status of child apps created in new ST app
User - INCOMPLETE
Delay Child - INCOMPLETE
Talker - COMPLETE
Modefix - did not delete and recreate. Remained COMPLETE after update
no idea why INCOMPLETE is occurring
Update: INCOMPLETE occurs because the def Installed() routine is not executed, nor is def Updated executed on an update.