Custom Driver - command

Hello All,

Does someone know if its possible to define a custom command of type "ENUM?
I have tried the below code but does not seam to work :frowning:

metadata {
  definition (name: "Pilot Wire", namespace: "syepes") {
    command "pilotMode", [[name:"mode",type:"enum", description:"Pilot mode", options:[[0:"Stop"],[15:"Anti Freeze"],[25:"Eco"],[35:"Comfort-2"],[45:"Comfort-1"],[100:"Comfort"]]]]
  }
}

This is the only documentation i could find around this topic, does someone know another resource?
https://docs.smartthings.com/en/latest/device-type-developers-guide/definition-metadata.html#commands

Best regards,
Seb

Here is a post that I had bookmarked that might be useful.

I couldn’t get a map enum to work either. I ended up creating a helper function that would turn the chosen input value into the number I was looking for based on the string. Ugly but worked.

Thanks this is just what I was looking for.

1 Like