This is the script I've used for the sensors..
The variable 'iobridge' is the value from the light sensor, if its <940 then the homseer device 'S3' is set to On, if its >960 then 'S3' is off. (The difference between the 2 allows for fluctuations - ie clouds!) If the module is 'Offline' then the device is set to 'Unknown'
The variable 'iobridge2' is from the temperature sensor
Greg
'--------------------------------
'IO-204 Homseer Sample Code
'--------------------------------
Sub Main
'--------------------------------
'get the data from the IO-204
'--------------------------------
iobridge = hs.getURL("
http://www.iobridge.com", "/widgets/static/id=xxyyzz1", False, 80)
iobridge2 = hs.getURL("
http://www.iobridge.com", "/widgets/static/id=xxyyzz2", False, 80)
'--------------------------------
'check the data to see if the IO-204 is online
'--------------------------------
If iobridge = "Offline" Then
'--------------------------------
'if offline, update accordingly
'--------------------------------
hs.setdeviceStatus "S3", 17
hs.setdeviceString "S3", "Offline"
hs.SetDeviceLastChange "S3", Now()
hs.setdeviceStatus "S4", 17
hs.setdevicestring "S4", "Offline"
hs.SetDeviceLastChange "S4", Now()
Else
'--------------------------------
'IO-204 is online
'Update 'Night-Time' (S3 Status)
'--------------------------------
If iobridge > 960 Then
hs.setdeviceStatus "S3", 3
hs.setdeviceString "S3", "Off, " & iobridge
End If
If iobridge < 940 Then
hs.setdeviceStatus "S3", 2
hs.setdeviceString "S3", "On, " & iobridge
End If
hs.SetDeviceLastChange "S3", Now()
'--------------------------------
'inside temperature
'--------------------------------
hs.setdevicestring "S4", iobridge2
hs.SetDeviceLastChange "S4", Now()
'--------------------------------
'write the figures to homeseer log
'--------------------------------
hs.writelog "io204-weather", iobridge & " " & iobridge2
End If
End Sub
'--------------------------------
'© Greg Macaree MMX
'--------------------------------