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 change object range values
#2
(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
Reply


Messages In This Thread
Script change object range values - by idhe - 07.04.2021, 08:17
RE: Script change object range values - by davidchispas - 07.04.2021, 15:12

Forum Jump: