Getting text in a device
Getting text in a device
I have a smartfone which is running tasker, tasker is getting my location and translates it to an adress. I can post this adress as a text file to my server where homeseer is running. I want to import this text file as a device or stringvalue in a virtual homeseer device. Is this possible? I can't script. Is there anybody who can drop a couple of scripting lines for me?
Re: Getting text in a device
Did you think of the possibility to use this functionality?
homeseer.com/support/homeseer/WebHelp2/ ... ontrol.htm
homeseer.com/support/homeseer/WebHelp2/ ... ontrol.htm
Bram
Re: Getting text in a device
Sorry this is not what I mean, I have a text file on my server, in this text file is my adress. I want to import this adress in a virtual homeseer device
Re: Getting text in a device
First of all.
This is such a simple task with soooo many examples that you should be able to do it yourself.
You know what you want to do and you can google.
Learn a new thing each day is the motto.
Update the device and filepath in this code
Save as a .vb file
Remark: Code not tested but should work as planned.
This is such a simple task with soooo many examples that you should be able to do it yourself.
You know what you want to do and you can google.
Learn a new thing each day is the motto.
Update the device and filepath in this code
Save as a .vb file
Remark: Code not tested but should work as planned.
Code: Select all
Public Sub Main(ByVal Parms As String)
Const fsoForReading = 1
Dim Device as String
Dim strDevice as String
Dim objFSO as Object
Dim objFile as Object
'Your virtual device code
Device = "<your device code>"
objFSO = CreateObject("Scripting.FileSystemObject")
Try
objFile = objFSO.OpenTextFile("<full path to your textfile including filename>", fsoForReading )
strDevice = objFile.ReadLine
hs.setdevicestring(Device, strDevice)
Catch e as Exception
hs.WriteLog("Script error",e.Message)
End Try
objFSO = Nothing
objFile = Nothing
End Sub
Bram
Re: Getting text in a device
This works, thanks man !