Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion packages/battery_alert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,11 @@
## Added
## - Added Lovelace install instructions :)
##
## 1.3.1 (2020-11-05) by @wst-tdb
## Fixed
## - Changed device detection in group creation to check all devices,
## not just sensors, if they have battery information.
##
################################################################
################################################################

Expand Down Expand Up @@ -816,13 +821,16 @@ automation:
data_template:
object_id: "battery_status"
entities: >-
{%- for item in states.sensor if (
{%- for item in states if (
not is_state_attr(item.entity_id, 'hidden', true)
and
not item.entity_id in state_attr("group.battery_alert", "entity_id")
and (
is_state_attr(item.entity_id, 'device_class', 'battery')
or 'battery' in item.attributes.icon | lower
or (item.entity_id | lower).endswith('_bat')
or (item.name | lower).endswith('_bat')
or (item.attributes.battery_level or item.attributes.battery)
) or (
(
'battery' in item.entity_id | lower
Expand Down