Time for a Little Sun

One of the advantages of living in the Valley of the Sun, we get over 330 days of sunshine.  I like the sun and try to get a little whenever I can.  It occured to me today that Audrey could notify me when the weather is right for grabbing some quick rays.

In about 15 mins, I taught Audrey to check the UV Index a few times an hour and if it at least “3 Moderate”, then she adds an Outlook task.  Then I can decide if it is something I can fit in or not.  Just like a good personal assistant should.  🙂

Details for the Geeks

For the tech on how I did this, here are the ingredients:

Remember, I am not a professional coder by any means so edit for your own purposes and use at your own risk.

‘ check_sunning.txt
‘ Checks to see if UV Index is prime for sunning
‘ Lee Rogers 9:02 AM 1/23/2011
‘ http://digitallifediaries.com

Sub Main

mto = “your@email”
mfrom = “hs.email”
intUVThresh = 3
intTempThresh = 63
strUV = hs.DeviceStringbyname(“House UV Index”)
strTemp = hs.DeviceStringbyname(“House Temperature”)
intTemp = cint(replace(strTemp,”° F”,””))
intUV = cint(left(strUV,1))
isHome = hs.devicestatus (“u1”)
isSunning = hs.devicestatus (“w25”)
strMessage = “Sunning is good, UV Index is at ” & strUV
strNoMessage = “Sunning is no good, UV Index is at ” & strUV
strNoTempMess = “Sunning is no good, temp is at ” & strTemp
strFullDate = dateadd(“h”,”12″,now())
strDate = formatdatetime(strFullDate,2)
strTime = formatdatetime(strFullDate,4)

if intUV >= intUVThresh then
hs.writelog “Sunning”, intUV
if intTemp > intTempThresh then
hs.writelog “Sunning”, intTemp
hs.writelog “Sunning”, isSunning
if isHome = 2 then
if isSunning <> 2 then
hs.SetDeviceStatusByName “House Sunning”, 2
hs.SetDeviceStringByName “House Sunning”, strMessage,TRUE
hs.writelog “Sunning”, strMessage
hs.sendemail mto,mfrom,strMessage,””
end if
end if
hs.SetDeviceStatusByName “House Sunning”, 3
hs.SetDeviceStringByName “House Sunning”, “”,TRUE
hs.writelog “Sunning”, strNoTempMess
end if
hs.SetDeviceStatusByName “House Sunning”, 3
hs.SetDeviceStringByName “House Sunning”, “”,TRUE
hs.writelog “Sunning”, strNoMessage
end if

End Sub

One thought on “Time for a Little Sun”

Leave a Reply