Comments

Car Tracking — 5 Comments

    • Good question. You may ask the ebay seller of this product. Don’t know if the cellphone datanetwork of this device will work in the US. GPS-trace.com should (for as far as I know) work in the US. It’s location independent.

  1. ‘A LITLE BETTER SCRIPT FOR HOMESEER

    ‘——————————————————————————————————————————————-
    ‘ GPS Tracking integrtation with HOMESEER
    ‘ by DJF3 – https://www.domoticaworld.cominfo@www.domoticaworld.com
    ‘ version 0.4 – Mar 04 2013 – Have to update, current links don’t work anymore
    ‘ version 0.3 – Jan 12 2012 – added link to Google Maps based on the coordinates
    ‘ Mar 15 2012 – Track_U (last update) device now shows days in device VALUE
    ‘ version 0.2 – Oct 24 2011
    ‘ Updated code because of change in GPS trace website. Added debug level
    ‘ version 0.1 – May 10 2010
    ‘ Tracking integration of Xexun TK102/103 tracker and http://www.gps-trace.com with HomeSeer
    ‘ HOW: Create status-only devices in HS and modify the device-codes below,
    ‘ run script with parameter (“Main”)
    ‘ Set strDebug to 1 = writing to LOG INSTEAD of writing to device
    ‘ Set strDebug to 2 = debug level 1 + Maps and more strings
    ‘ Leave Track_MAPdev empty if you don’t want a google MAP with location
    ‘ TODO:
    ‘ – Fine-tune small Google Map in HS device
    ‘ – Add your ‘home’ location
    ‘ – Add ‘what to do when your car was NOT in Home_location but now it is’

    sub Main(byVal parm As Object)

    dim strDebug as String = 0 ‘DJ: if set to 1 NO data will be written to devices
    dim Track_Xdev as String = “G94” ‘X
    dim Track_Ydev as String = “G95” ‘Y
    dim Track_Sdev as String = “G96” ‘Speed
    dim Track_Tdev as String = “G97” ‘Time last seen
    dim Track_Udev as String = “G98” ‘Updated
    dim Track_MAPdev as String = “G99” ‘Google Map device
    dim Home_X as String = “28.2111683333” ‘ Home coordinates X – not used right now
    dim Home_Y as String = “36.431225” ‘ Home coordinates Y – not used right now
    dim GPSuser as String = “XXXXXXXXXXXXXX” ‘ Your Orange tracker username
    dim MapX as Integer = 400 ‘ Google Map Device Width
    dim MapY as Integer = 400 ‘ Google Map Device Height

    dim SeparatorX as String = chr(34) + “,” + chr(34) + “x” + chr(34) + “:” + chr(34)
    dim SeparatorY as String = chr(34) + “,” + chr(34) + “y” + chr(34) + “:” + chr(34)
    dim SeparatorS as String = chr(34) + “,” + chr(34) + “s” + chr(34) + “:” + chr(34)
    dim SeparatorT as String = chr(34) + “,” + chr(34) + “t” + chr(34) + “:” + chr(34)
    dim SeparatorU as String = chr(34) + “,” + chr(34) + “ti” + chr(34) + “:” + chr(34)
    dim SeparatorU1 as String = chr(34) + “}” + “]”

    dim varVersion as String = “0.4”
    dim DataStrng as String
    dim Path, Path1 as String
    dim Track_X, Track_Xdata as String
    dim Track_Y, Track_Ydata as String
    dim Track_S, Track_Sdata as String
    dim Track_T, Track_Tdata as String
    dim Track_U, Track_Udata as String
    dim Track_MAP as String

    varVersion = “DJ_GPS_Track_” + varVersion
    Path = “https://trc-api.wialon.com”
    Path1 = “/wialon/locator.html?u=” & GPSuser

    ‘————————————————————————————————————————-
    Try ‘DJ: get DATA from Tracker website
    If strDebug >1 then hs.writelog(varVersion,”URL=” & Path & Path1)
    DataStrng = hs.GetURL(Path,Path1,False,80)
    If strDebug >1 then hs.writelog(varVersion,”DataStrng=” & DataStrng)
    If Len(DataStrng)=0 then hs.writelog (varVersion,”Unable to get data – check internet connection”):exit sub
    Catch ex As Exception
    hs.writelog(varVersion,”Error at 1-Getting data (” & ex.Message & “)”)
    End Try
    hs.writelog(varVersion,”DataStrng=” & DataStrng)
    ‘————————————————————————————————————————-

    Try ‘DJ: get X data from Tracker
    Track_Xdata = hs.stringitem(DataStrng,2,”units”)
    If strDebug >0 then hs.writelog(varVersion,”Track_Xdata=” & Track_Xdata)
    Track_X = Trim(hs.stringitem(Track_Xdata,1,SeparatorY))
    Track_X = Trim(hs.stringitem(Track_X,2,SeparatorX))
    If strDebug >0 then hs.writelog(varVersion,”Track_X1=” & Track_X)
    ‘ Track_X = Mid(Track_X,4,Len(Track_X)-6)
    If strDebug > 0 then hs.writelog(varVersion,”Track_X2=” & Track_X)
    If strDebug > 0 then hs.writelog(varVersion,”Track_X:” & Track_X)
    If strDebug = 0 then hs.setdevicestring(Track_Xdev,Track_X,TRUE)

    Catch ex As Exception
    hs.writelog(varVersion,”Error at 2-Track_X (” & ex.Message & “)”)
    End Try

    ‘————————————————————————————————————————-
    Try ‘DJ: get Y data from Tracker
    Track_Ydata = hs.stringitem(DataStrng,2,”units”)
    If strDebug >0 then hs.writelog(varVersion,”Track_Ydata=” & Track_Ydata)
    Track_Y = Trim(hs.stringitem(Track_Ydata,1,SeparatorS))
    Track_Y = Trim(hs.stringitem(Track_Y,2,SeparatorY))
    If strDebug >0 then hs.writelog(varVersion,”Track_Y1=” & Track_Y)
    ‘ Track_Y = Mid(Track_Y,4,Len(Track_Y)-6)
    If strDebug > 0 then hs.writelog(varVersion,”Track_Y2=” & Track_Y)
    If strDebug > 0 then hs.writelog(varVersion,”Track_Y:” & Track_Y)
    If strDebug = 0 then hs.setdevicestring(Track_Ydev,Track_Y,TRUE)

    Catch ex As Exception
    hs.writelog(varVersion,”Error at 2-Track_Y (” & ex.Message & “)”)
    End Try

    ‘————————————————————————————————————————-
    Try ‘DJ: get S data from Tracker
    Track_Sdata = hs.stringitem(DataStrng,2,”units”)
    If strDebug >0 then hs.writelog(varVersion,”Track_Sdata=” & Track_Sdata)
    Track_S = Trim(hs.stringitem(Track_Sdata,1,SeparatorT))
    Track_S = Trim(hs.stringitem(Track_S,2,SeparatorS))
    If strDebug >0 then hs.writelog(varVersion,”Track_S1=” & Track_S)
    ‘ Track_S = Mid(Track_S,4,Len(Track_S)-6)
    If strDebug > 0 then hs.writelog(varVersion,”Track_S2=” & Track_S)
    If strDebug > 0 then hs.writelog(varVersion,”Track_S:” & Track_S)
    If strDebug = 0 then hs.setdevicestring(Track_Sdev,Track_S,TRUE)

    Catch ex As Exception
    hs.writelog(varVersion,”Error at 2-Track_S (” & ex.Message & “)”)
    End Try’————————————————————————————————————————-

    Try ‘DJ: get Time data from Tracker
    Track_Tdata = hs.stringitem(DataStrng,2,”units”)
    If strDebug >0 then hs.writelog(varVersion,”Track_Tdata=” & Track_Tdata)
    Track_T = Trim(hs.stringitem(Track_Tdata,1,SeparatorU))
    Track_T = Trim(hs.stringitem(Track_T,2,SeparatorT))
    If strDebug >0 then hs.writelog(varVersion,”Track_T1=” & Track_T)
    ‘ Track_T = Mid(Track_T,4,Len(Track_T)-6)
    If strDebug > 0 then hs.writelog(varVersion,”Track_T2=” & Track_T)
    If strDebug > 0 then hs.writelog(varVersion,”Track_T:” & Track_T)
    If strDebug = 0 then hs.setdevicestring(Track_Tdev,Track_T,TRUE)

    Catch ex As Exception
    hs.writelog(varVersion,”Error at 2-Track_T (” & ex.Message & “)”)
    End Try
    ‘————————————————————————————————————————-

    Try ‘DJ: get last Update data from Tracker
    Track_Udata = hs.stringitem(DataStrng,2,”units”)
    If strDebug >0 then hs.writelog(varVersion,”Track_Udata=” & Track_Udata)
    Track_U = Trim(hs.stringitem(Track_Udata,1,SeparatorU1))
    Track_U = Trim(hs.stringitem(Track_U,2,SeparatorU))
    If strDebug >0 then hs.writelog(varVersion,”Track_U1=” & Track_U)
    ‘ Track_U = Mid(Track_U,4,Len(Track_U)-5)
    If strDebug > 0 then hs.writelog(varVersion,”Track_U2=” & Track_U)
    If strDebug > 0 then hs.writelog(varVersion,”Track_U:” & Track_U)
    If strDebug = 0 then hs.setdevicestring(Track_Udev,Track_U,TRUE)

    Catch ex As Exception
    hs.writelog(varVersion,”Error at 2-Track_U (” & ex.Message & “)”)
    End Try

    ‘————————————————————————————————————————-

    ‘DJ: Set devicestring of MAP device to display a small google map
    Track_MAP = “Link to location
    If strDebug>1 and Track_MAPdev”” then hs.writelog(varVersion,Track_MAP)

    hs.writelog(varVersion,Track_MAP)

    If Track_MAPdev “” then hs.setdevicestring(Track_MAPdev, Track_MAP,true)

    End Sub

  2. Is this script still working for you? I now need to establish a session before getting the location (according to this documentation: http://sdk.wialon.com/wiki/en/sidebar/remoteapi/codesamples/login). I wrote a little PHP service for getting the location after login using this requests:
    1. login: {‘use’:’youruser’,’password’:’yourpassword”}
    2. get location by operation searchitem (read http://sdk.wialon.com/wiki/en/sidebar/remoteapi/apiref/core/search_item).