Hello,
I have recently started with Home assistant and got stuck with a use case.
The flow I am imagining is: when any bluetooth device is connected to my phone (smart band, headphone,etc.) if any of them has low battery a notification will be added to my home assistant.
The way I thought I would accomplish this is:
- Use automate in phone to get bluetooth battery %of connected device - done
- Send this via a http request to Home assistant - not done
- Update a sensor to store the device name and battery % - not done
- Show some notification - not done
Now I am stuck at creating a sensor, I followed some example and created one:
- platform: template
sensors:
random_number:
friendly_name: "Bluetooth Battery"
value_template: >-
{% if is_state('sun.sun', 'above_horizon') %}
Charge
{% else %}
Don't Charge
{% endif %}
But I am not getting how to use a new entity and store the bluetooth device name and battery %. sun.sun
is a preexisting entity.
I know this is basic and I am missing something pretty obvious, but any guidance is appreciated.