From fb5bc0583a5f27414810e2a2b6519ea97c644ffa Mon Sep 17 00:00:00 2001 From: Jeffrey Stone Date: Sat, 28 Aug 2021 15:54:53 -0400 Subject: [PATCH] Fixing previous day rainfall sensor and automations --- config/automations.yaml | 3 +-- config/packages/weather.yaml | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/config/automations.yaml b/config/automations.yaml index a192776..f673f5d 100644 --- a/config/automations.yaml +++ b/config/automations.yaml @@ -448,8 +448,7 @@ - service: script.text_notify data: who: all_ios - message: The Garden has received {{ states('sensor.previous_rainfall') | int - | round(2) }} inches of rain in the last 48 hours. + message: The Garden has received {{ states('sensor.previous_rainfall') | round(2) }} inches of rain in the last 48 hours. mode: single - id: '1627078744808' alias: buy more xlm diff --git a/config/packages/weather.yaml b/config/packages/weather.yaml index 2eba229..ffcd6b4 100755 --- a/config/packages/weather.yaml +++ b/config/packages/weather.yaml @@ -244,7 +244,7 @@ sensor: value_template: "{{ state_attr('sensor.daily_rainfall_in', 'last_period') }}" previous_rainfall: friendly_name: "Past 48h Rainfall" - value_template: "{{ states('sensor.daily_rainfall_in') | int + state_attr('sensor.daily_rainfall_in', 'last_period') | int }}" + value_template: "{{ states('sensor.daily_rainfall_in') | float + state_attr('sensor.daily_rainfall_in', 'last_period') | float }}" lightning_warning: friendly_name: "Lightning Warning" value_template: >-