home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
72.65k stars 30.41k forks source link

Bluetooth Connection sensor attribute "connected_paired_devices" is broken #128803

Closed amigthea closed 7 hours ago

amigthea commented 7 hours ago

The problem

As per title, I'm trying to use the home assistant companion "bluetooth connection" sensor and it correctly displays the current bluetooth connected devices in it's 'connected_paired_devices' attribute, but when I try to implement a simple condition based on it's value

condition: state entity_id: sensor.alex_bluetooth_connection attribute: connected_paired_devices state: 00:A0:04:02:1F:B9 (speaker)

is always result false, altough from developer tools I can see that the attribute value is exactly the one I wrote in the state field.

I even checked it in the template tool {{ is_state_attr('sensor.alex_bluetooth_connection', 'connected_paired_devices', '00:A0:04:02:1F:B9 (speaker)') }} same false results, even if the reported attribute state is exactly that.

Can anyone reproduce?

What version of Home Assistant Core has the issue?

core-2024.10.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

No response

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

amigthea commented 7 hours ago

found the problem, the correct syntax is

{{ is_state_attr('sensor.alex_bluetooth_connection', 'connected_paired_devices', ["00:A0:04:02:1F:B9 (speaker)"]) }}