09.08.2023, 12:35
Check that you don't have other scripts that can cause an extra write or that the script itself does not change a group address that is mapped to the same tag.
A better approach is to split the script into several parts so only relevant code is run when a certain value changes. And check event.dst to determine which thermostat should be checked.
As for caching something like this can be used instead of grp.getvalue():
A better approach is to split the script into several parts so only relevant code is run when a certain value changes. And check event.dst to determine which thermostat should be checked.
As for caching something like this can be used instead of grp.getvalue():
Code:
local values = {}
function getvalue(addr)
if values[ addr ] == nil then
values[ addr ] = grp.getvalue(addr)
end
return values[ addr ]
end