12.02.2020, 10:07
(12.02.2020, 08:15)admin Wrote: You will need a script to calculate final value by combining 3 objects together. Just make sure to use different group addresses for status and control otherwise you can produce an infinite loop.
Code:onoff = grp.getvalue('1/1/1') -- fan on/off
direction = grp.getvalue('1/1/2') -- fan direction
speed = grp.getvalue('1/1/3') -- fan speed
value = bit.bor(
onoff and 1 or 0,
bit.lshift(bit.band(direction, 0x07), 8),
bit.lshift(bit.band(speed, 0x07), 12)
)
grp.update('1/1/4', value)
Thanks so much. I will check it