I think i have an error with quotes
Code: Select all
execute = function(domoticz, device)
domoticz.log(device.state)
if (device.state =='On') then
os.execute('mosquitto_pub -h 127.0.0.1 -t milight/0x40/cct/0 -u mqtt -P mqtt -m {"status":"on"} ')
elseif (device.state =='Off') then
os.execute('mosquitto_pub -h 127.0.0.1 -t milight/0x40/cct/0 -u mqtt -P mqtt -m {"status":"off"} ')
end