Announcement

Collapse
No announcement yet.

Documentation?

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

    Documentation?

    I'm very excited about this plugin.. I've been using a "roll your own" method of occupancy detection using Automate on our Android devices for years, but it's gotten hard with battery optimization and with poor cell service, so turning all that work over to Life360 is a nice improvement.

    I don't understand a few things, however, so I'm wondering if you have some documentation available for the plugin. For example:
    • What does Online/Offline mean? I still get updates to other devices even when Offline...
    • What do the Online/Offline buttons do? If they're offline, it switches briefly to online, then switches back. Were those supposed to be Status only VSPs?
    • Does "Is Driving" work? My wife and 2 kids just took a road trip from NC to TX, and I never once saw that field switch. I just found out there's a setting to get driving alerts in the app, so that may be why, but on the other hand, I have driving detection turned on for myself and my status never changed despite a couple of errands I ran today.
    • How does "speed" work? They were driving 75 but all I saw was ~32-38 MPH. I'm guessing this isn't necessarily the fault of the plugin (though stranger things have been known to happen in my own plugins), but what do I need to know about how the plugin gets this info? Anything special?
    • When I turn devices on/off in the config screen, do I need to click "Create Devices" again?


    From my own experience, I would suggest either registering the help doc (if you create one) with HS as a special help link, or adding a link somewhere to the support forum (as an additional menu item or on your config page, etc.).

    You might also consider registering your config page using "RegisterConfigLink()" so it's directly linked from the "Manage Plugins" page.

    Let me know if there's anything I can help with as a test subject.

    #2
    Originally posted by shill View Post
    I'm very excited about this plugin.. I've been using a "roll your own" method of occupancy detection using Automate on our Android devices for years, but it's gotten hard with battery optimization and with poor cell service, so turning all that work over to Life360 is a nice improvement.

    I don't understand a few things, however, so I'm wondering if you have some documentation available for the plugin. For example:
    • What does Online/Offline mean? I still get updates to other devices even when Offline...
    • What do the Online/Offline buttons do? If they're offline, it switches briefly to online, then switches back. Were those supposed to be Status only VSPs?
    Unfortunately the Online/Offline do not work. I have tried several incarnations of that and the Life360 service itself never sets the person to "offline" even after they have been offline for several hours. I tested this just two days ago trying yet again to validate this to see if it was now working and alas it still does not work from Life360 even though they have "disconnected" as a value they return. I do plan to remove this from future updates.

    • Does "Is Driving" work? My wife and 2 kids just took a road trip from NC to TX, and I never once saw that field switch. I just found out there's a setting to get driving alerts in the app, so that may be why, but on the other hand, I have driving detection turned on for myself and my status never changed despite a couple of errands I ran today.
    Yes and no is the answer. This is a hit or miss. I have not seen it work on mine or my wife's phone (Galaxy S6 Active). I do not know if it works on iOS devices or not. My daughter is now driving and she just got an iPhone so I will watch when I know she is driving. This is an "available" item from Life360 so I included it with hope that it will work.
    • How does "speed" work? They were driving 75 but all I saw was ~32-38 MPH. I'm guessing this isn't necessarily the fault of the plugin (though stranger things have been known to happen in my own plugins), but what do I need to know about how the plugin gets this info? Anything special?
This is another hit or miss. I have seen the speed be valid and accurate and I have seen it more often then not be not accurate. This is dependent on the phone, cell/wifi signal, gps signal. I have sat and watched from the raw output and I have seen varied speeds. I even saw my daughters new iphone speed go to -1 so I put in an update to check if the value goes negative to just make it 0.
  • When I turn devices on/off in the config screen, do I need to click "Create Devices" again?
No you do not. The devices will automatically be created/deleted on the next refresh interval. In the latest Beta update I re-worded the "create devices" button text.

From my own experience, I would suggest either registering the help doc (if you create one) with HS as a special help link, or adding a link somewhere to the support forum (as an additional menu item or on your config page, etc.).

You might also consider registering your config page using "RegisterConfigLink()" so it's directly linked from the "Manage Plugins" page.

Let me know if there's anything I can help with as a test subject.
Hey Shill. I'm going to try and answer things inline above for what I can.

I would gladly take your help with continued work on the PI. First info on the RegisterConfigLink() docs or sample if you have it

