New app issue with Parent Child App Profiles

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:

  1. User Pin Child Profile is created in new app, but does not function with the SHM Delay Smartapp
  2. The smartapp’s logic to automatically generate a profile name does not function in new app
  3. The new app’s Child Profile does not show in Classic app
  4. Child profiles created in Classic work in new app
  5. Live logging had no errors

How can this be reported to the SmartThings staff for resolution?

tag: @oldcomputerwiz

Tagging @jody.albritton

Thank you JD for tagging Jodi.

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

  1. How do I access / view the new ST app’s error log?

  2. How do I determine if the app is running in Classic or the new ST app?

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.

1 Like

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)

@jody.albritton @JDRoberts @oldcomputerwiz

It seems like a silent back end change was made in the cloud.

  1. User profiles (child apps) including INCOMPLETE, created in the new ST app now show in Classic
  2. The incomplete User child app after being saved in Classic shows as COMPLETE, then functions normally
  3. The code for setting Child App name continues to fail

Looks like someone might be monitoring the forum?

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.

def installed() {
	log.debug "Installed with settings: ${settings}"
	initialize()
}

def updated() {
	log.debug "Updated with settings: ${settings}"
	unsubscribe()
	initialize()
}

Should ST employees be monitoring this thread, source code is at this link

Tag @jody.albritton @Brad_ST