Bluetooth value template - can´t get it to work

Good Morning,
I´m trying to make some sensors for connected Bluetooth devices on an android device, here an example for my smartwatch:

value_template: ->
  {% if is_state_attr('sensor.pixel_8_pro_bluetooth_connection', 'connected_paired_devices', 'C5:3B:86:C5:9A:0B (Forerunner 45)') %}          
    True
  {% else %}
    False
  {% endif %}  

No matter if the watch is connected or not, the result is always “false”, but in this case, it is definitly connected:

state_class: measurement
connected_not_paired_devices: []
connected_paired_devices:
  - C5:3B:86:C5:9A:0B (Forerunner 45)
paired_devices:
  - F8:5C:7E:7F:56:4E (JBL Flip Essential 2)
  - C5:3B:86:C5:9A:0B (Forerunner 45)
unit_of_measurement: connection(s)
icon: mdi:bluetooth
friendly_name: Pixel 8 Pro Bluetooth connection

Is there some error within the template? Thank you

Your attribute is part of a list, so you have to use list format:


  {% if is_state_attr('sensor.pixel_8_pro_bluetooth_connection', 'connected_paired_devices', ['C5:3B:86:C5:9A:0B (Forerunner 45)']) %}          
    True
  {% else %}
    False
  {% endif %}

Great, that works. Thank you!