Logic Machine Forum
Scale Values - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Gateway (https://forum.logicmachine.net/forumdisplay.php?fid=10)
+--- Thread: Scale Values (/showthread.php?tid=1948)



Scale Values - christian.troen@haaland.no - 06.03.2019

Hey

Is there an easy way to multiply a KNX adresse-value with 3600, and to do so with many objects. I get resaults from Air-valves in m3/s, but want it in m3/h.
I use the Logic Machine as KNX to BACnet gateway.

Christian


RE: Scale Values - admin - 06.03.2019

You will need a script attached to a tag and some specific addressing rules to calculate the destination group address. This example converts first address part from 5 to 6:
Code:
value = event.getvalue() * 3600
dst = event.dst:gsub('^5/', '6/')
grp.update(dst, value)