Announcement
Collapse
No announcement yet.
HSBuddy Clients Current Longitude and Latitude
Collapse
X
-
avargaskun thought of a potential stop-gap... If you added a Trigger for 'any change' and stored data for each device (lat/log & fence) in separate global variables.... We could then have a single event run when "Any device" changes, and then have the HS event write to our own created virtual devices?
Leave a comment:
-
Originally posted by avargaskun View PostI will look into this - hoping to work on geolocation improvements once I finish some work on dashboards.
Not sure if a viable workaround, but just want to make sure you're aware that you can view a map of current device locations from within the plugin configuration page. If you go to Plugins > HSBuddy > Geofences and then tap on the "Clients" tab.
Leave a comment:
-
I will look into this - hoping to work on geolocation improvements once I finish some work on dashboards.
Not sure if a viable workaround, but just want to make sure you're aware that you can view a map of current device locations from within the plugin configuration page. If you go to Plugins > HSBuddy > Geofences and then tap on the "Clients" tab.
Leave a comment:
-
avargaskun would you be open to integrating this functionality directly into the plugin? Would be great to have vDevices to show where the family is. thx
Leave a comment:
-
Hi Will,
thank you for sharing the script! I will try this weekend.
best regards,
Walter
Leave a comment:
-
Walter
See below. I originally got this from mrhappy and sparkman a few years back and revised it for my use to scrape the lat/lon HS device values and export the result to a HS device string. Its not the most elegant script and requires the Homeseer GPS devices to be devicevalues but it works for me. Good luck and if you need anything else let me know?
Will
https://msdn.microsoft.com/en-us/library/ff701710.aspx
PHP Code:Sub Main(ByVal Parm As Object)
Dim APIKey As String = "YourBingAPIKeyHere"
Dim location As String
Dim Latitude As String= (hs.DeviceValueEx(3682)) 'my HS3 Lat devicevalue
Dim Longitude As String= (hs.DeviceValueEx(3680)) 'my HS3 Lon devicevalue
location = (Latitude & "," & Longitude) 'current position
Try
Dim XMLData As New XmlDocument
Dim URLString As String = "http://dev.virtualearth.net/REST/v1/Locations/" & location & "?o=xml&key=" & APIKey
XMLData.Load(URLString)
Dim sNS As String = XMLData.DocumentElement.Attributes("xmlns").Value
Dim oNsMgr = New XmlNamespaceManager(XMLData.NameTable)
oNsMgr.AddNamespace("def", sNS)
Dim BLocation As String = XMLData.SelectSingleNode("//def:Name", oNsMgr).InnerText
'hs.writelog("Address", (BLocation))
hs.SetDeviceString(3683, "<img src='images\Bing\world.png' width='32'>" & " " & BLocation, True) 'my HS3 devicestring
Catch ex As Exception : hs.writelog("LocationScript", "Error: " & ex.Message.ToString)
End Try
End Sub
Leave a comment:
-
Hi Will,
Can you share this Bing maps script?
thanks, Walter
Originally posted by will40 View PostI was able to duplicate wallee method and took it a step further and write the device strings with address, city, state using a Bing maps script. Is there any way to trigger an event from any change in the plug-in's Global Variable rather than scraping the HS log for HSB's GPS coords?
Leave a comment:
-
That should work fine.
The file watcher instructions are slightly wrong. You need to use the three Homeseer 3 dlls (not the HS4 versions).
Edit: Instructions changed and 3 Homeseer dll's added to download zip.
Leave a comment:
-
Thanks Jon. I am actually testing out your file watcher script now to see if any change in the DB file to use as a trigger.
I will try your poll solution next.
Leave a comment:
-
There is no native method to trigger on Global Variable change..
You could poll a script to check its current value and compare against the previous value and if different, trigger an event....
Leave a comment:
-
I was able to duplicate wallee method and took it a step further and write the device strings with address, city, state using a Bing maps script. Is there any way to trigger an event from any change in the plug-in's Global Variable rather than scraping the HS log for HSB's GPS coords?
Leave a comment:
-
I managed to do this with the SDJ-health plug-in using the log monitor. HSBuddy is logging the lat/long in the HS log. I made a trigger on the incoming Logtext This is written to a global var within the log monitor plugin. Then I copy this data to a virtual device with an event.
Leave a comment:
Leave a comment: