initial push

This commit is contained in:
CeeWeasel
2024-04-14 14:08:56 -04:00
commit 53bf393d14
1111 changed files with 71730 additions and 0 deletions
@@ -0,0 +1,69 @@
alias: "Battery Alert Template"
id: automation_battery_alert_template
initial_state: off
trigger:
- platform: time
at: "10:00:00"
- platform: time
at: "18:00:00"
condition:
condition: or
conditions:
- condition: template
value_template: >-
{%- set threshold = 40 -%}
{%- for item in states.light if (item.attributes.battery_level is defined and item.attributes['battery_level'] | int < threshold) or ("battery" in item.name | lower and ((item.state | int < threshold and item.state|int != 0) or item.state | lower == "low" or item.state | lower == "unknown")) -%}
{%- if loop.first -%}
{{ true }}
{%- endif -%}
{%- endfor -%}
- condition: template
value_template: >-
{%- set threshold = 40 -%}
{%- for item in states.switch if (item.attributes.battery_level is defined and item.attributes['battery_level'] | int < threshold) or ("battery" in item.name | lower and ((item.state | int < threshold and item.state|int != 0) or item.state | lower == "low" or item.state | lower == "unknown")) -%}
{%- if loop.first -%}
{{ true }}
{%- endif -%}
{%- endfor -%}
- condition: template
value_template: >-
{%- set threshold = 40 -%}
{%- for item in states.sensor if (item.attributes.battery_level is defined and item.attributes['battery_level'] | int < threshold) or ("battery" in item.name | lower and ((item.state | int < threshold and item.state|int != 0) or item.state | lower == "low" or item.state | lower == "unknown")) -%}
{%- if loop.first -%}
{{ true }}
{%- endif -%}
{%- endfor -%}
- condition: template
value_template: >-
{%- set threshold = 40 -%}
{%- for item in states.zwave if (item.attributes.battery_level is defined and item.attributes['battery_level'] | int < threshold) or ("battery" in item.name | lower and ((item.state | int < threshold and item.state|int != 0) or item.state | lower == "low" or item.state | lower == "unknown")) -%}
{%- if loop.first -%}
{{ true }}
{%- endif -%}
{%- endfor -%}
- condition: template
value_template: >-
{%- set threshold = 40 -%}
{%- for item in states.lock if (item.attributes.battery_level is defined and item.attributes['battery_level'] | int < threshold) or ("battery" in item.name | lower and ((item.state | int < threshold and item.state|int != 0) or item.state | lower == "low" or item.state | lower == "unknown")) -%}
{%- if loop.first -%}
{{ true }}
{%- endif -%}
{%- endfor -%}
- condition: template
value_template: >-
{%- set threshold = 40 -%}
{%- for item in states.binary_sensor if (item.attributes.battery_level is defined and item.attributes['battery_level'] | int < threshold) or ("battery" in item.name | lower and ((item.state | int < threshold and item.state|int != 0) or item.state | lower == "low" or item.state | lower == "unknown")) -%}
{%- if loop.first -%}
{{ true }}
{%- endif -%}
{%- endfor -%}
action:
- service: notify.mobile_app_pixel_7
data:
message: >-
{% set threshold = 40 %}
{% for item in states.binary_sensor if (item.attributes.battery_level is defined and item.attributes['battery_level'] | int / 5 < threshold) or ("battery" in item.name | lower and ((item.state | int < threshold and item.state|int != 0) or item.state | lower == "low" or item.state | lower == "unknown")) %}
{%- if loop.first %}Binary Sensors:{% endif %}
{{ item.name }} {{ item.attributes.battery_level / 5 }}%
{%- endfor -%}