owntracks / talk

Questions, talk about OwnTracks
32 stars 4 forks source link

ibeacon as trigger for location update #13

Closed tonire1702 closed 7 years ago

tonire1702 commented 7 years ago

Hello guys,

the following is my goal and perhaps you can help me :)

I am using homeassistant in combination with owntrack for my smarthome. Everything is working fine except that sometimes owntrack doesn't update the location when i come home. For example if i am driving home from work by car the last location update occur 200 meter away from home and so no new update will be send for a long time. In fact homeassistant says i am not home. I can now set the radius to 500 meter in homeassistant or set the location update in owntrack higher. Both solutions are not perfect. My idea was to buy a beacon and place it on the frontdoor. Owntracks should detect the beacon and this should tricker a location update. At the moment it is triggering a enter and leave waypoint event.

The problem with this is that i only have one beacon and when i move at the house i get many enter/leave notification from owntrack. I don't want to buy multiple beacons, Is it possible that the beacon is only used as a trigger for a location update? This would help me very much and i can set the beacon to a lower transmit power and use it as a simple trigger.

Thanks Toni

ckrey commented 7 years ago

@tonire1702

I use an iBeacon in my home for exactly the same reason.

In iOS:

If you define your iBeacon without Share enabled, entering or leaving a beacon region just triggers a location update with trigger b(for beacon).

If you define your iBeacon with Share, it triggers a location update and generates an enter/leave event.

owntracks/user/device/event {"t":"b","tst":1496227148,"acc":10,"_type":"transition","event":"enter","lon":6.0,"lat":51.0,"wtst":1495610823,"tid":"5c","desc":"blukii"}
owntracks/user/device {"cog":242,"batt":100,"lon":6.0,"acc":10,"vel":0,"vac":6,"lat":51.0,"t":"b","conn":"w","tst":1496227148,"alt":38,"_type":"location","tid":"5c"}

In addition I setup a region with a relatively small radius (50m) around my home, which triggers a location update too.

tonire1702 commented 7 years ago

Ok i checked it. On Android i still get the enter/leave notification, even when sharing is turned off. I need exactly what you describe in your post.

Thanks

binarybucks commented 7 years ago

I haven't added that on Android yet

tonire1702 commented 7 years ago

Ok, good to know, that it is not a missconfiguration. Perhaps you can add this feature if it costs not much time.

Thanks for your great support

Toni

binarybucks commented 7 years ago

Already done. Will be in the next version ;)

tonire1702 commented 7 years ago

Wow thank you :) Keep up the amazing work.

Toni

binarybucks commented 7 years ago

Fixed in https://github.com/owntracks/android/commit/6c624c09120e13fb1a5c8d6e85eb3bf24164ea4c