Comfort Automation/ Security System Forums

Full Version: Date and time shifting.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
OK after more hours than I would like to publish, I knocked up the following script in homeseer to sync the clock once a day with local pc time

tested it using hyperterminal and in the panel

myDT & myTm are variables to get the data in the right format

replace the ???? with a valid sign in code

Hope someone finds it useful any comments or suggestions welcome

---------------------------------------------------------

Sub main()

\' Initialize Comport 3
e=hs.OpenComPort(3,\"9600,n,8,1\",1,\"\",\"\")
if e \"\" then
hs.writelog \"Error opening COM3\",e
hs.speak \"Error opening com port 3 \"
else
hs.writelog \"COMPort3\", \"Setup complete\"
end if

myDT = Year(Now()) & Right(\"0\" & Month(now()), 2) & Right(\"00\" & Day(Now()), 2)
myTm = Right(\"0\" & Hour(now()), 2) & Right(\"00\" & Minute(Now()), 2) & Right(\"00\" & Second(Now()), 2)

hs.WriteLog \"Sync Comfort Clock\", myDT & myTm

hs.sendtocomport (3),chr(03) & \"LI????\" & chr(13)
\'replace ???? above with a valid password

hs.WaitSecs 3

hs.sendtocomport (3),chr(03) & \"DT\" & myDT & myTm & chr(13)

hs.closeComPort (3)

end sub
Pages: 1 2