Hi there!
If you’re only using the HA companion apps, you don’t need the iBeacon or BT integration. The companion app and it’s sensors provide everthing you need.
So, let’s get into that. As you already have enabled all you need, it’s just setting up the sensors.
What interests you, is the sensor.your_tablet_name_beacon_monitor
. It holds all the beacons with an UUID and a proximity as attributes. In your Developer Tools
, this sensor
should have a state
“monitoring” and the attributes look something like this:
123480c3-9e23-bbc5-xxxx-0f180e09xxx9_26465_29541: 0.04
123480c3-9e58-bbc5-xxxx-0f180e09xxx9_26465_29541: 0.04
50765cb7-d9ea-xxxx-99a4-fa879613a492_7266_64057: 2.89
761cb3f4-eb5f-4c95-b5bd-xxxxee751041_100_1: 4.36
options: Monitoring, Stopped, Bluetooth is turned off
device_class: enum
icon: mdi:bluetooth
friendly_name: Tablet kitchen Beacon monitor
6636aaaa-9e88-41cc-8e3a-6f0xxxx5236_100_40004: 2.11
123480c3-9e5e-bbc5-0302-0f1xxxx8r469_26465_29541: 0.05
The numbers here are the UUID, followed by a colon, and after that the proximity.
Now go to each phone, and lookup the UUID of that phone. You can find it under the settings of the BT beacon (in the HA app, where you enabled it). Now all you need to do is matching your UUIDs to your phones and you are good to go with a template binary sensor
, like this:
template:
- binary_sensor:
- name: Presence My Beacon
unique_id: presence_my_beacon
device_class: presence
state: >-
{% if state_attr('sensor.your_tablet_name_beacon_monitor', '6636aaaa-9e88-41cc-8e3a-6f0xxxx5236_100_40004') != None)
%}
on
{% else %}
off
{% endif %}
EDIT: Please see the post right under this one from @reste_narquois
! The UUID doesn’t need to be hardcoded!
You check here, if the UUID is listed as an attribute. If it is listed, the tablet is receiving a signal from the beacon. If not, it’s out of reach, aka. “not home”.
Hope this clears it up a little for you!