10.07.2020, 08:35
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.
Script to determine 4-bit action (stop/up/down). Change 1-bit addresses and values as needed.
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