Hello, my first post here. I have problems with getting some information from sensor state. I just want get information that I’m in a car. Simplest way that I found is - if I’m connected with phone to my car via BT = I’m in car
so I fave something like this:
- platform: template
sensors:
bt_device:
friendly_name: "BT"
value_template: "{{ state_attr('sensor.my_phone_connection', 'connected_paired_devices') }}"
but it returns all connected MAC Adr BT devices. So I added
bt_device_splited:
friendly_name: "BT splited"
value_template: "{{ states.sensor.bt_device.split(',')[0] }}"
Now it returns first listed BT device. If I have luck it can be my car, but…
So I need something, that checks/search state values from bt_device, and if it find specified string (this case MAC Adr) returns - “I’m in Car”