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.

General command script
#1
Hi there,
Could you help me with this script.
I have:
general comfort(32/1/2)
general standby(32/1/3)
general sleep(32/1/4)
general protection(32/1/5)

And i need a general feedback from all thermostats, something like:

if thermostat 1 op.mode.feedback (1/1/1) is "1" and if thermostat 2 op.mode.feedback (1/2/1) is "1" write general comfort feedback (32/1/6) "1"

and if thermostat 1 op.mode.feedback (1/1/1) is "2" and if thermostat 2 op.mode.feedback (1/2/1) is "2" write general standby feedback (32/1/7) "1"

I am working with Schneider wiser for knx.


Thank you!
Svetoslav Pavlov
Reply
#2
Code:
fMode1 = grp.getvalue('1/1/1')
fMode2 = grp.getvalue('1/2/1')

if (fMode1 == 1 and fMode2 == 1) then
 
  grp.write('32/1/6', 1)

elseif (fMode1 == 2 and fMode2 == 2) then
 
  grp.write('32/1/7', 1)
 
end
------------------------------
Ctrl+F5
Reply
#3
Thank you very much!

But of course the thinks are not so easy for me. Smile How to reset the value in 32/1/6 if one of the fMode(1/1/1 or 1/2/1 ) is different then 1 and in 32/1/7 is different then 2 and in 32/1/8 will be different then 3 and in 32/1/9 different then 4. I am not sure if I understand correctly. When the parameters 1/1/1 and 1/2/1 are in position "1" the value of 32/1/6 is 1 and this is perfect. But when they (1/1/1 and 1/2/1 ) both or only one of them changed to position "2" in parameter 32/1/6 we still have "1" and we don't want. How to do this?
Reply
#4
What do you want to write to the 32/1/7 and 32/1/7 when the condition is not meet?
------------------------------
Ctrl+F5
Reply
#5
I suppose you need something like this. 32/1/6 = 1 when both modes are 1, 0 otherwise; 32/1/7 = 1 when both modes are 2, 0 otherwise and so on.
Code:
mode1 = grp.getvalue('1/1/1')
mode2 = grp.getvalue('1/2/1')

function check(value)
  if mode1 == value and mode2 == value then
    return 1
  else
    return 0
  end
end

grp.checkwrite('32/1/6', check(1))
grp.checkwrite('32/1/7', check(2))
grp.checkwrite('32/1/8', check(3))
grp.checkwrite('32/1/9', check(4))
Reply
#6
32/1/6 is a feedback signal when is 1 there is a icon(pictures) on the graphics and i want when one of the value of 1/1/1 or 1/2/1 be different then 1 this parameter 32/1/6 to be 0( the picture disappear) or if the parameters of the 1/1/1 and 1/2/1 get value 2, that means 32/1/7 to be 1 and the parameter 32/1/6 to be 0. It is something like a reset trigger but i don't know how to did here.
Reply
#7
admin script would do this but here is version for beginners Wink
Code:
fMode1 = grp.getvalue('1/1/1')
fMode2 = grp.getvalue('1/2/1')

if (fMode1 == 1 and fMode2 == 1) then
 
  grp.checkwrite('32/1/6', 1)
 
else
 
  grp.checkwrite('32/1/6', 0)
 
end 

if (fMode1 == 2 and fMode2 == 2) then
 
  grp.checkwrite('32/1/7', 1)
   
else
   
   grp.checkwrite('32/1/7', 0)
 
end
------------------------------
Ctrl+F5
Reply
#8
(17.02.2021, 14:40)admin Wrote: I suppose you need something like this. 32/1/6 = 1 when both modes are 1, 0 otherwise; 32/1/7 = 1 when both modes are 2, 0 otherwise and so on.
Code:
mode1 = grp.getvalue('1/1/1')
mode2 = grp.getvalue('1/2/1')

function check(value)
  if mode1 == value and mode2 == value then
    return 1
  else
    return 0
  end
end

grp.checkwrite('32/1/6', check(1))
grp.checkwrite('32/1/7', check(2))
grp.checkwrite('32/1/8', check(3))
grp.checkwrite('32/1/9', check(4))

Exactly, this is exactly that i need. Thank you ppl. I really don't understand why my company use Schneider device... Here in LM there is a information for everything and you guys helps a lot. We have 5 projects with wiser and a lot of the thinks i am getting from here. Thank you again for the support! Be safe
Reply


Forum Jump: