clean up & fixes

This commit is contained in:
Mahasri Kalavala 2022-11-29 21:12:30 -05:00
parent d534709793
commit f9b3225288
2 changed files with 16 additions and 55 deletions

View File

@ -2,16 +2,6 @@ title: Multi Room Audio & TTS
icon: mdi:television
cards:
- type: entities
title: Raspberry Pi Scripts
show_header_toggle: false
entities:
- script.query_disk_info
- script.query_wifi_info
- script.restart_all_raspberrypis
- script.restart_all_snapclients
- script.shutdown_all_raspberrypis
- type: entities
title: Text To Speech
show_header_toggle: false

View File

@ -1,46 +1,18 @@
>
{% macro weather_update() -%}
Outside temperature is {{ states('sensor.dark_sky_apparent_temperature') | round(0) }} degrees.
{%- endmacro -%}
{% macro door_status() -%}
{%- for x in states if x.domain == 'binary_sensor' and 'door_window_sensor' in x.entity_id and x.state == "on" %}
{{ x.name }} is open.
{%- endfor %}
{%- endmacro %}
{%- macro uv_levels() -%}
{%- set uv = states('sensor.pws_uv') | int -%}
{%- if uv >= 6 and uv <= 7 -%}
Current UV index is high. Please be careful outdoors.
{%- elif uv >= 8 and uv <= 10 -%}
Current UV index is very high. It is not advised to go out.
{%- elif uv >= 11 -%}
Current UV index is extremely high. It is highly advised to stay indoors.
{%- else -%}
Good UV levels.
{%- endif -%}
{%- endmacro -%}
{% macro motion_sensor_status() -%}
{% for x in states if x.domain == 'binary_sensor' and 'motion_sensor' in x.entity_id and x.state == "on" %}
{{ x.name }} motion detected
{%- endfor %}
{%- endmacro %}
{%- macro USPS() -%}
{%- if states('sensor.usps_mail') | int > 0 -%}
USPS is going to deliver {{ states('sensor.usps_mail') }} mails today.
{%- endif -%}
{%- endmacro -%}
{%- macro alert_battery_levels() %}
{% for item in states if 'battery_level' in item.attributes and item.attributes.battery_level | int > 0 and item.attributes.battery_level | float <= 10.0 -%}{{- item.attributes.friendly_name ~ " battery is less than 10 percent" -}}
{%- if loop.first %}, {% elif loop.last %}, {% else %}, {% endif -%}
{%- endfor -%}
{%- endmacro -%}
{%- macro tesla_status() -%}
{%- if states("sensor.tesla_model_3_range_sensor") != "unknown" -%}
Your Tesla car battery is at {{ states('sensor.tesla_model_3_battery_sensor') }} percent ({{ (states('sensor.tesla_model_3_range_sensor') | int) | round(0) }} miles).
{%- endif -%}
{%- endmacro -%}
{%- macro humidity_status() -%}
Home humidity is {{ states('sensor.dining_room_thermostat_humidity') }} percent.
{%- endmacro -%}
{%- macro alarm_status() -%}
Your home is {{ "SECURED!" if states('alarm_control_panel.home') == "armed_away" or states('alarm_control_panel.home') == "armed_home" else "UNSECURED!" -}}
. Your Home Away Status is set to {{ states('input_boolean.home_mode_away') |upper }}
{% macro alarm_status() -%}
Your home security is set to: {{ states('alarm_control_panel.home') | upper }}
{%- endmacro -%}
{%- macro single_car_garage_door_status() -%}
@ -87,13 +59,12 @@
{%- endfor -%}
{%- endmacro -%}
{%- macro mother_of_all_macros() -%}
{% macro mother_of_all_macros() -%}
{{ alarm_status() }}
{{ door_status() }}
{{ motion_sensor_status() }}
{{ garage_status() }}
{{ weather_update() }}
{{ humidity_status() }}
{{ uv_levels() }}
{{ light_switch_status() }}
{%- endmacro -%}
{{- cleanup(mother_of_all_macros()) -}}
{{- cleanup(mother_of_all_macros()) -}}