Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 108215

Weather Forecast automation - get notification in case of frost

$
0
0

Hello Community,

im new to HA so please don’t be too harsh with me. :stuck_out_tongue:

Iam trying to set up a new automation which checks the forecast within the next 12 hours and gives me a notification if it gets 2°C or below, so i can bring in all my plants who are not so fine with such cold temperatures.
I’ve tried everything within my power and asked ChatGPT a couple times - also told ChatGPT that there were recent changes (i guess it was 2024.3) but it still doesn’t work. I’m using the Met.no integration.

My automation looks like this atm:


triggers:

  • hours: “*”
    trigger: time_pattern
    conditions:
  • condition: template
    value_template: >
    {% set forecast = state_attr(‘weather.forecast_home’, ‘forecast’) %} {% if
    forecast is not none %}
    {% set frost_warning = false %}
    {% for entry in forecast[:12] %}
    {% if entry.temperature < 2 %}
    {% set frost_warning = true %}
    {% endif %}
    {% endfor %}
    {{ frost_warning }}
    {% else %}
    {{ log(‘Frostwarnung: Keine Vorhersagedaten vorhanden!’) }}
    false
    {% endif %}
    actions:
  • data:
    message: >-
    Achtung! Die Temperatur wird in den nächsten 12 Stunden unter 2°C
    fallen.
    title: Frostwarnung
    action: notify.mobile_app_myphone
    mode: single

Does anyone have a hint for me whats wrong here?

Thank you in advance!

Best regards
Robert

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 108215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>