Input Preferences for Device Type with multiple:true


(Kristopher Kubicki) #1

In a device type preferences (not SmartApp) the variable “inputChan” should be an array, but instead returns a string of the first value selected.

preferences {
    input("inputChan","enum", title: "Input Control", description: "Select the inputs you want to use", options: ["TUNER","HDMI1","HDMI2","HDMI3","HDMI4","HDMI5","AV1","AV2","AV3","AV4","AV5","V-AUX","AUDIO1","AUIDO2","SERVER","NET RADIO","USB"],multiple: true,required: true)
}

I think this is a defect as this behavior would return an array in a SmartApp. Please let me know if you have problems replicating this! @April


(codersaur) #2

I know this is an old thread, but it appears there are still issues using enum input preferences with multiple:true in device handlers…

Using the same input definition as Kristopher above, I have found today that I can read the value of the setting and determine all selected values, however there is a new bug: Next time the user tries to ‘Edit Device’ the previously selected values are not loaded into the GUI. If new values are selected, these are added to the previously selected values, but unselected values are not removed from the array. This means there is currently no way to deselect any of the options!

Can anyone tell me what the procedure is to raise a bug?


(Eric M) #3

Alright, so it seems like this is still an issue. Having an enum input with “multiple:true” is only saving a string of the first option selected. This is for a device handler of course.


(Keith) #4

I am experiencing all the same issues: result returned as a String (s/b array), Each change via to UI concatenates new values to the end, Previous values not displayed in the UI. Very annoying as “multiple” is exactly what I need and the alternatives are clumsy. Device preferences seem to be ugly stepchild of SmartApp preferences…


(Eric M) #5

@duncan Can anyone help out with this? I have had so many uses for this functionality, but it continues to not behave properly.


(Pedro Toledo Correa) #6

Hi @erocm1231 … I’m just developing my first deviceHandler and the problem persists. Only one of the selected devices on a previous configuration shows up selected. But there is something weird that I do not know if you saw: if you update the list, the device that gets selected is the first one on the first selection (e.g.: on the first try I select all devices, when I came back there is only the first one selected. I deselect it and I select all from the second, if I save and come back now the second one is the only selected).

How disappointing that a year after the issue is still present!