07.04.2021, 15:12
(This post was last modified: 07.04.2021, 15:15 by davidchispas.)
(07.04.2021, 08:17)idhe Wrote: Hi,
I would like to dynamically change the min and max values of objects (Visualization parameters), how can I do this with a script ? I need to change a temperature range if we are using cooling or heating mode (cooling min 23°C, max 28°C / heating min 15°C, max 25°C), can I modify a group of objects by using tags ?
Thanks,
idhe
I don't know if that parameter can be modified by code ... I did it with a script per event with a 1-byte object. In visu assign a button to increase and another to decrease. This script can be assigned more thermostats by assigning it different values to execute the event. So I would only use a script
Code:
--Cool(1)/heat(0) mode status object
Mode = '3/1/1'
--Setpoint temperature object
Temp = '3/1/2'
--Setpoint temperature status object
Sttemp = '3/1/3'
--Cold minimum value
ColdMin = 23
--Cold maximum value
ColdMax = 28
--Heat minimum value
HeatMin = 15
--Heat maximum value
HeatMax = 25
----------------------------------------------------------
value = event.getvalue()
if grp.getvalue(Mode) then
Min = ColdMin
Max = ColdMax
else
Min = HeatMin
Max = HeatMax
end
if value == 1 and grp.getvalue(Sttemp)>Min then
grp.write(Temp, grp.getvalue(Sttemp) - 0.5)
elseif
value == 2 and grp.getvalue(Sttemp)<Max then
grp.write(Temp, grp.getvalue(Sttemp) + 0.5)
end