Hi, i'm experiencing some kind of hang/blocking/locking when this script runs for a few days.
The script runs as a Resident script every minute, but suddenly it stops. I try to disable, re- enable but without any success.
Then, when I alter the storage key ('3_3_15_vent_effect') to e.g. '3_3_15_vent_effect_1' it runs fine for some time (days?).
Should I safeguard the storage get/set in some way? I'm I missing something obvious here?
About the script: Calculate the effect of a heat recovery unit. Input values are collected from ModBus interface on LM (no need to do a grp.read()). I don't want to flood the KNX buss by writing every calculation, therefore the delta calculation.
Alternative approaches are welcome...
_
Ole A.
The script runs as a Resident script every minute, but suddenly it stops. I try to disable, re- enable but without any success.
Then, when I alter the storage key ('3_3_15_vent_effect') to e.g. '3_3_15_vent_effect_1' it runs fine for some time (days?).
Should I safeguard the storage get/set in some way? I'm I missing something obvious here?
Code:
deltaThreshold = 0.015
t1 = grp.getvalue('3/3/10')
t2 = grp.getvalue('3/3/11')
t3 = grp.getvalue('3/3/14')
-- Calc. effect
effect = (t1 - t3) / (t2 - t3)
prev_effect = storage.get('3_3_15_vent_effect', 0)
effectDelta = math.abs(prev_effect - effect)
-- Write to KNX buss if Delta > Treshold
if effectDelta > deltaThreshold then
grp.write('3/3/15', effect)
-- Store Calculated effect
storage.set('3_3_15_vent_effect', effect)
log("New reading - Effect prev.=" .. prev_effect .. " New = " .. effect)
end
About the script: Calculate the effect of a heat recovery unit. Input values are collected from ModBus interface on LM (no need to do a grp.read()). I don't want to flood the KNX buss by writing every calculation, therefore the delta calculation.
Alternative approaches are welcome...
_
Ole A.