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"])
}