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.

temperature compare script and FB
#1
hi 
i need a code to compare between 2 Temperatures (Actual (4/0/3) , Setpoint(4/0/2) ) 
i received a actual point from Keypad and set Point Entered to Knx valve actuator ? and if actual == setpoint write 0 to output (4/0/0) and if else write 1 to same Output !

i write this but not run 
_________________________________________
value_1 = grp.getvalue('4/0/3')
value_2 = grp.getvalue('4/0/2')
if value_1 == value_2 then
grp.write('4/0/0', true) -- bit to 0
else
grp.write('4/0/0', false) -- bit to 1
end
________________________________________

I Need correct code or FB Edit
Reply
#2
Just swap the true and false.
------------------------------
Ctrl+F5
Reply
#3
(07.12.2023, 08:46)Daniel Wrote: Just swap the true and false.

i did that but the same Problem
Reply
#4
What is the problem?
------------------------------
Ctrl+F5
Reply
#5
What kind of script are you using? Modify script like this and post what you get in Logs tab.

Code:
value_1 = grp.getvalue('4/0/3')
value_2 = grp.getvalue('4/0/2')

res = value_1 ~= value_2
log(value_1, value_2, res)

grp.write('4/0/0', res)
Reply
#6
(07.12.2023, 08:55)admin Wrote: What kind of script are you using? Modify script like this and post what you get in Logs tab.

Code:
value_1 = grp.getvalue('4/0/3')
value_2 = grp.getvalue('4/0/2')

res = value_1 ~= value_2
log(value_1, value_2, res)

grp.write('4/0/0', res)

i write this code but when i test the output not change if the actual not = setpoint no change
Reply
#7
What kind of script are you using - event or resident?

For event script you need to map this script to both input group addresses (4/0/2 and 4/0/3).

For resident script make sure that sleep time is not 0 or you will overload LM.
Reply
#8
(07.12.2023, 09:02)admin Wrote: What kind of script are you using - event or resident?

For event script you need to map this script to both input group addresses (4/0/2 and 4/0/3).

For resident script make sure that sleep time is not 0 or you will overload LM.
  • event 
Reply
#9
Is this event script attached to both input group addresses (4/0/2 and 4/0/3)?
Reply
#10
(07.12.2023, 09:07)admin Wrote: Is this event script attached to both input group addresses (4/0/2 and 4/0/3)?

i write the same code on resident and it run ..

thank you
Reply


Forum Jump: