new problem

translate temperature works well, so i try add switch controll too
now my transalte function looks like:
Code: Select all
switch (msg.topic) {
case "dom/salon/gniazdko/temperature":
msg.payload = {"command":"udevice","idx":252,"nvalue":0,"svalue":msg.payload};
break;
case "dom/salon/gniazdko/gniazdko/state":
msg.payload = {"command":"switchlight","idx":249,"switchcmd":msg.payload};
break;
}
return msg;
switching command are translate to:
domoticz/in {"command":"switchlight","idx":249,"switchcmd":"on"}
but my switch in domoticz dont works

in domoticz log i can find such note:
2020-03-07 14:02:22.178 MQTT: Topic: domoticz/in, Message: {"command":"switchlight","idx":249,"switchcmd":"on"}
2020-03-07 14:02:22.179 Error: MQTT: Error sending switch command!
i cant understand why switch not works, where is mistake??
maybe problemis that in translate command are "on"/"off", but domoticz need "On"/"Off"??? if yes how i should change my function?
ty in advance for any hints