Logic Machine Forum
Script change of Bacnet COV settings - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: Script change of Bacnet COV settings (/showthread.php?tid=4992)



Script change of Bacnet COV settings - equalizer - 27.09.2023

Hi.

Im about to create a few Bacnet COV points on a large number of Wiser4KNX.

When the points are created they start with a send on change of 1, I need this to be 0.5, can this be scripted of do I need to manually change this?

Robert.


RE: Script change of Bacnet COV settings - Erwin van der Zwart - 27.09.2023

Use this:
Code:
--Best way is to tag your objects with a specific tag for each different COV value and then run this script once:

covincr = 0.1
tag = 'mycovtag1'
db:query('UPDATE objects SET covincr=? WHERE id IN (SELECT object FROM objecttags WHERE tag=?)', covincr, tag)

covincr = 0.5
tag = 'mycovtag2'
db:query('UPDATE objects SET covincr=? WHERE id IN (SELECT object FROM objecttags WHERE tag=?)', covincr, tag)

os.execute('/etc/init.d/bacnet restart')
script.disable(_SCRIPTNAME)

--or

covincr = 0.1
db:query('UPDATE objects SET covincr=? WHERE export = 1', covincr)
os.execute('/etc/init.d/bacnet restart')
script.disable(_SCRIPTNAME)