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.

variable value lost sometimes
#1
Hello,
I have encountered an issue where the script section responsible for heat pump cooling sometimes runs unexpectedly, even though the conditions for its execution are not met. By using the log function, I identified that the variable `holas = '3/0/1'` activated this script, despite no conditions being met to proceed with the script. Upon  checking the log, I noticed that the variable `thermostat_Heating_Cooling` was holding the value 1, indicating that it shouldn't proceed with the script execution.
Is it possible for variables to lose their value at times?



The addresses listed have assigned tags that can trigger the script
holas = '3/0/1'
svetainė = '3/0/3'
kambario = '3/0/4'
miegamojo = '3/0/5'
vonia = '3/0/6'
thermostat_Heating_Cooling = '3/6/20'
sildymas_siurb_arba_centrin = '6/1/13'
sil_siurb_heat_seatpoint = '11/1/16'
sil_siurb_cool_seatpoint = '11/1/15'


Code:
trieigio_PID_enabled_disabled = '3/5/20'
sil_siurb_onoff = '11/1/21'
sil_siurb_cool_heat = '11/1/20'
sil_siurb_cool_heat_setpoint = '11/1/3'
sil_siurb_heat_seatpoint = '11/1/16'
sil_siurb_cool_seatpoint = '11/1/15'
dv1_voztuvas = '4/5/13'
dv2_voztuvas = '4/5/14'
srb1_cirkuliacinis = '4/5/11'
srb2_cirkuliacinis = '4/5/12'
sildymas_siurb_arba_centrin = '6/1/13'
esamas_klimato_rezimas = '6/1/7'
thermostat_Heating_Cooling = '3/6/20'
holas = '3/0/1'
svetainė = '3/0/3'
kambario = '3/0/4'
miegamojo = '3/0/5'
vonia = '3/0/6'
adresas = event.dst
--************************Debugging*********************************
local function logEventWithAddress(event, address)
   
log("Event triggered by address " .. address .. ": " .. event)
end


--*********************Valve control - central heating**************************************
if adresas == sildymas_siurb_arba_centrin or adresas == thermostat_Heating_Cooling then
 
if  not grp.getvalue(sildymas_siurb_arba_centrin) 
 
    and grp.getvalue(thermostat_Heating_Cooling) 
    then 
   
 
    grp.checkwrite (sil_siurb_cool_heat, true) 
      os.sleep(1)
    grp.checkwrite (srb1_cirkuliacinis,true) 
   
 
   
    grp.checkwrite (sil_siurb_onoff, false)
    grp.checkwrite (dv1_voztuvas,true)
    grp.checkwrite (dv2_voztuvas,false) 
    grp.checkwrite (trieigio_PID_enabled_disabled, false)
    logEventWithAddress("Valve control - Central heating", adresas)
 
end
end
--*********************Valve control - Heat pump heating**************************************
if adresas == sildymas_siurb_arba_centrin or adresas == thermostat_Heating_Cooling then
 
if grp.getvalue(sildymas_siurb_arba_centrin) 
 
  and grp.getvalue(thermostat_Heating_Cooling) 
  then
   
 
  grp.checkwrite (sil_siurb_cool_heat, true) 
  os.sleep(1)
  grp.checkwrite (srb1_cirkuliacinis,false) 
  grp.checkwrite (sil_siurb_onoff, true) 
 
 
  grp.checkwrite (dv1_voztuvas,false) 
  grp.checkwrite (dv2_voztuvas,true) 
  grp.checkwrite (trieigio_PID_enabled_disabled, true) 
  logEventWithAddress("Valve control - Heat pump HEATING", adresas)
  end
end
--*********************Valve control - Heat pump cooling**************************************

if not grp.getvalue(thermostat_Heating_Cooling)
    then
 
 
  grp.checkwrite (sil_siurb_cool_heat, false) 
  os.sleep(1)
  grp.checkwrite (sil_siurb_onoff, true) 
 
  grp.checkwrite (srb1_cirkuliacinis,false) -- SRB1 OFF
  grp.checkwrite (dv1_voztuvas,false) 
  grp.checkwrite (dv2_voztuvas,true) 
  grp.checkwrite (trieigio_PID_enabled_disabled, true)
  logEventWithAddress("Valve control - Heat pump COOLING", adresas)
  end
Reply


Messages In This Thread
variable value lost sometimes - by Osvaldas - 20.12.2023, 16:03
RE: variable value lost sometimes - by admin - 20.12.2023, 16:16
RE: variable value lost sometimes - by admin - 22.12.2023, 08:50
RE: variable value lost sometimes - by admin - 22.12.2023, 09:01

Forum Jump: