Sub Main(parms As Object)
Dim inputStr As String = hs.GetUrl("192.168.0.170", "/analogread.tpl", False, 80)
Dim rows() As String = Split(inputStr, "
")
rows(2) = rows(2).Replace("
", "")
'hs.writelog("Row 1 " & rows(1))
'hs.writelog("Row 2 " & rows(2))
dim TempPool as Integer
dim AnalogVoltDataPool as Integer
Dim OHMSPool as Integer
dim TempKPool as Integer
Dim tempCPool as Integer
Dim tempFPool as Integer
TempPool=convert.toint32(rows(2))
'Convert to Temp of Pool
AnalogVoltDataPool = (TempPool / 341)
OHMSPool = AnalogVoltDataPool/((5-AnalogVoltDataPool)/100000)
TempKPool = (1/((1/298.5)+(1/3400*(Math.log(OHMSPool/10000)))))
TempCPool = (TempKPool-273.15)
'TempCPool = Round(TempCPool,1)
TempFPool = ((TempCPool*(9/5))+32)
'TempFPool = Round(TempFPool,1)
TempCPool = TempCPool*10
'MsgBox TempC &"C - "&TempF &"F"
hs.SetDeviceValueByName ("Pool Air Temp", TempCPool)
hs.setdevicestring("V2",CStr((TempCPool)/10),True)
The raw web page being accessed, the value I would like is the 185 after the
See attached file
The LOG shows the following when I try and run
Error Script compile error: Statement cannot appear within a method body. End of method assumed.on line 49