Can some one help me with this script PLEASE!!!
When running this script I get an error: "Script error in file: CustmSensorScript.txt: 13: Type mismatch:'hs.setdevicevalue' in line 24". I modified this script off of one of Skibum's old WD scripts and I can't see any syntax error so it must be something in script programming I don't know.
The file below= CustmSesorScript.txt
sub main ()
'Get Data from WDisplay customtextout for use with Homeseer
dim f, fs
dim data1, day,month,year,hour,minute,windspeed,humidity,basetemp,libra rytemp,fishtank
Set fs=CreateObject("Scripting.FileSystemObject")
set f=fs.OpenTextFile("C:\customtextout.txt")
Do While NOT f.AtEndOfStream
data1 = f.ReadLine
Loop
f.close
day=hs.StringItem(data1,1,",")
month=hs.StringItem(data1,2,",")
year=hs.StringItem(data1,3,",")
hour=hs.StringItem(data1,4,",")
minute=hs.StringItem(data1,5,",")
windspeed=hs.StringItem(data1,6,",")
humidity=hs.StringItem(data1,7,",")
basetemp=hs.StringItem(data1,8,",")
librarytemp=hs.StringItem(data1,9,",")
fishtank=hs.StringItem(data1,10,",")
hs.setdevicestring "y1",windspeed & " ",true
hs.setdevicevalue "y1",windspeed
hs.setdevicestring "y2",humidity & " %",true
hs.setdevicevalue "y2",humidity
hs.setdevicestring "y3",basetemp & " Degrees F",true
hs.setdevicevalue "y3",basetemp
hs.setdevicestring "y4",librarytemp & " Degrees F",true
hs.setdevicevalue "y4",librarytemp
hs.setdevicestring "y5",fishtank & " Degrees F",true
hs.setdevicevalue "y5",fishtank
end sub
and the 'customtextout.txt' file is this:
11,06,2004,23,33,2.6 mph,43,-4.0,70.5,76.7
The customtext.txt is this:
%date-day%,%date-month%,%date-year%,%time-hour%,%time-minute%,%avgspd%,%dallasextrahum2%,%dallasextratemp1%,%extra temp3%,%extratemp2%
The "y1" (windspeed)displays OK in the HS device page for "y1", but the script will not update the "y2 thru y5". I'm a newby at scripting and would really appreciate some help. My previous programming was limited to "Basic" on an apple lle in the late 80's and that was pretty limited.
Appreciate any help you can give, thanks, Mick
When running this script I get an error: "Script error in file: CustmSensorScript.txt: 13: Type mismatch:'hs.setdevicevalue' in line 24". I modified this script off of one of Skibum's old WD scripts and I can't see any syntax error so it must be something in script programming I don't know.
The file below= CustmSesorScript.txt
sub main ()
'Get Data from WDisplay customtextout for use with Homeseer
dim f, fs
dim data1, day,month,year,hour,minute,windspeed,humidity,basetemp,libra rytemp,fishtank
Set fs=CreateObject("Scripting.FileSystemObject")
set f=fs.OpenTextFile("C:\customtextout.txt")
Do While NOT f.AtEndOfStream
data1 = f.ReadLine
Loop
f.close
day=hs.StringItem(data1,1,",")
month=hs.StringItem(data1,2,",")
year=hs.StringItem(data1,3,",")
hour=hs.StringItem(data1,4,",")
minute=hs.StringItem(data1,5,",")
windspeed=hs.StringItem(data1,6,",")
humidity=hs.StringItem(data1,7,",")
basetemp=hs.StringItem(data1,8,",")
librarytemp=hs.StringItem(data1,9,",")
fishtank=hs.StringItem(data1,10,",")
hs.setdevicestring "y1",windspeed & " ",true
hs.setdevicevalue "y1",windspeed
hs.setdevicestring "y2",humidity & " %",true
hs.setdevicevalue "y2",humidity
hs.setdevicestring "y3",basetemp & " Degrees F",true
hs.setdevicevalue "y3",basetemp
hs.setdevicestring "y4",librarytemp & " Degrees F",true
hs.setdevicevalue "y4",librarytemp
hs.setdevicestring "y5",fishtank & " Degrees F",true
hs.setdevicevalue "y5",fishtank
end sub
and the 'customtextout.txt' file is this:
11,06,2004,23,33,2.6 mph,43,-4.0,70.5,76.7
The customtext.txt is this:
%date-day%,%date-month%,%date-year%,%time-hour%,%time-minute%,%avgspd%,%dallasextrahum2%,%dallasextratemp1%,%extra temp3%,%extratemp2%
The "y1" (windspeed)displays OK in the HS device page for "y1", but the script will not update the "y2 thru y5". I'm a newby at scripting and would really appreciate some help. My previous programming was limited to "Basic" on an apple lle in the late 80's and that was pretty limited.
Appreciate any help you can give, thanks, Mick
Comment