If you are the type of person that forgets where the car is parked, or if you have a Bluetooth speaker / headphones that you forgot where you put it, you can enable in Ariela the HFP / A2DP MQTT sensors in order to send to your Home Assistant server the last Bluetooth devices connected to those profiles.
In order to enable these sensor, go to Ariela -> Settings -> Sensors. Something like this should appear:
HOW IT WORKS
Whenever a Bluetooth Device connects / disconnect from your phone, eg: Bluetooth stereo, car Bluetooth etc, Ariela will going to send the device information’s like mac address, device name. Also, if possible Ariela will include GPS coordinates when that event occur.
If the GPS coordinates are also send, Ariela will include a Google Maps link which in Ariela when pressed will open Google Maps with directions to those coordinates.
Automation example that will track a Bluetooth device position (creates also a device_tracker entity)
- Using MQTT sensor
- id: '1552465990326'
alias: Car Position Automation
trigger:
- platform: mqtt
topic: homeassistant/sensor/android_galaxy_s8_hfp/attributes
condition:
- condition: template
value_template: '{{ trigger.payload_json[''last_device_mac''] == ''00:C0:59:0C:0F:35''
}}'
- condition: template
value_template: '{{ trigger.payload_json.last_device_longitude is defined }}'
action:
- data_template:
dev_id: my_car_id
gps:
- '{{ trigger.payload_json.last_device_latitude }}'
- '{{ trigger.payload_json.last_device_longitude }}'
gps_accuracy: 1
host_name: 'My Car'
mac: '00:C0:59:0C:0F:35'
source_type: gps
service: device_tracker.see
2. Using mobile_app sensor
- id: '1566307028657'
alias: Find My Car Automation
trigger:
- entity_id: sensor.galaxy_s8_hfp_sensor
from: 'true'
platform: state
to: 'false'
condition: []
action:
- data_template:
dev_id: my_car_id
gps:
- "{{ state_attr('sensor.galaxy_s8_hfp_sensor', 'last_device_latitude') }}"
- "{{ state_attr('sensor.galaxy_s8_hfp_sensor', 'last_device_longitude') }}"
gps_accuracy: 1
host_name: My Car
mac: 00:C0:59:0C:0F:35
source_type: gps
service: device_tracker.see
How it works:
- it waits for Ariela to trigger that the HFP (headphone) profile state is changed
- if the mac address matches the bluetooth car mac address, and the payload also contains the gps coordinates, then it creates / updates the device tracker entity