I wrote an app, and have been happily running one instance of it. But when I decided to add a 2nd instance, they both had the same name in the Apps list. Is there a way to differentiate between them in the list without going down the parent/child app route?
Couldn't you load another instance of it under apps code and call it something else.
I could but that seems a bit clunky, and over time I might want a 3rd, 4th, and what if I want to edit the code? Are you saying there is no way? Ok where can I find an example of how to code for parent/child? I've been looking but can't see anything other than oblique references to the topic.
I think the MakerAPI and the Homebridge app ([RELEASE] Homebridge Hubitat v2.0) let you do that, so you may want to look there.
I just found this thread: How to run multiple instances of an App (specifically One to Many Switching by Cobra) but the "assign a name" option doesn't seem to exist any more
Here an an excerpt from an App that allows the user to optionally assign a name to the app. Specifically, look at the “section("App Name")”
preferences
37
{
38
page(name: "mainPage1")
39
page(name: "mainPage2")
40
}
41
​
42
def mainPage1()
43
{
44
dynamicPage(name: "mainPage1", title: "", install: false, uninstall: true)
45
{
46
section("Home Assistant Device Bridge")
47
{
48
input ("ip", "text", title: "Home Assistant IP Address", description: "HomeAssistant IP Address", required: true)
49
input ("port", "text", title: "Home Assistant Port", description: "HomeAssistant Port Number", required: true, defaultValue: "8123")
50
input ("token", "text", title: "Home Assistant Long Term Access Token", description: "HomeAssistant Access Token", required: true)
51
input name: "enableLogging", type: "bool", title: "Enable debug logging?", defaultValue: false, required: true
52
}
53
section("Please note, it may take some time to retrieve all entities from Home Assistant.")
54
{
55
href(page: "mainPage2", title: "<b>Discover and select devices</b>", description: "Query Home Assistant for all currently configured devices. Please select which entities to Import to Hubitat.", params: [runDiscovery : true])
56
}
57
section("App Name") {
58
label title: "Optionally assign a custom name for this app", required: false
59
}
60
}
61
}
62
​
63
def mainPage2(params)
64
{
’’’
Ah! I shall go and try that and if it works I'll come back and mark your post as solution
Thanks ogiewon! So simple and clean
Glad that it’s working for you!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.