summary notification

This commit is contained in:
darthsandmann 2022-08-09 17:53:26 +02:00
parent a05dfeb7ce
commit 98d916c4ed
4 changed files with 36 additions and 8 deletions

View File

@ -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:

View File

@ -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 %}

View File

@ -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'
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'

View File

@ -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