Driver Preference types and setting them dynamically

When I setup a new device, I need to be able to fill in the AppriseURL and Label. These are then used to query the webserver to determine the enum values for Service.

Today I'm using:

preferences {
input("AppriseUrl", "text", title: "Apprise Server URL:", description: "[ip address][:port]/")
input(name: "service", defaultValue: "DavidEmail", type: "enum", multiple: true, title: "Service", options: ["DavidEmail","DavidText"])
input("label", "text", title: "Label:", description: "Name of tag within Apprise database to define valid services")
input("Subject", "text", title: "Subject:", description: "")
}

I have a function that uses the Service/Label information and creates an arrayList of the valid services. I would like the preferences enum type to be updated with this arrayList.

I've no idea how to do this. I can get things to work by statically setting the services, but that defeats the purpose as each unique device created will have different valid services.

Any pointers? Is this even possible?

thanks,
david

No. Not possible. Devices do not support dynamic preferences ( or even pages) like apps do.

You’re probably trying to get the driver preferences to do too much. For what you are trying to do I would recommend creating a service manager app to handle the connection stuff and the creation of your devices.

The service manager app doesn’t need to serve any other role than a factory for creating devices.

Thanks for letting me know I can stop looking :slight_smile:

I was able to store the valid values in a state variable that is printed on the device page. I can then just cut-n-paste to the input form I want. So it works OK, just not as nice as I'd like.

thanks again,
david