I need some help in finding a mistake in this script:
Code: Select all
return
{
on =
{
devices =
{
"Bufor - GÓRA",
},
},
data =
{
count =
{
initial = 0,
},
temp =
{
initial = 0,
},
},
logging =
{
level = domoticz.LOG_DEBUG,
marker = 'nagrzewaniePiecem',
},
execute = function(domoticz)
if domoticz.data.count == 0 then
domoticz.data.temp = domoticz.devices("Bufor - GÓRA").temperature
domoticz.data.count = domoticz.data.count + 1
domoticz.notify('0')
elseif domoticz.data.count > 0 and domoticz.data.count < 2 then
domoticz.data.count = domoticz.data.count + 1
domoticz.notify('1')
elseif domoticz.data.count == 2 then
local ratio = domoticz.devices("Bufor - GÓRA").temperature - domoticz.data.temp
domoticz.notify('2')
if ratio > 0.3 and ratio < 5 then
domoticz.variables("nagrzewanie_piecem").set(1)
else
domoticz.variables("nagrzewanie_piecem").set(0)
end
domoticz.data.count = 0
end
end
}
It runs OK, does not report any errors but for some reason noting printed to log apart from information about script being processed. And variable is not updated.
Regards,