Posts: 15
Threads: 6
Joined: Nov 2021
Reputation:
0
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.
Posts: 4643
Threads: 24
Joined: Aug 2017
Reputation:
207
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
Posts: 15
Threads: 6
Joined: Nov 2021
Reputation:
0
24.03.2022, 09:49
(This post was last modified: 24.03.2022, 10:20 by ONJ.)
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
Posts: 4643
Threads: 24
Joined: Aug 2017
Reputation:
207
Can you share what you did? DO NOT ADD TAG to your global object!
------------------------------
Ctrl+F5
Posts: 15
Threads: 6
Joined: Nov 2021
Reputation:
0
24.03.2022, 10:48
(This post was last modified: 24.03.2022, 10:59 by ONJ.)
Okey, look at the picture
Posts: 4643
Threads: 24
Joined: Aug 2017
Reputation:
207
Replace this script with this
Code:
value = event.getvalue()
myobjects=grp.tag('dag')
myobjects:write(value)
------------------------------
Ctrl+F5
Posts: 15
Threads: 6
Joined: Nov 2021
Reputation:
0
Thanks again, it worked !
Posts: 15
Threads: 6
Joined: Nov 2021
Reputation:
0
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..
Posts: 7758
Threads: 42
Joined: Jun 2015
Reputation:
447
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.
Posts: 4643
Threads: 24
Joined: Aug 2017
Reputation:
207
To how many objects do you write at once?
------------------------------
Ctrl+F5
Posts: 15
Threads: 6
Joined: Nov 2021
Reputation:
0
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?
Posts: 4643
Threads: 24
Joined: Aug 2017
Reputation:
207
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