10.07.2020, 14:37
(10.07.2020, 08:35)admin Wrote: You can create a script to convert 4-bit to 1-bit. In visualization object select 4-bit as Main object and 1-bit as Status object. This way the icon will show the status.Hi but in this way need to create more script , i have more shutter and more windows , best solution is a tempplate widget , where is possible to connecto directly at the right address .
Script to determine 4-bit action (stop/up/down). Change 1-bit addresses and values as needed.
Code:value = tonumber(event.datahex, 16)
up = bit.band(value, 8) == 8
stop = bit.band(value, 7) == 0
if stop then
grp.write('32/1/3', true)
elseif up then
grp.write('32/1/4', true)
else
grp.write('32/1/5', true)
end
If it's possible I prefer not write more script.
Thank's