I'm planning on adding a help page but am undecided on making that a new link or part of the other help pages or both and trying to figure out how to include it in the other help pages. There's still a lot of the HS API I'm figuring out.

So far the Life360 location has been accurate, however there is a lag in the update time. Unfortunately this is a Life360 thing and it varies from phone to phone and persons cell provided and service quality. I've used Life360 on various other platforms and custom scripts with Vera and the lag is there no matter the platform.

There is a un-documented webhook that is available. I'm investigating how to interface with that for quicker updates and trying to see how to integrate that with MyHS to get the webhook results for users not running with port forwarding.

Comment


    #3
    Originally posted by jeubanks View Post
    I would gladly take your help with continued work on the PI. First info on the RegisterConfigLink() docs or sample if you have it

    I'm planning on adding a help page but am undecided on making that a new link or part of the other help pages or both and trying to figure out how to include it in the other help pages. There's still a lot of the HS API I'm figuring out.
    Here's how I handle web page registration:

    1. I've got an Enum defined in my project for "LinkType"

    Code:
    Friend Enum LinkType As Integer
         Link = 1
         Config = 2
         Help = 4
    Enum
    This lets me use bitwise comparison and tell my RegisterWebPage method how I want it to handle this particular link.


    2. The aforementioned RegisterWebPage method:

    Code:
    'register a web page with HS
    Friend Sub RegisterWebPage( _
         enmType As LinkType, _
         strLink As String, _
         strText As String, _
         strTitle As String)
    
         Dim wpd As HomeSeerAPI.WebPageDesc
    
         Log(LogLevel.Trace, "Main." & MethodInfo.GetCurrentMethod.Name, ">>>> " & "Main." & MethodInfo.GetCurrentMethod.Name & "(" & strLink & "," & strText & "," & strTitle & ")")
    
         Try
             hs.RegisterPage(strLink, g_strIFACE_NAME, g_strInstance)
    
             'build the text
             If strText = "" Then strText = strLink
             strText = strText.Replace("_", " ")
    
             'build the title
             If strTitle = "" Then strTitle = strText
    
             'setup the link
             wpd = New HomeSeerAPI.WebPageDesc
             wpd.plugInName = g_strIFACE_NAME
             wpd.plugInInstance = g_strInstance
             wpd.link = strLink
             wpd.linktext = strText & If(g_strInstance.Length > 0, " - " & g_strInstance, "")
             wpd.page_title = strTitle & If(g_strInstance.Length > 0, " - " & g_strInstance, "")
    
             'register the links with HomeSeer according to Type (note: each link can be more than one type since the enum is based on bits)
             If enmType And LinkType.Config Then g_objHSCB.RegisterConfigLink(wpd)
             If enmType And LinkType.Link Then g_objHSCB.RegisterLink(wpd)
             If enmType And LinkType.Help Then hs.RegisterHelpLink(wpd)
    
             Log(LogLevel.Debug, "Main." & MethodInfo.GetCurrentMethod.Name, "Registered link '" & strLink & "'")
    
         Catch ex As Exception
             Log(LogLevel.Error, "Main." & MethodInfo.GetCurrentMethod.Name, "Error registering web links: " & ex.Message, ex.StackTrace)
         End Try
    
         Log(LogLevel.Trace, "Main." & MethodInfo.GetCurrentMethod.Name, "<<<< " & "Main." & MethodInfo.GetCurrentMethod.Name)
    
    End Sub
    3. And finally the use of that during InitIO:

    Code:
    'add the web pages for this plugin      
    RegisterWebPage(LinkType.Config + LinkType.Link, g_strPAGE_CONFIG, "Config", g_strIFACE_NAME & " Plugin Configuration")
    RegisterWebPage(LinkType.Link, g_strPAGE_CLIENTS, "Clients", g_strIFACE_NAME & " Clients")
    RegisterWebPage(LinkType.Link + LinkType.Help, g_strPAGE_DOCS, "Documentation", g_strIFACE_NAME & " Documentation")
    (The "Cilents" page is a plugin-specific page for my TuneBlade plugin as an example of a "normal" link.)

    Comment


      #4
      For Shill

      I've added a "Help" page with information and documentation. I probably left something out. If I did I'll update it going forward.

      The control for the Root devices has been removed since it didn't do anything.

      Update is in the updater in the Beta section.

      Comment

      • Working...
        X