Code: Select all
return {
on = {
devices = {
'Переключатель котла'
},
timer =
{'every minute'}
},
logging = { level = domoticz.LOG_DEBUG },
execute = function(dz,item,device)
local function sendMQTT(message, topic)
local MQTTTopic = topic or 'domoticz/out'
osCommand ( 'mosquitto_pub -u Cdzn -P Qq123e9 ' .. ' -t ' .. MQTTTopic .. " -m '" .. message .. "'")
end
if item.isTimer then
if (device.name == 'Переключатель котла' and device.active) then
local myTopic = 'domoticz/out/' .. dz.devices('Переключатель котла').idx
sendMQTT(myMessage, myTopic)
end
end
end
}
The reason is why i should do it, coz tonight boiler switch on and esp lost mqtt connection at the same time, so the command did not pass and i freeze(