I know this question has been asked, I have roamed through several topics here but I still can’t seem to be able to solve my issue.
I am trying to condition an automation that will check my phone for a connected bluetooth device
Entity is [sensor.me_phone_bluetooth_connection] and attribute is a mac address that will go from attribute paired_devices(disconnected from Bluetooth) to connected_paired_devices(connected to Bluetooth)
I have the configuration below in my automation.yaml
alias: Getting to Work
description: ''
trigger: []
condition: []
action:
- choose:
- conditions:
- condition: template
value_template: '{{ is_state_attr(''sensor.me_phone_bluetooth_connection'',''connected_paired_devices'',
''6C:XX:XX:XX:XX:47'') }}'
sequence:
- device_id: device_id
domain: mobile_app
type: notify
message: headphones connected
title: connected
- conditions:
- condition: template
value_template: '{{ is_state_attr(''sensor.me_phone_bluetooth_connection'',''paired_devices'',
''6C:XX:XX:XX:XX:47'') }}'
sequence:
- device_id: device_id
domain: mobile_app
type: notify
message: headphones not connected
title: not connected
Yet when I execute the automation to test it out nothing happens… what am I doing wrong?
The end goal is to control the media volume depending on devices that are connected (my car or headphones) using notification commands.