Renaming bluetooth entities

Hi folks.

I was looking at using the bluetooth connection in the companion app (android) as a trigger when a specific device is connected. I can see the mac address when the device is connected (bluetooth headphones in my motorcycle helmet) and was wondering if there was a way to rename the device either within the app or within home assistant itself, so that it’s easily identifiable when connected, and then use it as a trigger for automations.

It’s not exactly crucial, but it would solve a problem for me.

Paul.

I managed to surprise myself and figure it out. I had to break out the “connected_paired_devices” attribute from the bluetooth connections sensor to start with. I then had to create another sensor to assign a value to two specific inputs, “[ ]” when nothing is connected and “Helmet” when my motorcycle helmet’s bluetooth headset is connected. Having done this, I know that I can add more devices to the sensor if necessary, for other things, though I’m not sure if there’s a limit.

So far it’s working correctly, but if someone can see a better way to do this, I’d love to know.


#
### Break out the paired and connected attribute from Paul Bluetooth sensor
#
      bt_connection:
        friendly_name: "Bluetooth Connection"
        value_template: '{{ state_attr("sensor.phone_bluetooth_connection", "connected_paired_devices") }}'
#
# Assigning output to new sensor taken from bt_connection
#
      phone_bt:
        entity_id: sensor.bt_connection
        value_template: "{%if states.sensor.bt_connection.state == '[]' %}Nothing{% elif states.sensor.bt_connection.state == '[XX:XX:XX:XX:XX:XX]' %}Helmet{% endif %}"