Pieter i did a schedule , every 60 min. here's log of HS.
19/03/2009 12.22.05 Info Event Trigger "xml2bwired"
19/03/2009 12.22.05 Info Running script in background: xml2bwired.vb
19/03/2009 13.22.05 Info Event Trigger "xml2bwired"
19/03/2009 13.22.05 Info Running script in background: xml2bwired.vb
and so on...
this is my script
Imports System.IO
Imports System.Net
Imports System.Text
Sub Main(parms As Object)
const url = "
http://www.bwired.nl/Bwiredservice/receive.asp"
const screenname="<Domotica_IT>"
const name="<xxxxx>"
const passwd="<xxxxxx>"
const city="<Dumenza>"
const gpslat="46.018781"
const gpslong="<8.787689>"
const title="<The Wolf's land>"
Const temp = "??"
Const humid = "??"
Const baro = "??"
Const lamp1 = "A2"
Dim myXML
Dim xmlhttp
myXML = hs.CreateStringClass
myXML.Add("<?xml version=""1.0"" encoding=""UTF-8"" ?>")
myXML.Add("<BWired>")
myXML.Add("<Init>")
myXML.Add("<DateTime>" & Now() & "</DateTime>")
myXML.Add("<UserName>" & name & "</UserName>")
myXML.Add("<Password>" & passwd & "</Password>")
myXML.Add("<ScreenName>" & screenname & "</ScreenName>")
myXML.Add("<Gpslat>" & gpslat & "</Gpslat>")
myXML.Add("<Gpslong>" & gpslong & "</Gpslong>")
myXML.Add("<City>" & city & "</City>")
myXML.Add("<Website />")
myXML.Add("<WebCamPicUrl />")
myXML.Add("<Title>" & title & "</Title>")
myXML.Add("</Init>")
myXML.Add("<Entry>")
myXML.Add("<Name>Outside Temperature</Name>")
myXML.Add("<ID>1</ID>")
myXML.Add("<Units>C</Units>")
myXML.Add("<Value>" & CStr(hs.DeviceValue(temp) / 10).Replace(",", ".") & "</Value>")
myXML.Add("</Entry>")
myXML.Add("<Entry>")
myXML.Add("<Name>Outside Humidity</Name>")
myXML.Add("<ID>2</ID>")
myXML.Add("<Units>%</Units>")
myXML.Add("<Value>" & hs.DeviceValue(humid) & "</Value>")
myXML.Add("</Entry>")
myXML.Add("<Entry>")
myXML.Add("<Name>Barometer</Name>")
myXML.Add("<ID>3</ID>")
myXML.Add("<Units>hPa</Units>")
myXML.Add("<Value>" & CInt(hs.DeviceValue(baro) / 100) & "</Value>")
myXML.Add("</Entry>")
myXML.Add("<Entry>")
myXML.Add("<Name>Gate's lamp</Name>")
myXML.Add("<ID>4</ID>")
myXML.Add("<Units></Units>")
myXML.Add("<Value>" & GetStatus(lamp1) & "</Value>")
myXML.Add("</Entry>")
myXML.Add("</BWired>")
xmlhttp = WebRequest.Create(url)
xmlhttp.Method = "POST"
Dim byteArray As Byte() = Encoding.UTF8.GetBytes(myXML.Value)
xmlhttp.ContentType = "text/xml"
xmlhttp.ContentLength = byteArray.Length
Dim dataStream As Stream = xmlhttp.GetRequestStream()
dataStream.Write(byteArray, 0, byteArray.Length)
dataStream.Close()
Dim response As WebResponse = xmlhttp.GetResponse()
response.Close()
myXML.Reset()
End Sub
Public Function GetStatus(ByVal devCode As String) As String
Dim strInpStatus As String
Dim strOutStatus As String
strInpStatus = hs.DeviceStatus(devCode)
Select Case strInpStatus
Case "2"
strOutStatus = "ON"
Case "3"
strOutStatus = "OFF"
Case "4"
strOutStatus = "DIM"
Case Else
strOutStatus = "UNKNOWN"
End Select
Return strOutStatus.ToString
End Function