From 98d916c4ed616603de2d1e57e99d175708d9d049 Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Tue, 9 Aug 2022 17:53:26 +0200 Subject: [PATCH] summary notification --- packages/climate/climate_automation.yaml | 8 ++++---- packages/climate/climate_sensors.yaml | 4 ++-- packages/climate/weather.yaml | 17 +++++++++++++++-- .../homeassistant/notification_summary.yaml | 15 +++++++++++++++ 4 files changed, 36 insertions(+), 8 deletions(-) create mode 100644 packages/homeassistant/notification_summary.yaml diff --git a/packages/climate/climate_automation.yaml b/packages/climate/climate_automation.yaml index 011f620..f09dc90 100644 --- a/packages/climate/climate_automation.yaml +++ b/packages/climate/climate_automation.yaml @@ -6,8 +6,8 @@ automation: trigger: - platform: state entity_id: sensor.climate_temp_recommendation - from: 'open window' - to: 'close window' + from: 'open the window' + to: 'close the window' action: - service: notify.notify data: @@ -16,8 +16,8 @@ automation: trigger: - platform: state entity_id: sensor.climate_temp_recommendation - from: 'close window' - to: 'open window' + from: 'close the window' + to: 'open the window' action: - service: notify.notify data: diff --git a/packages/climate/climate_sensors.yaml b/packages/climate/climate_sensors.yaml index c93d4bc..8dd571b 100644 --- a/packages/climate/climate_sensors.yaml +++ b/packages/climate/climate_sensors.yaml @@ -104,9 +104,9 @@ sensor: {% set inside_max = temp_inside + states("input_number.climate_temp_accuracy")|float %} {% set accuracy = states("input_number.climate_temp_accuracy") |float %} {% if temp_inside >= target and temp_inside >= (temp_outside - accuracy) %} - {{ "open window" }} + {{ "open the window" }} {% else %} - {{ "close window" }} + {{ "close the window" }} {% endif %} diff --git a/packages/climate/weather.yaml b/packages/climate/weather.yaml index 58fe47b..ad8841d 100644 --- a/packages/climate/weather.yaml +++ b/packages/climate/weather.yaml @@ -16,9 +16,22 @@ sun: sensor: - platform: template - #api_key: !secret pirateweather sensors: temperature_outside: value_template: '{{ states.weather.home.attributes.temperature }}' friendly_name: 'Outside Temperature' - unit_of_measurement: '°C' \ No newline at end of file + unit_of_measurement: '°C' + temperature_today_max: + value_template: > + {{ state_attr('weather.pirateweather', 'forecast')[0].temperature }} + friendly_name: 'Max Temperature' + unit_of_measurement: '°C' + temperature_today_min: + value_template: > + {{ state_attr("weather.pirateweather", "forecast")[0].templow }} + friendly_name: 'Min Temperature' + unit_of_measurement: '°C' + temperature_today_condition: + value_template: > + {{ state_attr('weather.pirateweather', 'forecast')[0].condition }} + friendly_name: 'Condition' \ No newline at end of file diff --git a/packages/homeassistant/notification_summary.yaml b/packages/homeassistant/notification_summary.yaml new file mode 100644 index 0000000..46aba39 --- /dev/null +++ b/packages/homeassistant/notification_summary.yaml @@ -0,0 +1,15 @@ +script: + summary_notification: + sequence: + - service: notify.notify + data: + message: > + {% set maxTemp = states("sensor.temperature_today_max") %} + {% set minTemp = states("sensor.temperature_today_min") %} + {% set condition = states("sensor.temperature_today_condition") %} + {% set currentTemp = states("sensor.temperature_outside") %} + {% set recommendation = states("sensor.climate_temp_recommendation") %} + At the moment it is {{ condition }} outside with a temperature of {{ currentTemp }}°C. + Todays temperature will be between {{ maxTemp }}°C and {{ minTemp }}°C. + It is recommended to {{ recommendation }}. + mode: single \ No newline at end of file