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.

Range thermostat and common setpoint writer
#1
Hello

I would have been very grateful if anyone could help me with two scripts 

Script 1:

This script is goint to regulate an outdoor heatingcable (depending on the outdoor temp) between 5 and -10 degrees, the cable is on from 5 to -10 degrees and off over 5 degrees and under -10 degrees, adjustable from groupadresses. And i want the script to be enabled/disabled from an 1 bit object, if its possible. I have tried to make different scrips and even the range check compirator in fb editor without luck.

Script 2:

I have several virtual objects in my project for writing setpoints to roomthermostats. In this case i need a script so i can change all the virtual setpoints from one virtual object like a collective setpoint adjustment.
Reply
#2
1. Resident script with interval 60(no need to run it more often) Change group addresses as needed. PS it will turn off below lower value too.

Code:
input =  grp.getvalue('1/1/1')
lower = grp.getvalue('1/1/2')
upper = grp.getvalue('1/1/3')

result = lower <= input and upper >= input
grp.checkwrite('1/1/4', result)
2. Create boolean object and create event script on it.  Change scriptname to the name of your resident script in point 1
Code:
value = event.getvalue()
if value then
script.enable('scriptname')
else
  script.disable('scriptname')
end
3. Event based script on your global setpoint. Add a tag to all setpoints you want to write to, not to the glogal setpoint object! Change TAG to the tag used in setpoint objects.
Code:
value = event.getvalue()
myobject = grp.tag('TAG')
myobject:write(value)
------------------------------
Ctrl+F5
Reply
#3
Thank you Daniel!

Script 1 and 2 works very well, but i cant get the global setpoint script to work, it would not write to the setpoint objects. My setpoint objects is already connected to another script, could that be an issue?

If i TAG the global object with the same TAG as my setpoint objects it works if i run the script from the script editor, but not if i change the value of my global setpoint
Reply
#4
Can you share what you did? DO NOT ADD TAG to your global object!
------------------------------
Ctrl+F5
Reply
#5
Okey, look at the picture
Reply
#6
Replace this script with this
Code:
value = event.getvalue()
myobjects=grp.tag('dag')
myobjects:write(value)
------------------------------
Ctrl+F5
Reply
#7
Thanks again, it worked !
Reply
#8
I have now tested the collective setpoint script, it makes a massive load on the CPU/KNX TP bus. I think i have to reconsider the use of this function..
Reply
#9
You've probably created a loop somewhere. Check that the script that triggers this write does not have the same tag as it writes to.
Reply
#10
To how many objects do you write at once?
------------------------------
Ctrl+F5
Reply
#11
hmm I have checked that, it looks like the CPU/TP load are only high for a few seconds when it writes to the bus and updating the virtual setpoints. It writes to 85 thermostat on the bus and uppdating 170 virtual objects at the same time. Do you think that is to much for the CPU?
Reply
#12
You will be better in creating Global group for all thermostats in ETS and just send single telegram there.
KNX has its limits.
------------------------------
Ctrl+F5
Reply
#13
Another option is to add a longer delay between each write. It will take longer but there will be lower CPU load overall. You can tune the sleep time as needed.
Code:
value = event.getvalue()
objects = grp.tag('my_tag_name')

for _, object in ipairs(objects) do
  object:write(value)
  os.sleep(0.1)
end
Reply


Forum Jump: