Announcement

Collapse
No announcement yet.

PHLocation V2 Discussion

Collapse
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    I'm trying to figure out what constitutes a reset of the "Time @ Location" device, and 'New Location' event trigger . This is an iPhone device.

    Here's my problem:
    I have configured "Minimum Distance to Move" set to 0.2 miles, yet my 'time @ location" device is resetting well within this 0.2 miles range. The History Viewer does not show these unless the minimum distance is exceeded. This all came to light when I set an event that triggers on "New Location". New Location is triggering as the 'time @ location' resets (which makes sense), however I don't want the 'time @ location' to reset (nor the New Location trigger) if the 'Minimum Distance to Move' is not reached.

    Am I missing how this is supposed to work?
    Mike

    Comment


      Steve, HS v.511 is available for downloading which I have just done will be experimenting with EasyTrigger to see if problem is resolved. I did noticed that my Virtual Device no longer has On/Off control selection so far good... Will advise later, Mike
      Computer: CUK Intel NUC7i7BNH
      Op System: Windows10 Pro - Work Station
      HS Version: HS4 Pro Edition 4.2.19.0

      Plug-Ins: AK Weather 4.0.5.25,APCUPSD 3.3.2.3,BLBackup 2.0.63.0,BLEditor 2.0.11.0,BLGData 3.0.55.0,BLOccupied 2.0.28.0,BLShutdown 1.0.6.0,Blue-Iris 3.1.3.33206,Device History 3.2.0.2,EasyTrigger 3.0.0.76,Harmony Hub 4.0.14.0,iRobot 5.22.41.1,JowiHue 4.0.8.7,Nest 3.0.0.34,NetCam Plugin 1.0.0.5,PHLocation2 3.0.0.64,Pushover 4.0.10.0,Random 3.0.0.2,Restart 1.0.0.7,Ring 1.0.0.9,SDJ-Health 3.1.1.3,Sonos 3.1.0.59,Sonos4 4.0.1.12,UltraCID3 3.0.6681.34300,UltraMon3 3.0.6554.33094,UltraNetCam3 3.0.6413.20219,Unifi 4.0.32.0,Zigbee 4.0.11.0,Z-Wave 4.0.3.0, and Jon00 scripts.

      Comment


        Originally posted by teladog01 View Post

        Just found this thread, looks like maybe the registration server is down.
        The issue with not being able to register should be resolved now.

        Paul..

        Comment


          I am getting theses error when i try v.61. And avery time i restart the plugin

          no error on .60
          Feb-18 16:45:01 PHLocation2 (Startup) Finished at 16:45:01.353
          Feb-18 16:45:01 PHLocation2 Error (Startup) Error count is 1 Plug-In functions disabled.
          Feb-18 16:45:01 PHLocation2 (Startup) Plug-In is registered.
          Feb-18 16:45:01 PHLocation2 (Startup) 0 known locations loaded.
          Feb-18 16:45:01 PHLocation2 (InitHomeLocation) Home Location set. Lat:45.43977 Lon:-73.48173 Rad:0.5 Msg:False
          Feb-18 16:45:01 PHLocation2 (LoadConfigSettings) Distance data provider is set to Pri:None Alt:None
          Feb-18 16:45:01 PHLocation2 (LoadConfigSettings) Static map provider is set to None
          Feb-18 16:45:01 PHLocation2 (LoadConfigSettings) Dynamic map provider is set to None
          Feb-18 16:45:01 PHLocation2 (LoadConfigSettings) Links map provider is set to None
          Feb-18 16:45:01 PHLocation2 (LoadConfigSettings) Elevation Data provider is set to Pri:None Alt:None
          Feb-18 16:45:01 PHLocation2 (LoadConfigSettings) Reverse Geocode provider is set to Pri:OSM Alt:None
          Feb-18 16:45:01 PHLocation2 (LoadConfigSettings) plug-in is working in Metric units.
          Feb-18 16:45:01 PHLocation2 Error (UpgradeDb) Error! No of updates Req doesn't match No of updates done. Not updating DB version.
          Feb-18 16:45:01 PHLocation2 (UpgradeDb) Version 8 update initiated.
          Feb-18 16:45:01 PHLocation2 (BackupDb) Database backed up to BK_20190218164501.db3
          Feb-18 16:45:01 PHLocation2 (UpgradeDb) Called. From v7 To v8
          Feb-18 16:45:01 PHLocation2 Warning (Startup) Database version update required

          Comment


            Originally posted by mwaite View Post
            I'm trying to figure out what constitutes a reset of the "Time @ Location" device, and 'New Location' event trigger . This is an iPhone device.

            Here's my problem:
            I have configured "Minimum Distance to Move" set to 0.2 miles, yet my 'time @ location" device is resetting well within this 0.2 miles range. The History Viewer does not show these unless the minimum distance is exceeded. This all came to light when I set an event that triggers on "New Location". New Location is triggering as the 'time @ location' resets (which makes sense), however I don't want the 'time @ location' to reset (nor the New Location trigger) if the 'Minimum Distance to Move' is not reached.

            Am I missing how this is supposed to work?
            Things should work more or less as you describe in that the time at location should only be reset when a new location trigger occurs.

            I'll look over the code now but I think I know what may cause the extra triggers without a corresponding history entry.

            I'll try and explain.....
            The numbers are irrelevant but as an example, consider a min dist to move setting of 0.5 miles and you're travelling home with a 5 minute iCloud polling interval.
            The plug-in polls iCloud and gets the location of your device which at that time happens to be 0.4 miles from home and is also more than 0.5 miles since the last recorded location so a new location is recorded to history and the time at location device is reset.
            5 minutes later iCloud is polled again and this time you are at home and have stopped moving for the day.
            This presents a problem because you have not moved more than 0.5 miles since that last update, so the plug-in won't update your location and will show you still at the previous location of 0.4 miles away.

            To try and overcome this issue, the plug-in has a mechanism to detect if the user has stopped. I'll not try to explain how this is done here as it will take forever but what it does if it detects that the user has stopped is replace the last stored history record with the current location rather than adding a new record. This will also cause a new location trigger and reset the time at location device.

            Does that sound like it would cause the behaviour you're seeing?

            I can't just remember why it was done this way as opposed to just adding another history record but there must have been some method in my madness at the time
            Either way it would still generate a new location trigger / time at location reset.

            Another situation (discussed here recently) that could cause a new location trigger is that if the max accuracy setting > min dist to move. If this were the case, then you would see it in the history records.

            I don't use actual device location here any more (have no real use for it), but when I did I would use geofencing to control the polling. When I entered the home geofence for example I would have it:

            1. Stop polling.
            2. Wait 5 minutes.
            3. Single poll for current location.

            Polling was then resumed when exiting the geofence.

            Paul..

            Comment


              Originally posted by MattL0 View Post
              I am getting theses error when i try v.61. And avery time i restart the plugin

              no error on .60
              Feb-18 16:45:01 PHLocation2 (Startup) Finished at 16:45:01.353
              Feb-18 16:45:01 PHLocation2 Error (Startup) Error count is 1 Plug-In functions disabled.
              Feb-18 16:45:01 PHLocation2 (Startup) Plug-In is registered.
              Feb-18 16:45:01 PHLocation2 (Startup) 0 known locations loaded.
              Feb-18 16:45:01 PHLocation2 (InitHomeLocation) Home Location set. Lat:45.43977 Lon:-73.48173 Rad:0.5 Msg:False
              Feb-18 16:45:01 PHLocation2 (LoadConfigSettings) Distance data provider is set to Pri:None Alt:None
              Feb-18 16:45:01 PHLocation2 (LoadConfigSettings) Static map provider is set to None
              Feb-18 16:45:01 PHLocation2 (LoadConfigSettings) Dynamic map provider is set to None
              Feb-18 16:45:01 PHLocation2 (LoadConfigSettings) Links map provider is set to None
              Feb-18 16:45:01 PHLocation2 (LoadConfigSettings) Elevation Data provider is set to Pri:None Alt:None
              Feb-18 16:45:01 PHLocation2 (LoadConfigSettings) Reverse Geocode provider is set to Pri:OSM Alt:None
              Feb-18 16:45:01 PHLocation2 (LoadConfigSettings) plug-in is working in Metric units.
              Feb-18 16:45:01 PHLocation2 Error (UpgradeDb) Error! No of updates Req doesn't match No of updates done. Not updating DB version.
              Feb-18 16:45:01 PHLocation2 (UpgradeDb) Version 8 update initiated.
              Feb-18 16:45:01 PHLocation2 (BackupDb) Database backed up to BK_20190218164501.db3
              Feb-18 16:45:01 PHLocation2 (UpgradeDb) Called. From v7 To v8
              Feb-18 16:45:01 PHLocation2 Warning (Startup) Database version update required
              Sorry. Should be fixed in .62 just uploaded.

              Paul..

              Comment


                works great thanks

                Comment


                  Originally posted by sooty View Post

                  Things should work more or less as you describe in that the time at location should only be reset when a new location trigger occurs.

                  I'll look over the code now but I think I know what may cause the extra triggers without a corresponding history entry.

                  I'll try and explain.....
                  The numbers are irrelevant but as an example, consider a min dist to move setting of 0.5 miles and you're travelling home with a 5 minute iCloud polling interval.
                  The plug-in polls iCloud and gets the location of your device which at that time happens to be 0.4 miles from home and is also more than 0.5 miles since the last recorded location so a new location is recorded to history and the time at location device is reset.
                  5 minutes later iCloud is polled again and this time you are at home and have stopped moving for the day.
                  This presents a problem because you have not moved more than 0.5 miles since that last update, so the plug-in won't update your location and will show you still at the previous location of 0.4 miles away.

                  To try and overcome this issue, the plug-in has a mechanism to detect if the user has stopped. I'll not try to explain how this is done here as it will take forever but what it does if it detects that the user has stopped is replace the last stored history record with the current location rather than adding a new record. This will also cause a new location trigger and reset the time at location device.

                  Does that sound like it would cause the behaviour you're seeing?

                  I can't just remember why it was done this way as opposed to just adding another history record but there must have been some method in my madness at the time
                  Either way it would still generate a new location trigger / time at location reset.

                  Another situation (discussed here recently) that could cause a new location trigger is that if the max accuracy setting > min dist to move. If this were the case, then you would see it in the history records.

                  I don't use actual device location here any more (have no real use for it), but when I did I would use geofencing to control the polling. When I entered the home geofence for example I would have it:

                  1. Stop polling.
                  2. Wait 5 minutes.
                  3. Single poll for current location.

                  Polling was then resumed when exiting the geofence.

                  Paul..
                  Very interesting. I can see how this can get convoluted fast. I understand the thresholds you described, but I'm not sure that's what is happening. I have min. distance to move set to 0.2 miles, the phone has not moved more than 50 feet or so for the past 8 hours. Best 'not moving' time has been only about 15 minutes (all day long I've been monitoring). Some logic is definitely different than PHLocation(V1), as I didn't have this issue, it seemed like the min. distance would really have to be exceeded to trigger a new location event. In my case I've lost some functionality. It's a fantastic program though, and my donation is on the way.
                  Mike

                  Comment


                    Originally posted by mwaite View Post

                    Very interesting. I can see how this can get convoluted fast. I understand the thresholds you described, but I'm not sure that's what is happening. I have min. distance to move set to 0.2 miles, the phone has not moved more than 50 feet or so for the past 8 hours. Best 'not moving' time has been only about 15 minutes (all day long I've been monitoring). Some logic is definitely different than PHLocation(V1), as I didn't have this issue, it seemed like the min. distance would really have to be exceeded to trigger a new location event. In my case I've lost some functionality. It's a fantastic program though, and my donation is on the way.
                    There may well be something that I missed. If it's broken I will endeavour to fix it once I know what the cause is.

                    It's getting late here now so I'll look at it in more detail tomorrow but from memory, the only times it would generate a new location trigger and reset the time at location are:
                    1. You have (or it thinks you have) moved more than the min dist.
                    2. The "Force update of position devices" option in config>other is ON.
                    3. It detects a "User has Stopped" event.

                    If you've not moved for a few hours and it's only holding the time at location for 15 minutes, then something isn't right.
                    Assuming you're not going to be moving for the next hour or so, go to the plug-in general config page and set debug to file ON. Leave it on until you observe a couple of resets of the time at location device (with no actual device movement) then switch OFF the debugging and email me the log file.

                    paul dot huddlestone at gmail dot com

                    I'll look over it in the morning.

                    Paul..

                    Comment


                      Paul, I noticed when I downloaded v.61 I got v.63, was I faster than you updating your text description? Mike
                      Computer: CUK Intel NUC7i7BNH
                      Op System: Windows10 Pro - Work Station
                      HS Version: HS4 Pro Edition 4.2.19.0

                      Plug-Ins: AK Weather 4.0.5.25,APCUPSD 3.3.2.3,BLBackup 2.0.63.0,BLEditor 2.0.11.0,BLGData 3.0.55.0,BLOccupied 2.0.28.0,BLShutdown 1.0.6.0,Blue-Iris 3.1.3.33206,Device History 3.2.0.2,EasyTrigger 3.0.0.76,Harmony Hub 4.0.14.0,iRobot 5.22.41.1,JowiHue 4.0.8.7,Nest 3.0.0.34,NetCam Plugin 1.0.0.5,PHLocation2 3.0.0.64,Pushover 4.0.10.0,Random 3.0.0.2,Restart 1.0.0.7,Ring 1.0.0.9,SDJ-Health 3.1.1.3,Sonos 3.1.0.59,Sonos4 4.0.1.12,UltraCID3 3.0.6681.34300,UltraMon3 3.0.6554.33094,UltraNetCam3 3.0.6413.20219,Unifi 4.0.32.0,Zigbee 4.0.11.0,Z-Wave 4.0.3.0, and Jon00 scripts.

                      Comment


                        Paul, I've noticed that my "Home Direction" device takes ~ 5 Mins to change state from approaching to Stopped which obviously affect ones event timing (I believe you made mention in an earlier post about 5 minutes) is there any way of getting a quicker response like <1 minute? Mike
                        Computer: CUK Intel NUC7i7BNH
                        Op System: Windows10 Pro - Work Station
                        HS Version: HS4 Pro Edition 4.2.19.0

                        Plug-Ins: AK Weather 4.0.5.25,APCUPSD 3.3.2.3,BLBackup 2.0.63.0,BLEditor 2.0.11.0,BLGData 3.0.55.0,BLOccupied 2.0.28.0,BLShutdown 1.0.6.0,Blue-Iris 3.1.3.33206,Device History 3.2.0.2,EasyTrigger 3.0.0.76,Harmony Hub 4.0.14.0,iRobot 5.22.41.1,JowiHue 4.0.8.7,Nest 3.0.0.34,NetCam Plugin 1.0.0.5,PHLocation2 3.0.0.64,Pushover 4.0.10.0,Random 3.0.0.2,Restart 1.0.0.7,Ring 1.0.0.9,SDJ-Health 3.1.1.3,Sonos 3.1.0.59,Sonos4 4.0.1.12,UltraCID3 3.0.6681.34300,UltraMon3 3.0.6554.33094,UltraNetCam3 3.0.6413.20219,Unifi 4.0.32.0,Zigbee 4.0.11.0,Z-Wave 4.0.3.0, and Jon00 scripts.

                        Comment


                          Originally posted by sooty View Post

                          There may well be something that I missed. If it's broken I will endeavour to fix it once I know what the cause is.

                          It's getting late here now so I'll look at it in more detail tomorrow but from memory, the only times it would generate a new location trigger and reset the time at location are:
                          1. You have (or it thinks you have) moved more than the min dist.
                          2. The "Force update of position devices" option in config>other is ON.
                          3. It detects a "User has Stopped" event.

                          If you've not moved for a few hours and it's only holding the time at location for 15 minutes, then something isn't right.
                          Assuming you're not going to be moving for the next hour or so, go to the plug-in general config page and set debug to file ON. Leave it on until you observe a couple of resets of the time at location device (with no actual device movement) then switch OFF the debugging and email me the log file.

                          paul dot huddlestone at gmail dot com

                          I'll look over it in the morning.

                          Paul..
                          email sent.
                          Mike

                          Comment


                            Originally posted by sooty View Post

                            I don't use actual device location here any more (have no real use for it), but when I did I would use geofencing to control the polling. When I entered the home geofence for example I would have it:

                            1. Stop polling.
                            2. Wait 5 minutes.
                            3. Single poll for current location.

                            Polling was then resumed when exiting the geofence.

                            Paul..
                            Paul, based on your previous post "(have no real use for it "actual device location" ), then what are you doing then if your not using actual device location? Mike
                            Computer: CUK Intel NUC7i7BNH
                            Op System: Windows10 Pro - Work Station
                            HS Version: HS4 Pro Edition 4.2.19.0

                            Plug-Ins: AK Weather 4.0.5.25,APCUPSD 3.3.2.3,BLBackup 2.0.63.0,BLEditor 2.0.11.0,BLGData 3.0.55.0,BLOccupied 2.0.28.0,BLShutdown 1.0.6.0,Blue-Iris 3.1.3.33206,Device History 3.2.0.2,EasyTrigger 3.0.0.76,Harmony Hub 4.0.14.0,iRobot 5.22.41.1,JowiHue 4.0.8.7,Nest 3.0.0.34,NetCam Plugin 1.0.0.5,PHLocation2 3.0.0.64,Pushover 4.0.10.0,Random 3.0.0.2,Restart 1.0.0.7,Ring 1.0.0.9,SDJ-Health 3.1.1.3,Sonos 3.1.0.59,Sonos4 4.0.1.12,UltraCID3 3.0.6681.34300,UltraMon3 3.0.6554.33094,UltraNetCam3 3.0.6413.20219,Unifi 4.0.32.0,Zigbee 4.0.11.0,Z-Wave 4.0.3.0, and Jon00 scripts.

                            Comment


                              Originally posted by MNB View Post
                              Paul, I've noticed that my "Home Direction" device takes ~ 5 Mins to change state from approaching to Stopped which obviously affect ones event timing (I believe you made mention in an earlier post about 5 minutes) is there any way of getting a quicker response like <1 minute? Mike
                              Got this from Paul the other day. I updated the HomeLocDirCount to 3 points since 2 would sometimes show approaching when I was leaving.

                              Originally posted by Sooty
                              You can adjust that now with ini settings but it's a global setting and not per user.


                              If you're comfortable manually editing the PHLocation2.ini file then the settings go in the [Startup] section and won't be there by default.
                              The defaults which are used if no settings are present are:

                              HomeLocDirTimeOut=5
                              This is the time elapsed (in minutes) without any updates before setting the device to "Stopped".
                              Allowed values are 2 to 60 inclusive

                              HomeLocDirCount=2
                              This is the number of same direction updates to cause a change of state to Approaching or Leaving.
                              Allowed values are 2 to 10 inclusive

                              HomeLocDirBuff=300
                              This is the distance (in metres) that a location must have moved since the last received location to be considered in the above count.
                              Allowed values are anything >= 100

                              If you change the settings in the ini file then you will need to re-start the plug-in for them to take effect.

                              Comment


                                Thanxs Steve this was what I was looking for.. I assume that you did not change your HomeLocDirTimeOut value which is set for 5 minutes? I found that some of the events that were using Home Location Direction took too long (5 minutes) and would not necessary trigger the event reliability especially when there were several that would trigger near real time such as Approaching Home which had Time to Home=6 min, Time at Location=0 and Home Direction=Approaching (which changed 5 minutes later) I would expect that your experiencing the similar outcomes (your Time to Home=10 min)? Mike

                                If I understand the Paul's write up your adjustment suggest that you would have to travel 900 meters with HomeLocDirCount=3 vs. 600 meters if HomeLocDirBuff=300?
                                Computer: CUK Intel NUC7i7BNH
                                Op System: Windows10 Pro - Work Station
                                HS Version: HS4 Pro Edition 4.2.19.0

                                Plug-Ins: AK Weather 4.0.5.25,APCUPSD 3.3.2.3,BLBackup 2.0.63.0,BLEditor 2.0.11.0,BLGData 3.0.55.0,BLOccupied 2.0.28.0,BLShutdown 1.0.6.0,Blue-Iris 3.1.3.33206,Device History 3.2.0.2,EasyTrigger 3.0.0.76,Harmony Hub 4.0.14.0,iRobot 5.22.41.1,JowiHue 4.0.8.7,Nest 3.0.0.34,NetCam Plugin 1.0.0.5,PHLocation2 3.0.0.64,Pushover 4.0.10.0,Random 3.0.0.2,Restart 1.0.0.7,Ring 1.0.0.9,SDJ-Health 3.1.1.3,Sonos 3.1.0.59,Sonos4 4.0.1.12,UltraCID3 3.0.6681.34300,UltraMon3 3.0.6554.33094,UltraNetCam3 3.0.6413.20219,Unifi 4.0.32.0,Zigbee 4.0.11.0,Z-Wave 4.0.3.0, and Jon00 scripts.

                                Comment

                                Working...
                                X