This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

object correction
#1
Hi, 

I have an zennio knx AC interface which sometimes misses commands being sent to the AC unit, and sw obj and swfb for on/off command are different states so in some case sw is true and sw fb is off and AC is not running (so KNX sw obj has been sent but AC interface has either sent the command to the AC unit and the AC unit has not responded or AC interface has not sent it... ) 

I believe its a compatibility issue between KNX AC interface and my AC unit.

A simple off then on again for the sw obj returns the correct operation and sw and fb are the same state.  

Below is what i have thought about for an event script, may I expect to see any issue/s doing it like this? or perhaps there is better way to achieve the same? 

Code:
local AC_State = event.getvalue() -- 1/7/0 AC Switch obj bool

os.sleep(2) -- wait for fb to be changed/updated
local AC_State_FB = grp.getvalue('1/7/1') --1/7/1 AC fb obj bool

if AC_State_FB ~= AC_State then
 
  if  AC_State then
  grp.write('1/7/0',false)
  grp.write('1/7/0',true)
    end
 
  if not AC_State then 
    grp.write('1/7/0',true)
    grp.write('1/7/0',false)
    end
end 
Reply
#2
Your script is executing itself when the status value is different from control. It executes two instances where both check for an opposite value. This means that one of them will fail and then will execute the same thing again.

If a single on/off or off/on is enough you can add this check to the beginning of you script. It will stop execution if this script is triggered by an event script.
Code:
if event.sender == 'se' then
  return
end

Otherwise you can use a resident script to check if status and control values are different every X seconds.
Reply


Forum Jump: