`multiple: true` on `enum` Renders as Single Dropdown in Driver Preferences

multiple: true on enum Renders as Single Dropdown in Driver Preferences

:brain: Summary

While building a learning driver in Hubitat, I noticed that using multiple: true on an enum input doesn't work as expected — it renders as a single-select dropdown, not a multi-select checkbox list. I'm trying to figure out if this is:

  • A bug in Hubitat's firmware,
  • An unsupported use of multiple: true in drivers (even though it's documented for apps),
  • A common gotcha for beginners,
  • Or if there’s a known workaround or best practice to achieve multi-select behavior.

:gear: Test Scenario

I created a minimal driver using enum with multiple: true. I expected a set of checkboxes, but only got a single dropdown. Even if I choose multiple default values (like ["A", "B"]), only one value is saved and displayed in logs.


:white_check_mark: Expected Behavior

According to Hubitat’s documentation:

"multiple" – Only available when the type is enum. Specifies that multiple values can be selected from the dropdown.
Source: Driver Capabilities → Preferences

And from the App documentation:

For capability and enum inputs, an optional parameter of multiple: true is allowed, such that a List is returned instead of a single element.
Source: App Overview

So I expected checkboxes for multiple selection (e.g., [✓] A, [✓] B), with values returned as a List like ["A", "B"].


:x: Observed Behavior

  • The enum input displays as a single-select dropdown.

  • Only one option can be chosen.

  • The returned value is a String, not a List.

  • Logs confirm that only a single value is passed:

    dev:7332025-07-19 04:52:42.909 PMinfo Test Multi-Select preferences updated: C
    

This breaks logic that expects a List (e.g., using .contains() or iteration).


:desktop_computer: Environment

  • Hardware Version: C-7
  • Hubitat Firmware: 2.4.2.125 (likely July 2025 release)
  • Tested Browsers: Firefox and Chrome (behavior is the same)
  • Driver Context: Simple learning driver

:mag: Test Driver Code

/**
 * Test Multi-Select Driver
 * Version 0.1.0
 */

metadata {
    definition (name: "Test Multi-Select", namespace: "test", author: "xAI") {
        capability "Actuator"
    }

    preferences {
        input name: "testMulti", type: "enum", title: "Test Multi-Select",
              multiple: true, options: ["A", "B", "C"], defaultValue: ["A", "B"],
              description: "Expected to allow selecting multiple options. Currently renders as a single dropdown."
    }
}

def installed() {
    log.info "Test Multi-Select driver installed"
}

def updated() {
    log.info "Test Multi-Select preferences updated: ${settings.testMulti}"
}

def uninstalled() {
    log.info "Test Multi-Select driver uninstalled"
}

:test_tube: Steps to Reproduce

  1. Add the above code as a new driver in Drivers Code.
  2. Create a device using this driver (Devices > + Add Device).
  3. Go to the device’s Preferences section.
  4. Try selecting multiple options from the Test Multi-Select input.
  5. Save and check the Logs.

:camera_flash: Screenshot

image


:question: Questions for the Community

  • Has anyone else seen this behavior when using multiple: true in drivers?
  • Is this officially unsupported, or a firmware bug?
  • Is this only meant to work in Apps, not Drivers?
  • Is there a workaround that won’t clutter the UI (e.g., replacing with a dozen bool inputs)?
  • Should I open a support ticket, and if so, what should I include?

:speech_balloon: Additional Context

I’m still learning Groovy and experimenting with driver development. I’d like to avoid cluttering the Preferences page with lots of bool switches, especially when I need the user to select from a list of 10+ options.

Any advice or clarification would be much appreciated as I learn the ropes.

Thanks in advance!

:memo: Edit: AI-Assisted Syntax Improvements

I should also mention that I’ve been iterating on this Groovy driver with the help of a few AI tools. I shared my earlier code attempts with them, and they helped me refine the general syntax, identify structural improvements, and enhance readability. The final version included in this post reflects those AI-assisted improvements and is the one I’ve been testing. If something looks different from typical examples, that’s why — but I’ve done my best to keep it consistent with Hubitat driver development practices.

Screenshot 2025-07-20 at 9.57.40 AM

  		section() {
			paragraph "<b>Select One or More</b>"
            input "EdseasonPresence", "enum", title: "", 
				options: [ "Spring", "Summer", "Autumn", "Winter" ], 
				multiple: true,
				required: false,
				width: 20,
				submitOnChange: true
        }

This code works fine, for me.

Inserting your code in my App, I get:

Screenshot 2025-07-20 at 10.00.23 AM

Which looks a lot like what you're asking for.

EDIT:
Didn't SEE that you are explicitly questioning a Driver. My mind has been on Apps recently and it works fine there, as shown. However, like you, when I add similar code to a Driver, it does not offer Multiple. In other words, my results match yours.

This is not supported and is the reason it was only documented for apps. Driver enums support the selection of at most a single value.

This appears to be another example of AI slop, and I'd encourage to you look at the actual sources for yourself. What it linked to (and at least this one tried to :smiley: ) is the old docs that have not been updated in years. There was a problem in the current docs, too, but that has been corrected.

What you really want to look at is here:

3 Likes

Thanks for trying and confirming.

Thanks for your references.

To be honest it would be nice if some of those old documents were removed, I have been caught on a few now.

The link in question doesn't even work if I click on it, and my point is that if you tried to follow it to the supposed source, you'd see the same. Following from that, it's probably an AI model relying on old/cached data of its own, which nothing external can address.

I provided the current content for you that appears to match the old doc it tried to link to.

(This isn't to say that something can't be out-of-date somewhere with the current site content, too -- there are changes all the time and sometimes it takes time to catch up everything -- so if you run into actual problems of your own there, feel free to share!)

1 Like

Point well taken — and thank you for the updated info. I tried following that link like a detective chasing a cold lead… and sure enough, it went nowhere fast. Sounds like the AI may have gotten a little overconfident with outdated breadcrumbs (lesson learned).

Appreciate you stepping in with the real content — very helpful. If I stumble into any actual issues while working through it, I’ll give a shout. Thanks again!

1 Like

Lots of commas, lots of em dashes. You might want to tell chatGPT not to use those.

LOL, how true but it was not ChatGPT is was Grok. Thanks for the insight.

1 Like

I got so caught up in the weeds—led down the garden path by one of the AIs, if we’re being honest—that I completely lost track of why I posted in the first place. My original goal was to learn, and I think I’ve managed to do that here (thankfully).

That said, one mystery still lingers…

Any insights on this last bit would be much appreciated before I let another bot convince me to rewrite it all again for sport. :sweat_smile:

@gopher.ny @mike.maxwell

Would it be possible to make multiple selection work on device preferences?
I'm currently facing the same issue as the OP, while writing a public driver that has a preference for what attributes to report (there are several).