Announcement

Collapse
No announcement yet.

Trying to add a Reference ID Value into a vb script

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Trying to add a Reference ID Value into a vb script

    Managed to "borrow" a script which will turn a google map into a .png file but I am struggling to insert the device reference values into the google line required

    I have tested the actual long/latitude Map string and it creates a .png map for me to view in HSTouch, but obviously instead of numbers I need to grab the values from the device reference values


    Sub Main(ByVal Parms As Object)

    Dim MapStr As String
    Dim ReturnStr As String


    MapStr = "/maps/api/staticmap?center=51.76,-0.23&zoom=17&size=640x400&markers=color:white%7Clabel:A%7C51.76,-0.23&maptype=hybrid&key=GOOGLEAPIKEY"

    ReturnStr = hs.getURLImageEx("http://maps.googleapis.com", MapStr, hs.getapppath & "\map.png", 80)

    If ReturnStr <> "" Then

    hs.writelog("Error", "Error In Downloading Map Image")

    End If

    End Sub


    I need to grab the 51.76 latitudes from my Device Reference ID 792, and my -0.23 longitudes from Device Reference ID 793 but don't know the required script to add these two successfully into the line, anybody know?

    Many thanks in advance...

    #2
    Originally posted by DaveMunn View Post
    I need to grab the 51.76 latitudes from my Device Reference ID 792, and my -0.23 longitudes from Device Reference ID 793 but don't know the required script to add these two successfully into the line, anybody know?
    Are they stored as device values or in the device strings?

    Mike____________________________________________________________ __________________
    HS3 Pro Edition 3.0.0.548

    HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF, Rain8Net+ | RFXCOM | QSE100D | Vantage Pro | Green-Eye | X10: XTB-232, -IIR | Edgeport/8 | Way2Call | Ecobee3

    Comment


      #3
      They are stored as Device Values, the string is blank

      Comment


        #4
        Something like:

        Code:
        Dim Latitude As String = hs.DeviceValueEx(792).ToString
        Dim Longitude As String = hs.DeviceValueEx(793).ToString
        MapStr = "/maps/api/staticmap?center=" & Latitude & "," & Longitude & "&zoom=17&size=640x400&markers=color:white%7Clabel:A%7C" & Latitude & "," & Longitude & "&maptype=hybrid&key=GOOGLEAPIKEY"
        should work.
        HS 3.0.0.548: 1990 Devices 1172 Events
        Z-Wave 3.0.1.262: 126 Nodes on one Z-Net

        Comment


          #5
          Sparkman, that worked a treat. Thank you very much

          Comment

          Working...
          X