From 8d9dcc0d09d7689348bea76e055fb386ef8e911c Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Sun, 24 Sep 2023 02:44:23 -0400 Subject: [PATCH] Add laundry report template #138 --- custom_templates/status.jinja | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/custom_templates/status.jinja b/custom_templates/status.jinja index 9c2eaa0..ee904f0 100644 --- a/custom_templates/status.jinja +++ b/custom_templates/status.jinja @@ -4,6 +4,31 @@ {% from 'lighting.jinja' import lightsOn %} {% set ct = ct() | int %} +{% macro laundryReport(type,method) %} + {% macro data() %} + {% set washerTimer = states('timer.washer_timer') %} + {% set dryerTimer = states('timer.dryer_timer') %} + {% set washerFinished = states('input_boolean.washer_finished') %} + {% set dryerFinished = states('input_boolean.dryer_finished') %} + {% set washerDateTime = 'input_datetime.washer_finished' %} + {% set dryerDateTime = 'input_datetime.dryer_finished' %} + {% if washerTimer == 'active' and dryerTimer == 'active' %} + The washer and dryer are both running. + {% elif washerTimer == 'active' %} + The washer is running. + {% elif dryerTimer == 'active' %} + The dryer is running. + {% endif %} + {% if washerFinished == 'on' %} + The washer finished its cycle at {{ input_datetime_read(washerDateTime,'withdate') | trim }}. + {% endif %} + {% if dryerFinished == 'on' %} + The dryer finished its cycle at {{ input_datetime_read(dryerDateTime,'withdate') | trim }}. + {% endif %} + {% endmacro %} +{{ cleanup(data()) }} +{% endmacro %} + {% macro climateDevices(type,method) %} {% set total = states('sensor.climate_devices_running') | int %} {% set fans = states('sensor.fans_running') | int %}