Child apps can't be added to Parent when they are on the first Preference page

smartapp
childsmartapp

(Ryan Urabe) #1

I’m running into an error with a Parent/Child app. Bit of a weird error.

If I put the child apps on the second page of my parent’s preferences, everything works fine. But when I try to put the child apps on the first page of my parent’s preferences, I enter all the child preferences and hit “save”, and it tells me “Error saving page”.

What’s weirder, if I create the parent with no children, save it, then go back and edit the parent to add children, everything works fine as well.

Based on that, and looking at the live logging, it seems like the error might be related to the child trying to get created before the parent? And that somehow putting the children on the second page creates the parent upon finishing the first page of preferences and gets around that?

Am I missing anything here? Has anyone else ever had this problem?

These are the logs when the children are on the first page. I tried 3 times to save the child (all failed), then just saved the parent with no children, then went back in and added the child from the edit page.

dd3cc93a-8574-4314-a5d8-592a806ae66d  7:00:29 PM: debug Updated with settings: [valve:Front Yard Irrigation, frequency:72, duration:120]
dd3cc93a-8574-4314-a5d8-592a806ae66d  7:00:28 PM: debug Installed with settings: [valve:Front Yard Irrigation, frequency:72, duration:120]
29e99f5a-c3e1-4e81-b08b-d5d61f03a7de  7:00:12 PM: debug Updated with settings: [station_id:Khihonol177]
29e99f5a-c3e1-4e81-b08b-d5d61f03a7de  7:00:10 PM: debug Installed with settings: [station_id:Khihonol177]
79a7e844-a651-49aa-9141-a1dda71005b7  6:59:57 PM: debug Updated with settings: [valve:Front Yard Irrigation, frequency:72, duration:120]
79a7e844-a651-49aa-9141-a1dda71005b7  6:59:57 PM: debug Updated with settings: [valve:Front Yard Irrigation, frequency:72, duration:120]
79a7e844-a651-49aa-9141-a1dda71005b7  6:59:53 PM: debug Updated with settings: [valve:Front Yard Irrigation, frequency:72, duration:120]
79a7e844-a651-49aa-9141-a1dda71005b7  6:59:53 PM: debug Updated with settings: [valve:Front Yard Irrigation, frequency:72, duration:120]
79a7e844-a651-49aa-9141-a1dda71005b7  6:59:48 PM: debug Updated with settings: [valve:Front Yard Irrigation, frequency:72, duration:120]
79a7e844-a651-49aa-9141-a1dda71005b7  6:59:47 PM: debug Updated with settings: [valve:Front Yard Irrigation, frequency:72, duration:120]
79a7e844-a651-49aa-9141-a1dda71005b7  6:59:47 PM: debug Installed with settings: [valve:Front Yard Irrigation, frequency:72, duration:120]

This is what the logs look like when the children are on the second page:

35da4f6e-608e-49f4-ba48-587eecfb9340  7:04:26 PM: debug Installed with settings: [station_id:Khihonol177]
f00bec3d-47f8-48ff-aca3-d143528e9194  7:04:26 PM: debug Updated with settings: [valve:Front Yard Irrigation, frequency:72, duration:120]
f00bec3d-47f8-48ff-aca3-d143528e9194  7:04:26 PM: debug Updated with settings: [valve:Front Yard Irrigation, frequency:72, duration:120]
f00bec3d-47f8-48ff-aca3-d143528e9194  7:04:25 PM: debug Installed with settings: [valve:Front Yard Irrigation, frequency:72, duration:120]

I feel like this has to be a bug or something I’m missing. Can anyone help me?

This works:

preferences {
    page(name: "settings", title: "Settings", uninstall: true, nextPage: 'zones') {
		section("Wunderground Station") {
            paragraph "Choose a wunderground station ID"
            input "station_id", "text", title: "Station ID"
        }
    }
    page(name: 'zones', title: "Zones", install: true, uninstall: true){
        section("Zones") {
        	 app(name: "Zones", appName: "Zone", namespace: "rurabe/water7", title: "Add Zone", multiple: true)
        }
	}
}

These do not work:

preferences {
    page(name: "settings", title: "Settings", install: true, uninstall: true) {
        section("Wunderground Station") {
            paragraph "Choose a wunderground station ID"
            input "station_id", "text", title: "Station ID"
        }
        section("Zones") {
             app(name: "Zones", appName: "Zone", namespace: "rurabe/water7", title: "Add Zone", multiple: true)
        }
    }
}

preferences {
    section("Wunderground Station") {
        paragraph "Choose a wunderground station ID"
        input "station_id", "text", title: "Station ID"
    }

    section("Zones") {
         app(name: "Zones", appName: "Zone", namespace: "rurabe/water7", title: "Add Zone", multiple: true)
    }
}

(Ryan Urabe) #2

This works:

preferences {
     page(name: "settings", title: "Settings", uninstall: true, nextPage: 'zones') {
		section("Wunderground Station") {
            paragraph "Choose a wunderground station ID"
            input "station_id", "text", title: "Station ID"
        }
    }
    page(name: 'zones', title: "Zones", install: true, uninstall: true){
        section("Zones") {
        	 app(name: "Zones", appName: "Zone", namespace: "rurabe/water7", title: "Add Zone", multiple: true)
        }
	}
}

This doesn’t:

preferences {
     page(name: "settings", title: "Settings", install: true, uninstall: true) {
		section("Wunderground Station") {
            paragraph "Choose a wunderground station ID"
            input "station_id", "text", title: "Station ID"
        }
        section("Zones") {
        	 app(name: "Zones", appName: "Zone", namespace: "rurabe/water7", title: "Add Zone", multiple: true)
        }
	}
}