I’ve tried using the binary sensor ble_presence
to scan a BLE device.
This works fine and creates a binary_sensor
, but not an actual device_tracker
entity.
I’ve tried using device_class: presence
in ESPHome and devices show as home
and not_home
, but they are still just a binary_sensor
.
Is there an easy way to fix this? Preferably in ESPHome, but in Home Assistant would work to.
You should be able to use device_tracker.see
in an automation.
- alias: Andrew Occupancy On
trigger:
- platform: template
value_template: "{{ is_state('binary_sensor.some_sensor', 'on') }}"
action:
- service: device_tracker.see
data:
dev_id: andrew
location_name: home
source_type: bluetooth
- alias: Andrew Occupancy Off
trigger:
- platform: template
value_template: "{{ is_state('binary_sensor.some_sensor', 'off') }}"
action:
- service: device_tracker.see
data:
dev_id: andrew
location_name: not_home
source_type: bluetooth
Thanks. I finally got it working.
Only problem now is to get Home Assistant to update the status when restarted. I found a thread somewhere explaining how to do, but can’t find it again :-/
I adapted code from post number 6 here to update the sensor on startup:
Hi,
I have probably the same problem, I am trying to use the BLE presence of a smartwatch tracked by the ESPHome device to be added together with the other devices I use to track a person when at home (i.e. the bluetooth of the phone, the WiFi address of the phone and the BLE presence of the smartwatch in HA - yes, I am using both bluetooth_tracker and bluetooth_le_tracker in HA and they are working with my watchdog code added).
The automation here is overwriting the calculated result of the other tracker and for me that is not good, there is a way to add the new tracker (BLE presence in ESPHome) to the person entity in HA ?
anyone was able to change the timeout on the BLE? When I walk through the house the sensors for every room stay on
for like 10+ minutes