Time function is not executed
Posted: Wednesday 30 April 2025 14:32
I wrote a script for a thermostat that worked fine for 6 months.
Suddenly the time function is not executed anymore.
Nothing to be shown in the log when a time period is activated.
Only when I manually trigger the object where this timer is residing in from OFF to Normaal or vice versa it changes and the log reports the status change.
Simpel code...........
It must be simple as the script ran flawless and I did not change the code.
I cant remember Domoticz has been updated and this is the result.
Full code.........
Suddenly the time function is not executed anymore.
Nothing to be shown in the log when a time period is activated.
Only when I manually trigger the object where this timer is residing in from OFF to Normaal or vice versa it changes and the log reports the status change.
Simpel code...........
Code: Select all
if dz.time.matchesRule('at 00:00-05:44') then
dz.devices(74).updateText ('00:00-05:44 @ 16.5 C - preset')
dz.log ('It works')
end
I cant remember Domoticz has been updated and this is the result.
Full code.........
Code: Select all
return
{
--Thermostaat -- =idx69 thermostat controller
--CV_Brander -- =idx67 cv burner switch
--Temp_Kamer -- =idx32 room temperature
--Setpoint_Normaal -- =idx68 regular temperature setpoint
--Setpoint_Boost -- =idx72 boost temperature setpoint
--Setpoint_Boost_Tijd -- =idx75 boost time
--Thermostaat_Status -- =idx74 textbox
on =
{
devices = {'Thermostaat', 'CV_Brander', 'Temp_Kamer','Setpoint_Normaal','Setpoint_Boost','Setpoint_Boost_Tijd' },
},
execute = function(dz)
local varTempReg = dz.variables('varTempReg') --declared as float value in settings menu
varTempReg = dz.devices(68).setPoint
-- "Uit" mode active, initiated by thermostat switchselector at level 0
if dz.devices(69).level == 0 then
dz.devices(67).switchOff().checkFirst()
dz.devices(74).updateText ('Thermostaat OFF')
dz.log('Thermostat OFF')
end
-- mon to thu
-- "Normaal" mode active, initiated by thermostat switchselector at level 10
if dz.time.matchesRule('on mon,tue,wed,thu') then
if dz.devices(69).level == 10 then
if dz.time.matchesRule('at 00:00-05:44') then
dz.devices(74).updateText ('00:00-05:44 @ 16.5 C - preset')
if dz.devices(32).temperature < 16.5 then
dz.devices(67).switchOn().checkFirst()
else
dz.devices(67).switchOff().checkFirst()
end
end
if dz.time.matchesRule('at 05:45-06:29') then
dz.devices(74).updateText ('05:45-06:29 @ 16.5 C- preset')
if dz.devices(32).temperature < 16.5 then
dz.devices(67).switchOn().checkFirst()
else
dz.devices(67).switchOff().checkFirst()
end
end
if dz.time.matchesRule('at 06:30-16:59') then
dz.devices(74).updateText ('06:30-16:59 @ '..varTempReg..' C instelbaar')
if dz.devices(32).temperature < dz.devices(68).setPoint then
dz.devices(67).switchOn().checkFirst()
else
dz.devices(67).switchOff().checkFirst()
end
end
if dz.time.matchesRule('at 17:00-19:29') then
dz.devices(74).updateText ('17:00-19:29 @ 18 C - preset')
if dz.devices(32).temperature < 18 then
dz.devices(67).switchOn().checkFirst()
else
dz.devices(67).switchOff().checkFirst()
end
end
if dz.time.matchesRule('at 19:30-23:59') then
dz.devices(74).updateText ('19:30-23:59 @ 16.5 C - preset')
if dz.devices(32).temperature < 16.5 then
dz.devices(67).switchOn().checkFirst()
else
dz.devices(67).switchOff().checkFirst()
end
end
end
end -- mon to thu
--fri to sun
-- "Normaal" mode active, initiated by thermostat switchselector at level 10
if dz.time.matchesRule('on fri,sat,sun') then
if dz.devices(69).level == 10 then
if dz.time.matchesRule('at 00:00-07:29') then
if dz.devices(32).temperature < 16.5 then
dz.devices(67).switchOn().checkFirst()
dz.devices(74).updateText ('00:00-07:29 @ 16.5 C - preset')
else
dz.devices(67).switchOff().checkFirst()
end
end
if dz.time.matchesRule('at 07:30-16:59') then
dz.devices(74).updateText ('07:30-16:59 @ '..varTempReg..' C instelbaar')
if dz.devices(32).temperature < dz.devices(68).setPoint then
dz.devices(67).switchOn().checkFirst()
else
dz.devices(67).switchOff().checkFirst()
end
end
if dz.time.matchesRule('at 17:00-19:29') then
dz.devices(74).updateText ('17:00-19:29 @ '..varTempReg..' C instelbaar')
if dz.devices(32).temperature < dz.devices(68).setPoint then
dz.devices(67).switchOn().checkFirst()
else
dz.devices(67).switchOff().checkFirst()
end
end
if dz.time.matchesRule('at 19:30-23:59') then
dz.devices(74).updateText ('19:30-23:59 @ 16.5 C - preset')
if dz.devices(32).temperature < 16.5 then
dz.devices(67).switchOn().checkFirst()
else
dz.devices(67).switchOff().checkFirst()
end
end
end
end --fri to sun
end
}