11.04.2022, 14:58
(11.04.2022, 12:27)admin Wrote: You need to tag all thermostat mode objects with therm-mode tag then the total count per mode can be calculated like this (either event script attached to this tag or a resident script with at least 5 second sleep time):Thank you so much for the script,
Code:counters = {}
objects = grp.tag('therm-mode')
for _, obj in ipairs(objects) do
value = obj.value
counters[ value ] = (counters[ value ] or 0) + 1
end
grp.checkupdate('32/1/1', counters[ 1 ] or 0) -- comfort
grp.checkupdate('32/1/2', counters[ 2 ] or 0) -- away
grp.checkupdate('32/1/3', counters[ 3 ] or 0) -- economy
There are several options for blocking writes. One option is to use Custom JavaScript to block certain UI elements based on an object value. Another option is to add additional objects with event scripts which pass the value to the control object only when the mode object has a specific value.
Could you give one solution for blocking the writing?