Command consisting of enum

Tinkering around with my ITHO fanbox code again, and am stumbling with a command consisting of four presets.
The preset should be zet with a value consisting of a enum list.

I defined:

        attribute "preset", "enum", [
            "off",        //
            "low",        //
            "medium",   //
            "high"  //
        ]

Followed by:

command(
             "setpreset", 
             [
                [
                     "name":"Fan Preset",
                     "description":"Set the fanbox to a preset speed",
                     "type":"ENUM",
                     "constraints":["off","low","medium","high"]
                ]

             ]

        );

But how do I define the actual command that consists of an IF statement setting the speed?

The actual command that should be given looks something like this:

{
           String DeviceSetURI = "http://${ipAddress}/api.html?username=${username}&password=${password}&command=${preset}"
            httpGet([uri:DeviceSetURI, contentType: "application/json"])
}

This should do it, to get the selection into the function.

void setPreset(String preset) {
           String DeviceSetURI = "http://${ipAddress}/api.html?username=${username}&password=${password}&command=${preset}"
            httpGet([uri:DeviceSetURI, contentType: "application/json"])
}

I tried that, but dishes out an error in the logging:
org.codehaus.groovy.runtime.metaclass.MissingMethodExceptionNoStack: No signature of method: user_driver_Fan_ITHO_Fanspeed_474.setpreset() is applicable for argument types: (java.lang.String) values: [low] (method setpreset)

Must be an issue with the case, change the command to be 'setPreset' so it matches the function. This will also make the UI display it as "Set Preset" which I assume is what you would want. Otherwise it would be "Setpreset" if you keep it all lower case.

Download the Hubitat app