You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure if this is a bug, or a documentation issue. I think it can be covered with the latter.
I have two regions defined:
Thing gpstracker:tracker:XX "GPS tracker - XX" [trackerId="XX"] {
Channels:
Type regionDistance : distanceHome "Distance from Home" [
regionName="Home",
regionCenterLocation="YY,XX",
regionRadius=100,
accuracyThreshold=0
]
Type regionDistance : distanceHomeClose "Close to Home" [
regionName="HomeClose",
regionCenterLocation="YY,XX",
regionRadius=1000,
accuracyThreshold=0
]
Note the difference in radius.
There are 2 items connected to each channel, e.g. XX_Is_At_Home an XX_Is_Close_To_Home respectively.
When the /enter trigger is received, bothXX_Is_At_Home and XX_Is_Close_To_Home are set to true, even though only XX_Is_Close_To_Home should be.
2021-02-23 14:19:30.093 [DEBUG] [nal.provider.AbstractCallbackServlet] - Post message received from OwnTracks tracker: {"_type":"location","acc":15,"alt":118,"batt":83,"conn":"m","lat":YY,"lon":XX,"tid":"XX","tst":1614089969,"vac":1,"vel":0}
2021-02-23 14:19:30.094 [DEBUG] [cker.internal.handler.TrackerHandler] - Update base channels for tracker XX from message: LocationMessage [type=location, trackerId=XX, latitude=YY, longitude=XX, gpsAccuracy=15, batteryLevel=83, timestampMillis=1614089969]
2021-02-23 14:19:30.095 [DEBUG] [cker.internal.handler.TrackerHandler] - Updating distance channels tracker XX
2021-02-23 14:19:30.095 [DEBUG] [cker.internal.handler.TrackerHandler] - Location accuracy threshold check is disabled.
2021-02-23 14:19:30.095 [DEBUG] [cker.internal.handler.TrackerHandler] - Location accuracy threshold check is disabled.
2021-02-23 14:19:30.096 [DEBUG] [cker.internal.handler.TrackerHandler] - Location accuracy threshold check is disabled.
2021-02-23 14:19:30.101 [DEBUG] [cker.internal.handler.TrackerHandler] - Location accuracy threshold check is disabled.
2021-02-23 14:19:30.101 [DEBUG] [cker.internal.handler.TrackerHandler] - Location accuracy threshold check is disabled.
2021-02-23 14:19:30.103 [DEBUG] [ofile.GPSTrackerTriggerSwitchProfile] - Transition trigger HomeClose/enter handled for region HomeClose by profile: ON
2021-02-23 14:19:30.104 [DEBUG] [ofile.GPSTrackerTriggerSwitchProfile] - Transition trigger HomeClose/enter handled for region Home by profile: ON
2021-02-23 14:19:30.108 [DEBUG] [cker.internal.handler.TrackerHandler] - Location accuracy threshold check is disabled.
2021-02-23 14:19:30.111 [DEBUG] [cker.internal.handler.TrackerHandler] - Location accuracy threshold check is disabled.
Note that HomeClose/enter triggers both regions to be switched on:
2021-02-23 14:19:30.103 [DEBUG] [ofile.GPSTrackerTriggerSwitchProfile] - Transition trigger HomeClose/enter handled for region HomeClose by profile: ON
2021-02-23 14:19:30.104 [DEBUG] [ofile.GPSTrackerTriggerSwitchProfile] - Transition trigger HomeClose/enter handled for region Home by profile: ON
The regionNames are matched by the start of the string, not identical strings.
IMO calling this a bug is incorrect as the startsWidth is there for a reason and could be useful(?), but I think this could be made clear in the documentation. It's been a head scatcher for me recently :)
Of course, the solution is to make the region names unique.
Happy to submit a PR if you agree.
The text was updated successfully, but these errors were encountered:
According to the documentation the payload has a "{region}/{event}" format. The quoted code uses a startsWith and endsWith determination. I think it is better to split by the / as that makes it possible to do a full match to the regionname
Hi,
I'm not sure if this is a bug, or a documentation issue. I think it can be covered with the latter.
I have two regions defined:
Note the difference in radius.
There are 2 items connected to each channel, e.g.
XX_Is_At_Home
anXX_Is_Close_To_Home
respectively.When the
/enter
trigger is received, bothXX_Is_At_Home
andXX_Is_Close_To_Home
are set to true, even though onlyXX_Is_Close_To_Home
should be.Note that
HomeClose/enter
triggers both regions to be switched on:I have tracked this down to
openhab-addons/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/profile/GPSTrackerTriggerSwitchProfile.java
Line 71 in e86cc6b
The regionNames are matched by the start of the string, not identical strings.
IMO calling this a bug is incorrect as the
startsWidth
is there for a reason and could be useful(?), but I think this could be made clear in the documentation. It's been a head scatcher for me recently :)Of course, the solution is to make the region names unique.
Happy to submit a PR if you agree.
The text was updated successfully, but these errors were encountered: