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.

Problems with Script Contact Window - Protection Mode
#1
Good morning:
  I made a script so that when a window of a room is opened, the thermostat goes into protection mode.
Once the summer is over, when the heating is switched on and the system is in heating mode the thermostat is put in protection mode even when all the windows are closed, I have no remote connection to the installation but I imagine that the problem is that since LM does not perform the Change from cooling mode to heating mode, any suggestions? 


 
The script is as follows
local ModoCalefaccion = grp.getvalue ("0/1/0")
local ModoTermostato = "6/7/1"

local tagname = 'ContatosVentanacocinasaloncomedor'


if ModoCalefaccion then

  for _, obj in ipairs(grp.tag(tagname)) do  --lee todos los objetos si se cumple la condicion (ventana abierta) pone el termostato en modo proteccion
                                              --si una vez leidos todos no se ha cumplido la condicion escribe en el modo false

                if obj.value then              --Al menos una ventana esta abierta

      grp.checkwrite(ModoTermostato ,true)

      return

    end

  end

                grp.checkwrite(ModoTermostato,false) -- Todas las ventanas estan cerrada

  end

Reply
#2
Don't you miss else before
grp.checkwrite(ModoTermostato,false)
?
------------------------------
Ctrl+F5
Reply
#3
(21.10.2019, 08:20)Daniel. Wrote: Don't you miss else before
grp.checkwrite(ModoTermostato,false)
?

 Thank you Daniel for your response, tomorrow I will verify locally if the Script has it with "else" or as I wrote it in the post

 Thank you so much

 Regards
Reply
#4
(21.10.2019, 08:20)Daniel. Wrote: Don't you miss else before
grp.checkwrite(ModoTermostato,false)
?
 Checking the script I see ,the return causes it to exit the function so if the first one is fulfilled it does not reach the second

(21.10.2019, 08:20)Daniel. Wrote: Don't you miss else before
grp.checkwrite(ModoTermostato,false)
?
Checking the script , the return causes it to exit the function, so if the first one is fulfilled it does not reach the second.
The error was in a TAG that should not be applied in the D.G."0/1/0"

 Thank you
 B.R.
 
Reply


Forum Jump: