Site updated at 2016-12-06 08:11:16 UTC

This commit is contained in:
Travis CI 2016-12-06 08:11:16 +00:00
parent c96b6cd430
commit 9db92b7101
1358 changed files with 220 additions and 236889 deletions

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: Presence-Detection | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/presence-detection/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/>
<updated>2016-12-06T07:45:55+00:00</updated>
<updated>2016-12-06T08:09:11+00:00</updated>
<id>https://home-assistant.io/</id>
<author>
<name><![CDATA[Home Assistant]]></name>
@ -24,7 +24,7 @@ In 2013 Apple introduced iBeacons: a class of Bluetooth low energy (LE) devices
The reason I started using iBeacons was to improve presence detection (and I think thats the case with most people) so that's what Ill discuss in _part 1_. In _part 2_ Ill talk about using iBeacons to track devices that cant track themselves.
### <a class='title-link' name='using-beacons-to-improve-owntracks-location-data' href='#using-beacons-to-improve-owntracks-location-data'></a> Using beacons to improve OwnTracks location data
### {% linkable_title Using beacons to improve OwnTracks location data %}
When you use OwnTracks in standard _major move_ mode (which is kind to your phone battery) it sometimes fails to update when youd like it to. In my case I found that it would often send a location update as I was on my way home, but then not update when I got home. The result would be that Home Assistant would think I was 500M away from home, and take quite a while to notice I was home. It would also mean that the automation that should turn on my lights when I got home didnt work very well! There were a few times when my phone location updated at 2am and turned the lights on for me. Fortunately my wife is very patient!
@ -32,7 +32,7 @@ Luckily, OwnTracks supports iBeacons so I could use them to make presence detect
<!--more-->
### <a class='title-link' name='getting-started' href='#getting-started'></a> Getting Started
### {% linkable_title Getting Started %}
To do this you first need to set up [MQTT] and [OwnTracks] in Home assistant - and make sure that HA can track your phone.
@ -41,7 +41,7 @@ To do this you first need to set up [MQTT] and [OwnTracks] in Home assistant - a
You then have to (A) tell Home Assistant where the beacon is located and (B) tell OwnTracks to recognise the beacon.
#### <a class='title-link' name='a-tell-home-assistant-where-your-beacon-is-located' href='#a-tell-home-assistant-where-your-beacon-is-located'></a> A. Tell Home Assistant where your beacon is located
#### {% linkable_title A. Tell Home Assistant where your beacon is located %}
You tell HomeAssistant about fixed locations by creating a Zone with the longitude and latitude of your beacon. You should also give the zone a name which you will also use when you set up OwnTracks. An an example this zone specifies the location of my drive way.
@ -60,7 +60,7 @@ The radius isnt used by the beacon code, but it is used by the GPS location s
Once youve created the zone - you need to restart HA. The next step is:-
#### <a class='title-link' name='b-tell-owntracks-to-track--your-beacon' href='#b-tell-owntracks-to-track--your-beacon'></a> B. Tell OwnTracks to track your beacon
#### {% linkable_title B. Tell OwnTracks to track your beacon %}
1. Go to the OwnTracks app on your phone
2. Touch the `Regions` menu at the bottom of the screen
@ -89,7 +89,7 @@ So with the steps above you should be able to improve the reliability of trackin
Im also pleased to say I no longer get an _arrive home_ event at 2am that turns the lights on. I hope Ive convinced you that iBeacons are worth trying!
### <a class='title-link' name='mixing-beacons-and-gps-locations' href='#mixing-beacons-and-gps-locations'></a> Mixing Beacons and GPS locations
### {% linkable_title Mixing Beacons and GPS locations %}
You will probably use beacons to make entry into your existing GPS zones more reliable. By default either a beacon or a GPS location can cause you to enter a zone - and HA has some logic that should make them two work well together (it ignores GPS updates when youre in an iBeacon Zone).
@ -120,17 +120,17 @@ You could use this technique to try to detect which room someone is in. This mig
To get this to work youll probably need to experiment with the beacon signal strength to try to match the beacon reception area to the location you want to track. Let me know if you get this to work (it doesnt make sense in my open plan house)
### <a class='title-link' name='conclusion' href='#conclusion'></a> Conclusion
### {% linkable_title Conclusion %}
Presence tracking sounds easy - and it's an important part of Home Automation. Trying it shows how difficult it is to get presence detection right. I've found that iBeacons have improved the reliability and timeliness of knowing where I am, and I hope I encouraged you to try them too.
### <a class='title-link' name='tips' href='#tips'></a> Tips
### {% linkable_title Tips %}
You can find out more about configuring the OwnTracks application and beacons [here](http://owntracks.org/booklet/features/beacons/)
There is information about configuring Homeassistant to use beacons [here](https://home-assistant.io/components/device_tracker.owntracks/)
#### <a class='title-link' name='connections-and-disconnecting' href='#connections-and-disconnecting'></a> Connections and disconnecting
#### {% linkable_title Connections and disconnecting %}
Owntracks treats a region name with a leading `-` as a hint that it shouldn't disconnect after a single missed packet. This improves the ability to keep a connection to a beacon.
@ -138,7 +138,7 @@ However, even when using this feature Ive noticed that you can still lose con
In automations you can use a `for:` to avoid triggering during a brief disconnect, or use a script with a delay. Stay tuned for _part 2_ for an example of this.
#### <a class='title-link' name='using-multiple-beacons-for-the-same-zone' href='#using-multiple-beacons-for-the-same-zone'></a> Using Multiple beacons for the same Zone
#### {% linkable_title Using Multiple beacons for the same Zone %}
iBeacons have a `UUID` (usually set to the same value for beacons from the same manufacturer), as well as a `minor` and `major` number. If you set two beacons to have exactly same details then OwnTracks will think multiple beacons are at the same location.
This means you can have more than one beacon around your home - and a connection to any of them will count as `home` to OwnTracks and HA. This reduces disconnections.