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.

Script to calculate how many
#4
Here's an example of blocking via a script and an additional virtual object. Single script can be used for multiple objects when mapped to a tag.

All objects must follow a fixed addressing scheme where the last group address part matches for all three objects.
In this example thermostat mode is 32/1/X, output is 33/1/X, this can be changed as needed.

Code:
addr = event.dst:split('/')[3]
mode = grp.getvalue('32/1/' .. addr)

-- write input value to output only when mode is comfort (1)
if mode == 1 then
  value = event.getvalue()  
  grp.checkwrite('33/1/' .. addr, value)
end
Reply


Messages In This Thread
Script to calculate how many - by Fahd - 11.04.2022, 11:28
RE: Script to calculate how many - by admin - 11.04.2022, 12:27
RE: Script to calculate how many - by Fahd - 11.04.2022, 14:58
RE: Script to calculate how many - by admin - 12.04.2022, 09:04
RE: Script to calculate how many - by Fahd - 12.04.2022, 09:33
RE: Script to calculate how many - by admin - 12.04.2022, 11:37
RE: Script to calculate how many - by Fahd - 12.04.2022, 11:49

Forum Jump: