Moved more to packages

This commit is contained in:
2022-10-12 11:20:47 +13:00
parent 728b9eee62
commit fd69d971f5
17 changed files with 127 additions and 125 deletions

View File

@@ -0,0 +1,20 @@
sensor:
- platform: template
sensors:
devices_with_low_battery:
friendly_name: "Devices with low battery"
unit_of_measurement: devices
value_template: >-
{{ states.sensor
| selectattr('attributes.device_class', 'eq', 'battery')
| map(attribute='state')
| reject('in', ['unknown', 'unavailable', 'Ok'])
| map('int', -1) | select('le', 97)
| list | count
}}
icon_template: >-
{% if is_state('sensor.devices_with_low_battery', '0') %}
mdi:check-circle
{% else %}
mdi:battery-alert
{% endif %}