Add battery status to Tile tracker

I have achieved this via a template helper.

If the last location update “last_timestamp” is older than one week, then assume it’s battery has ran out. This is crude, but works.

It does not help with the issue of the location being reported as “active” even when it’s not been updated for months due to the battery running out.

I then use the Blueprint Low battery level detection & notification for all battery sensors to notify me of any low batteries.

{% if as_timestamp(now()) - as_timestamp(state_attr('device_tracker.bluetooth_speaker', 'last_timestamp')) > 604800 %}
  1
{% else %}
  0
{% endif %}




2 Likes