Script Error. HELP - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8) +--- Thread: Script Error. HELP (/showthread.php?tid=5537) |
Script Error. HELP - Tuwat47 - 29.07.2024 Hi Everyone, I'm having some problems with this script. The logic is able to activate the output but It doesn't turn it off and I don't understand why. Can someone help me to figure out this? --dichiarazione delle variabili locali gRichiestaDeumidificazione = ("7/0/0") gStatoDeumidificazione = ("7/1/0") gStagione = ("0/2/2") --gruppo stagione invertito: 1= raffrescamento / 0= riscaldamento gSogliaZona1 = ("7/3/0") gSogliaZona2 = ("7/3/2") gSogliaZona3 = ("7/3/4") gSogliaZona4 = ("7/3/14") gSogliaZona5 = ("") gSogliaZona6 = ("") -------------------------------non toccare più nulla sotto questa riga------------------------------------------ Zn1 = grp.getvalue(gSogliaZona1) Zn2 = grp.getvalue(gSogliaZona2) Zn3 = grp.getvalue(gSogliaZona3) Zn4 = grp.getvalue(gSogliaZona4) Zn5 = grp.getvalue(gSogliaZona5) Zn6 = grp.getvalue(gSogliaZona6) Stagione = grp.getvalue(gStagione) if (Zn1 or Zn2 or Zn3 or Zn4 or Zn5 or Zn6) and Stagione then grp.checkwrite(gRichiestaDeumidificazione, 1, true, gStatoDeumidificazione) else grp.checkwrite(gRichiestaDeumidificazione, 0, false, gStatoDeumidificazione) end RE: Script Error. HELP - Daniel - 29.07.2024 Set the third argument in grp.checkwrite to nil RE: Script Error. HELP - Tuwat47 - 29.07.2024 Code: --dichiarazione delle variabili locali (29.07.2024, 09:12)Daniel Wrote: Set the third argument in grp.checkwrite to nilHi Daniel, thanks for your reply. I set the third argument as "nil" but it still doesn't work. The scope of the script is to verify if at least one "Zone" is "ON" AND if the "season" is "ON". In this case set the output on "True", otherwise if alla the zones are "OFF" or the "Season" is "OFF" set to "FALSE" the output. RE: Script Error. HELP - Daniel - 29.07.2024 grp.write has only has only two parameters, ok 3 but you are not using dpt. https://kb.logicmachine.net/libraries/lua/#grpwritealias-value--datatype Add log inside if and log all variables. RE: Script Error. HELP - admin - 29.07.2024 Try this: Code: value = (Zn1 or Zn2 or Zn3 or Zn4 or Zn5 or Zn6) and Stagione |