Skip to content

Instantly share code, notes, and snippets.

@JcMinarro
Forked from sergiocasero/good_morning.yaml
Last active August 18, 2023 08:56
Show Gist options
  • Save JcMinarro/1f7101d27d0e313dee7d78723e6d1206 to your computer and use it in GitHub Desktop.
Save JcMinarro/1f7101d27d0e313dee7d78723e6d1206 to your computer and use it in GitHub Desktop.
Good morning Home Asssistant
description: ""
trigger:
- platform: time
at: "08:00:00"
condition: []
action:
- service: notify.telegram
data:
message: >
{# Change these entities with your's #}
{# You'll need tomorrow.io integration enabled ;) #}
{% set weatherEntity = "weather.tomorrow_io_casa_nowcast" %}
{% set forecast = state_attr('weather.tomorrow_io_casa_daily', 'forecast') %}
{% set feelsLike = states('sensor.tomorrow_io_casa_feels_like') %}
{# --------------------------------- #}
{% set weatherState = states(weatherEntity) %}
{% set temp = state_attr(weatherEntity,'temperature') %}
{% set tempUnit = state_attr(weatherEntity,'temperature_unit') %}
{% set humidity = state_attr(weatherEntity,'humidity') %}
{% set wind = state_attr(weatherEntity,'wind_speed') %}
{% set windUnit = state_attr(weatherEntity,'wind_speed_unit') %}
Buenos días.{{- '\n' -}}{{- '\n' -}}
Hoy el tiempo está
{% if weatherState == 'sunny' %}{{ "☀️" }} Soleado
{% elif weatherState == 'clear-night' %}{{ "🌃️" }} Noche clara
{% elif weatherState == 'cloudy' %}{{ "☁️️" }} Nublado
{% elif weatherState == 'exceptional' %}{{ "☀️" }} Excepcional
{% elif weatherState == 'fog' %}{{ "🌫️" }} Niebla
{% elif weatherState == 'hail' %}{{ "❄️️️" }} Granizo
{% elif weatherState == 'lightning' %}{{ "⚡️️" }} Tormeta
{% elif weatherState == 'lightning-rainy' %}{{ "⛈️" }} Tormeta eléctrica con lluvias
{% elif weatherState == 'partlycloudy' %}{{ "🌥️" }} Nubles y claros
{% elif weatherState == 'pouring' %}{{ "🌩" }} Tormeta elétrica
{% elif weatherState == 'rainy' %}{{ "🌧️" }} Lluvioso
{% elif weatherState == 'snowy' %}{{ "🌨" }} Nevado
{% elif weatherState == 'snowy-rainy' %}{{ "🌨️" }} Aguanieve
{% else %}{{ "🌬️" }} con vientos
{% endif %} {{- '\n' -}}{{- '\n' -}}
{{ "🌡" }} Temperatura actual: {{temp}}{{tempUnit}} {{- '\n' -}}
{{ "💦" }} Humedad: {{humidity}}% {{- '\n' -}}
{{ "💨" }} Viento: {{wind}}{{windUnit}} {{- '\n' -}}
{{ "🤒" }} Sensación térmica {{feelsLike}}{{tempUnit}} {{- '\n' -}} {{- '\n' -}}
{{- '\n' -}}
{{- '\n' -}}
{% set summary = forecast[0] %}
⬇️ Temperatura mínima: {{ summary.templow }}{{tempUnit}}{{- '\n' -}}
⬆️ Tempratura máxima: {{ summary.temperature }}{{tempUnit}}{{- '\n' -}}
⁉️ Probabilidad de lluvias: {{ summary.precipitation_probability }}%{{- '\n' -}}
{% if summary.precipitation_probability > 0 %}
{{ summary.precipitation_probability }}mm{{- '\n' -}}
{% endif %}
mode: single
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment