Posts: 167
Threads: 20
Joined: Apr 2017
Reputation:
2
I had the idea grp.checkwrite / grp.checkupdate don't work always.
Are there limitation about when I can use it and when not?
Maybe not all datatype?
It looks like it doesn't always update the new value or do I look wrong?
I understand grp.checkwrite is when it has to write to the KNX bus
and grp.checkupdate if it is just local for the LM.
Posts: 4660
Threads: 24
Joined: Aug 2017
Reputation:
212
grp.checkwrite is sending to TP and IP but on change of value. grp.checkupdate is sending only to IP but also on change of value.
------------------------------
Ctrl+F5
Posts: 167
Threads: 20
Joined: Apr 2017
Reputation:
2
Oké thanks.
I think my problem was also not the right data type.
Posts: 74
Threads: 21
Joined: Sep 2016
Reputation:
0
and grp.write always send the value on TP and IP, even if the value inside LM is up to date?
Posts: 7773
Threads: 42
Joined: Jun 2015
Reputation:
447
For floating point values default delta is 0.1. The difference between values is lower in your case.
Posts: 167
Threads: 20
Joined: Apr 2017
Reputation:
2
Oké thanks, does it means I need to take another data type for solving this problem?
Posts: 7773
Threads: 42
Joined: Jun 2015
Reputation:
447
The value will update when the difference is large enough. You can also specify delta manually as the third argument. Try 0.01 or 0.001
Posts: 167
Threads: 20
Joined: Apr 2017
Reputation:
2
Sounds interesting, do you have an example of this?
Posts: 167
Threads: 20
Joined: Apr 2017
Reputation:
2
Great tanks, that was what I was looking for ?
Posts: 19
Threads: 0
Joined: Jul 2023
Reputation:
0
Yesterday, 08:46
(This post was last modified: Yesterday, 10:10 by Ranjeet.)
Hii sir ,
I have created resident script in which when a light ON in particular area it sends command to another object which tells me that a light is ON in this area the problem is that when i Active this script then logic machine become a slow or hang.and script sleep interval time is 0 second.
Can you suggest me solution for this query.
here is script --
-- Define the function that will run every 5 seconds
function checkValues()
-- Get the values from the grp (assuming grp.getvalue() returns the values for these keys)
value = grp.getvalue('0/6/2')
value2 = grp.getvalue('0/6/10')
value3 = grp.getvalue('0/5/6')
value4 = grp.getvalue('0/6/8')
value5 = grp.getvalue('2/5/22') -- value5 is checked for >= 1
value18 = grp.getvalue('2/5/27') -- value18 is checked for >= 1
value19 = grp.getvalue('0/6/44') -- value19 is checked for >= 1
value20 = grp.getvalue('0/6/25') -- value20 is checked for >= 1
value21 = grp.getvalue('0/6/58') -- value21 is checked for >= 1
value22 = grp.getvalue('0/6/30') -- value22 is checked for >= 1
-- Adjust the conditions for clarity (use parentheses to ensure proper evaluation order)
if (value or value2 or value3 or value4 or value5 >= 1 or
value18 >= 1 or value19 >= 1 or value20 >= 1 or
value21 >= 1 or value22 >= 1) then
grp.write('0/6/65', true) -- Write true if any condition is met
else
grp.write('0/6/65', false) -- Write false otherwise
end
end
-- Set the script to run every 5 seconds
while true do
checkValues() -- Call the function to check values
os.execute("sleep 5") -- Sleep for 5 seconds before checking again
end
Posts: 4660
Threads: 24
Joined: Aug 2017
Reputation:
212
------------------------------
Ctrl+F5