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.
2. Create boolean object and create event script on it. Change scriptname to the name of your resident script in point 1
Code:
123456
value = event.getvalue()
ifvaluethenscript.enable('scriptname')
elsescript.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:
123
value = event.getvalue()
myobject = grp.tag('TAG')
myobject:write(value)
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
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..
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?
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:
1234567
value = event.getvalue()
objects = grp.tag('my_tag_name')
for_, objectinipairs(objects) doobject:write(value)
os.sleep(0.1)
end