I've recently started to implement HS3. I have an Oregon weather station and I use an app called Weather Station Data Logger to upload dato to Weather Underground. I stumbled upon sparkmans script here: http://board.homeseer.com/showthread.php?t=172082
Unfortunelately, I can't make it work, and I don't understand the error messages...
Here is the edited script I am using; I'd be very grateful if someone can help me debug this.
This is the error message: Running script, script run or compile error in file: C:/...ulscript.txt1006:Expected ')' in line 2 More info: Expected ')'
Sub Main(Parms As Object)
'http://wiki.wunderground.com/index.php/PWS_-_Upload_Protocol
Dim Debug as Boolean = False
Dim logName As String = "WUnderground" 'set log name for HS log
Dim cDateTime As Date = Now.ToUniversalTime() 'retrieve current time and convert to UTC
If Debug Then hs.writelog(logName,CStr(cDateTime))
Dim sDateTime As String = cDateTime.ToString("yyyy-MM-dd+HH:mm:ss") 'change time to format required by WUnderground
sDateTime = Replace(sDateTime,":","%3A") 'URLEncode :
If Debug Then hs.writelog(logName,sDateTime)
Dim httpCommand As String = "/weatherstation/updateweatherstation.php?ID=xxx&PASSWORD=xxx" 'Change to use your own station ID and password
httpCommand = httpCommand & "&dateutc=" & sDateTime
If hs.DeviceString(45) <> "Communication Failure" Then httpCommand = httpCommand & "&tempf=" & CStr(CDbl((hs.DeviceValueEx(45) * 9/5) + 32))
If hs.DeviceString(44) <> "Communication Failure" Then httpCommand = httpCommand & "&humidity=" & CStr(hs.DeviceValueEx(44))
httpCommand = httpCommand & "&softwaretype=hs"
httpCommand = httpCommand & "&action=updateraw"
If Debug Then hs.writelog(logName, httpCommand)
Dim info2 As String = hs.GetURL("weatherstation.wunderground.com",httpCommand,Fals e,80)
If InStr(info2,"success") > 0 Then
hs.writelog(logName, "Successfully Updated")
Else
hs.writelog(logName, info2)
End If
End Sub
Unfortunelately, I can't make it work, and I don't understand the error messages...
Here is the edited script I am using; I'd be very grateful if someone can help me debug this.
This is the error message: Running script, script run or compile error in file: C:/...ulscript.txt1006:Expected ')' in line 2 More info: Expected ')'
Sub Main(Parms As Object)
'http://wiki.wunderground.com/index.php/PWS_-_Upload_Protocol
Dim Debug as Boolean = False
Dim logName As String = "WUnderground" 'set log name for HS log
Dim cDateTime As Date = Now.ToUniversalTime() 'retrieve current time and convert to UTC
If Debug Then hs.writelog(logName,CStr(cDateTime))
Dim sDateTime As String = cDateTime.ToString("yyyy-MM-dd+HH:mm:ss") 'change time to format required by WUnderground
sDateTime = Replace(sDateTime,":","%3A") 'URLEncode :
If Debug Then hs.writelog(logName,sDateTime)
Dim httpCommand As String = "/weatherstation/updateweatherstation.php?ID=xxx&PASSWORD=xxx" 'Change to use your own station ID and password
httpCommand = httpCommand & "&dateutc=" & sDateTime
If hs.DeviceString(45) <> "Communication Failure" Then httpCommand = httpCommand & "&tempf=" & CStr(CDbl((hs.DeviceValueEx(45) * 9/5) + 32))
If hs.DeviceString(44) <> "Communication Failure" Then httpCommand = httpCommand & "&humidity=" & CStr(hs.DeviceValueEx(44))
httpCommand = httpCommand & "&softwaretype=hs"
httpCommand = httpCommand & "&action=updateraw"
If Debug Then hs.writelog(logName, httpCommand)
Dim info2 As String = hs.GetURL("weatherstation.wunderground.com",httpCommand,Fals e,80)
If InStr(info2,"success") > 0 Then
hs.writelog(logName, "Successfully Updated")
Else
hs.writelog(logName, info2)
End If
End Sub
Comment