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

Posted on
Tue Oct 29, 2019 8:14 pm
hamw offline
Posts: 1212
Joined: Mar 31, 2008

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

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

Posted on
Sat Nov 09, 2019 2:21 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

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

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.")

Image

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 0 guests