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.

Script not triggering
#1
Hello,

I have a couple of this exact script running (8). The total number of scripts is around 60, but most are one or two liners, no timers, wait, delay etc.

All of them are working except this one, the script is enabled and the group address is of the correct data type.
What can I do to clear the problem?

System: CPU/IO: 0.52 0.58 0.57, Memory: 10%, KNX/TP:  OK, error log is empty.


Code:
--SPV_act='15/5/3'                 -- ovdje salje vrijednost SPV
--SPV_dan='SPV_TEST_dan'            -- varijabla u koju se sprema dnevni SPV
--SPV_noc='SPV_TEST_noc'             -- varijabla u koju se sprema nocni SPV
--Vremenski_enabled_var='Vremenski_TEST_enable' -- da li je vremenski program omogucen
--Dan_Noc='SPV_TEST_dan_noc'            -- podatak da li je aktivan dnevni ili nocni SPV

value = event.getvalue()

SPV_act='1/3/1'                                      -- SPV active value sending
SPV_dan='SPV_hodnik_kat1_dan'                        -- SPV day
SPV_noc='SPV_hodnik_kat1_noc'                        -- SPV night
Vremenski_enabled_var='Vremenski_hodnik_kat1_enable' -- Is time scheduler enabled?
Dan_Noc='SPV_hodnik_kat1_dan_noc'                    -- Is day or night SPV selected


storage.set(Dan_Noc,value)

enable_vremenski = storage.get(Vremenski_enabled_var)

if (enable_vremenski == true) then
 
 if (value == true) then
     my_data = storage.get(SPV_dan)
     grp.write(SPV_act, my_data)
   storage.set(Dan_Noc,value)
    end

 if (value == false) then
     my_data = storage.get(SPV_noc)
     grp.write(SPV_act, my_data)    
   storage.set(Dan_Noc,value)
    end

end

if (enable_vremenski == false) then
 my_data = storage.get(SPV_dan)
 grp.write(SPV_act, my_data)
end
Thanks
Reply
#2
Check what kind of variable you have in 'Vremenski_hodnik_kat1_enable' storage. As you have strict checks against true / false, for example, if your variable is set to 1, it will fail both checks. In Lua (1 == true) and (1 == false) are both false.

For less strict checks, you can add toboolean conversion:
http://openrb.com/docs/lua.htm#toboolean
Reply
#3
Thanks Admin, you nailed it!

Checked the variable type - the receiving group is "switch", but it's not the problem.

The problem was in the variable name. I deliberately wrote the scripts to be identical with differences in the variable declaration part only. So that I can copy/paste them without errors. Somehow my copy paste didn't worked Sad and ended with different  variable names in two connected scripts.

Stupid error, should found it myself on the first run, heh!
Reply


Forum Jump: