Logic Machine Forum
Speed to on/off - 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: Speed to on/off (/showthread.php?tid=4258)



Speed to on/off - 2MAX - 22.09.2022

Hi, i nedd to change status on/off of knx adress if speed exceed 10%, can you help please?


RE: Speed to on/off - admin - 22.09.2022

This event script will send ON (true) to 1/1/1 when event value is larger than 10, otherwise it will send OFF (false) to 1/1/1.
Code:
value = event.getvalue()
grp.checkwrite('1/1/1', value > 10)



RE: Speed to on/off - 2MAX - 22.09.2022

(22.09.2022, 12:39)admin Wrote: This event script will send ON (true) to 1/1/1 when event value is larger than 10, otherwise it will send OFF (false) to 1/1/1.
Code:
value = event.getvalue()
grp.checkwrite('1/1/1', value > 10)

what is wrong on my script below

Code:
if event.getvalue() > 10
  then
grp.write('2/3/5', true)
  else
grp.write('2/3/5', false)
  end

Yours works fine. Thank you


RE: Speed to on/off - admin - 22.09.2022

Your script does the same thing as mine. Not sure why it didn't work for you. I've tested and it works for me.