Page 1 of 1

Several AS; help needed. will buy BEER!!! #3 Water house v

PostPosted: Tue Oct 29, 2019 8:14 pm
by hamw
This is pretty simple; just running out of time.

Code: Select all
using terms from application "IndigoServer"
   tell application "IndigoServer"
      if ((value of variable "Water_Test_HouseValve_ON" is "true") and value of variable "Water_Test_HouseValve_OFF" is "true") then
         set value of variable "Water_Test_HouseValve_Success" to "true"
         set value of variable "Water_Test_HouseValve_ON" to ""
         set value of variable "Water_Test_HouseValve_OFF" to ""
         set value of variable "Water_Test_Success_TimeStamp" to value of variable "RFX_Outside_Temp_Obs_Time"
         log "House Water Valve working correctly"
      else
         execute group "Water Valve House Test Failed"
         set value of variable "Water_Test_HouseValve_Success" to "false"
         log "House Water Valve not executing. Check that knob on side is set to AUTO. ReRun from basement and ensure valve is turning. If not, check Phidgets box and relays."
         
      end if
   end tell
end using terms from

Re: Several AS; help needed. will buy BEER!!! #3 Water hous

PostPosted: Sat Nov 09, 2019 2:21 pm
by matt (support)
Give this one a try. Untested, but probably works or is really close.

Code: Select all
varHouseValveON = indigo.variables["Water_Test_HouseValve_ON"]
varHouseValveOFF = indigo.variables["Water_Test_HouseValve_OFF"]
varHouseValveSuccess = indigo.variables["Water_Test_HouseValve_Success"]
varSuccessTimestamp = indigo.variables["Water_Test_Success_TimeStamp"]
varRfxOutsideTimestamp = indigo.variables["RFX_Outside_Temp_Obs_Time"]

if varHouseValveON.getValue(str) == "true" and varHouseValveOFF.getValue(str) == "true":
   indigo.variable.updateValue(varHouseValveSuccess, "true")
   indigo.variable.updateValue(varHouseValveON, "")
   indigo.variable.updateValue(varHouseValveOFF, "")
   indigo.variable.updateValue(varSuccessTimestamp, varRfxOutsideTimestamp.getValue(str))
   indigo.server.log(u"House Water Valve working correctly")
else:
   indigo.actionGroups.execute("Water Valve House Test Failed")
   indigo.variable.updateValue(varHouseValveSuccess, "false")

   indigo.server.log(u"House Water Valve not executing. Check that knob on side is set to AUTO. ReRun from basement and ensure valve is turning. If not, check Phidgets box and relays.")