DZvents timer wont tirgger
Posted: Sunday 24 January 2021 9:08
hey all
i have the below dzvents script in my domoticz v2020.2 Stable
but it never fires?
you can see i have logging in there to dump out to the logs every time its triggered but i never see it in the logs page of domoticz
i have the below dzvents script in my domoticz v2020.2 Stable
but it never fires?
you can see i have logging in there to dump out to the logs every time its triggered but i never see it in the logs page of domoticz
Code: Select all
return {
on = {
-- devices = {['Lounge Temperature'] = {'between 06:00 and 08:00'}}
-- devices = {78}
timer =
{
'every minute'
}
},
data =
{
temperatures = {history = true, maxItems = 10 },
},
execute = function(dz, item, device)
dz.log('heater script kicked it', dz.LOG_INFO)
local temp = dz.devices(78) --loungeroom temprature sensor
dz.data.temperatures.add(temp.temperature)
local heater = dz.devices('Heater') -- Reverse Cycle Heating Mode
local cooling = dz.devices('Cooling') -- Reverse Cycle Coling Mode
local average = dz.data.temperatures.avg() -- Average of Temprate Sensor in Loungeroom
local Season = 'Cooling' -- Variable for if system should be in heating or cooling mode
local setpoint = dz.devices(144) -- Lounge Thermostate
-- dz.log('Device ' .. device.name .. ' was changed', dz.LOG_INFO)
dz.log('Temp: ' .. temp.temperature, dz.LOG_INFO)
dz.log('Average Temp: ' .. average, dz.LOG_INFO)
dz.log('current setting is ' .. Season, dz.LOG_INFO)
if (Season == 'Heating') then
if (temp.temperature <= 18 and average <= 18) then
heater.switchOn().checkFirst()
end
if (temp.temperature >= 22 and average >= 22) then
heater.switchOff().checkFirst()
end
end
end
}