From 8e5da1812ba9d7ca700993f1af30e1e1e33c13c0 Mon Sep 17 00:00:00 2001 From: theipw <102994625+theipw@users.noreply.github.com> Date: Thu, 28 Mar 2024 08:06:30 +0000 Subject: [PATCH] Create automation daily high-low temp --- automation daily high-low temp | 66 ++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 automation daily high-low temp diff --git a/automation daily high-low temp b/automation daily high-low temp new file mode 100644 index 0000000..9b5a274 --- /dev/null +++ b/automation daily high-low temp @@ -0,0 +1,66 @@ +alias: Weather - Daily High/Low Temp +description: "" +trigger: + - platform: state + entity_id: + - sensor.NAME_OF_OUTDOOR_TEMP_SENSOR + id: temp + - platform: time + at: "00:00:00" + id: midnight_reset +condition: [] +action: + - choose: + - conditions: + - condition: trigger + id: + - temp + - condition: numeric_state + entity_id: sensor.NAME_OF_OUTDOOR_TEMP_SENSOR + above: input_number.day_temp_max + sequence: + - service: input_number.set_value + data: + value: "{{states('NAME_OF_OUTDOOR_TEMP_SENSOR')}}" + target: + entity_id: input_number.day_temp_max + - service: input_datetime.set_datetime + data: + datetime: "{{ now() }}" + target: + entity_id: input_datetime.day_temp_max_time + - conditions: + - condition: trigger + id: + - midnight_reset + sequence: + - service: input_number.set_value + data: + value: -100 + target: + entity_id: + - input_number.day_temp_max + - service: input_number.set_value + data: + value: 100 + target: + entity_id: input_number.day_temp_min + - conditions: + - condition: trigger + id: + - temp + - condition: numeric_state + entity_id: NAME_OF_OUTDOOR_TEMP_SENSOR + below: input_number.day_temp_min + sequence: + - service: input_number.set_value + data: + value: "{{states('NAME_OF_OUTDOOR_TEMP_SENSOR')}}" + target: + entity_id: input_number.day_temp_min + - service: input_datetime.set_datetime + data: + datetime: "{{ now() }}" + target: + entity_id: input_datetime.day_temp_min_time +mode: single