Is there a way the switch script-command can accept more than On or Off? I’m using a JB-Lightmanager and use a Global cache module to send IR codes to it, but the JB-Lightmanager can also work with HTTP commands. I have it working with the following minimized script, but only with the keywords On or Off. I’m riddled why other words don’t work. Is there a way (to use for instance Kitchen_On)?
plugin.Name = "HTTPer";
plugin.OnChangeRequest = onChangeRequest;
plugin.PollingInterval = 1000;
var http = new HTTPClient();
function onChangeRequest(device, attribute, value) {
switch (value) {
case "On":
http.get("http://192.168.1.151/control?scene=21"); // LH-lamp-On
break;
case "Off":
http.get("http://192.168.1.151/control?scene=161"); // LH-lamp-Off
break;
case "Kitchen_On":
http.get("http://192.168.1.151/control?scene=151"); // Kitchen-lamp-Off
break;
default:
break;
}
}```