os.execute mqtt commands
Posted: Sunday 09 February 2020 22:31
I want send commands to my mqtt server with dzvents
I think i have an error with quotes
can anyone tell me the exact settings?
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