Monitor and control Bluetooth devices¶
Bluetoothctl¶
shell:
button:
- platform: shell
id: disconnect_speaker
name: "Disconnect Speaker"
command: bluetoothctl -- disconnect 00:12:6F:F1:FF:61
binary_sensor:
- platform: shell
name: "Bluetooth Speaker connected"
id: bluetooth_connected
icon: "mdi:bluetooth-settings"
device_class: presence
update_interval: 10s
command: |-
if bluetoothctl info 00:12:6F:F1:FF:61 | grep -q "Connected: yes"; then
echo true
else
echo false
fi