Keep getting this error and I'm not sure how to get rid of it.
3/0/41 is DPT1
3/0/21 is a percentage value. I have tried using DPT9 and now using DPT5
3/0/21 is mostly at 0%, I've tried to manually set the GA to 0 to be sure it's not nil.
3/0/41 is DPT1
3/0/21 is a percentage value. I have tried using DPT9 and now using DPT5
3/0/21 is mostly at 0%, I've tried to manually set the GA to 0 to be sure it's not nil.
Code:
Resident script:9: attempt to compare number with nil
stack traceback:
Code:
local auxswitch = grp.getvalue('3/0/41')
local auxstatus = grp.getvalue('3/0/21')
if auxswitch == true then
grp.write('3/0/57', 0)
elseif (auxswitch == false and auxstatus == 0) then
grp.write('3/0/57', 1)
elseif (auxswitch == false and auxstatus >= 1 and auxstatus <= 33) then
grp.write('3/0/57', 2)
elseif (auxswitch == false and auxstatus >= 34 and auxstatus <= 66) then
grp.write('3/0/57', 3)
elseif (auxswitch == false and auxstatus >= 67 and auxstatus <= 100) then
grp.write('3/0/57', 4)
end