From efe9cc2392fceb544f910f7b6b975294e74f6f50 Mon Sep 17 00:00:00 2001 From: theipw <102994625+theipw@users.noreply.github.com> Date: Thu, 28 Mar 2024 08:12:54 +0000 Subject: [PATCH] Create automation rain records --- automation rain records | 55 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 automation rain records diff --git a/automation rain records b/automation rain records new file mode 100644 index 0000000..b8cad86 --- /dev/null +++ b/automation rain records @@ -0,0 +1,55 @@ +alias: Weather - Records, Rain +description: "" +trigger: + - platform: state + entity_id: + - sensor.gw1100a_v2_2_3_total_rain +condition: [] +action: + - choose: + - conditions: + - condition: numeric_state + entity_id: sensor.gw1100a_v2_2_3_daily_rain_rate + above: input_number.highest_daily_recorded_rainfall + sequence: + - service: input_number.set_value + data: + value: "{{states('sensor.gw1100a_v2_2_3_daily_rain_rate')}}" + target: + entity_id: input_number.highest_daily_recorded_rainfall + - service: input_datetime.set_datetime + data: + date: "{{ now().date() }}" + target: + entity_id: input_datetime.highest_daily_rainfall_date + - conditions: + - condition: numeric_state + entity_id: sensor.gw1100a_v2_2_3_weekly_rain_rate + above: input_number.highest_weekly_recorded_rainfall + sequence: + - service: input_number.set_value + data: + value: "{{states('sensor.gw1100a_v2_2_3_weekly_rain_rate')}}" + target: + entity_id: input_number.highest_weekly_recorded_rainfall + - service: input_datetime.set_datetime + data: + date: "{{ now().date() }}" + target: + entity_id: input_datetime.highest_weekly_rainfall_date + - conditions: + - condition: numeric_state + entity_id: sensor.gw1100a_v2_2_3_monthly_rain_rate + above: input_number.highest_monthly_recorded_rainfall + sequence: + - service: input_number.set_value + data: + value: "{{states('sensor.gw1100a_v2_2_3_monthly_rain_rate')}}" + target: + entity_id: input_number.highest_monthly_recorded_rainfall + - service: input_datetime.set_datetime + data: + date: "{{ now().date() }}" + target: + entity_id: input_datetime.highest_monthly_rainfall_date +mode: single