This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

widget template
#4
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.
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
Reply


Messages In This Thread
widget template - by Frank68 - 10.07.2020, 06:18
RE: widget template - by admin - 10.07.2020, 06:44
RE: widget template - by Frank68 - 10.07.2020, 08:14
RE: widget template - by admin - 10.07.2020, 08:35
RE: widget template - by Frank68 - 10.07.2020, 14:37
RE: widget template - by Daniel - 10.07.2020, 15:33

Forum Jump: