Hey Folks. I was wondering how to warn me before my whole water stuff outside freezes and bursts cause I forget to check the weather. The Solutions I found while searching the web did not click with me so here is what I came up with:

old solution:
alias: Freezing Warning
description: ''
triggers:
  - trigger: time
    at: '07:00:00'
conditions: []
actions:
  - variables:
      message: Your message to go out and close those Vales and empty the hoses
      mtittle: Freezing Alarm!
      minTemp: 2
  - action: weather.get_forecasts
    metadata: {}
    target:
      device_id: ChangeMe
    data:
      type: daily
    response_variable: daily
  - if:
      - condition: template
        value_template: |-
          {% set ns = namespace(freezing=false) %}
          {% for day in daily['weather.forecast_home'].forecast %}
            {% if day.templow < minTemp %}
              {% set ns.freezing = true %}
            {% endif %}
          {% endfor %}
          {{ ns.freezing }}
    then:
      - action: notify.send_message
        metadata: {}
        target:
          device_id: ChangeMe
        data:
          title: '{{ mtittle }}'
          message: '{{ message }}'
mode: single

Just a simple Automation. No editing template.yaml files. Could add a condition with a helper var like “I closed the vales etc” and don’t remind me every day. Guess I’ll do that… Be sure to change the ID of you location and ID of you mobile device for the message.

have fun, bye

Edit: here I am posting the new refined solution (now you have to suffer with my german stuff inside the vars and stuff):

You will need a helper like: input_boolean.wasser_bereit_fur_den_winter

Automation to check the Weather and create a Mobile-App warning with action item:
alias: Freezing Warning
description: ''
triggers:
  - trigger: time
    at: '07:00:05'
conditions: []
actions:
  - variables:
      messageCold: Es wird in den nächsten 6 Tagen Frieren!
      mtittleCold: Freezing Alarm!
      minTemp: 2
      maxTemp: 8
      messageWarm: Es ist wieder warm genug für Wasser draußen
      mtittleWarm: Wasser für draußen
  - action: weather.get_forecasts
    metadata: {}
    target:
      device_id: CHANGEME
    data:
      type: daily
    response_variable: daily
  - if:
      - condition: template
        value_template: |-
          {{ (daily['weather.forecast_home'].forecast
              | map(attribute='templow') | min) < minTemp }}
      - condition: switch.is_off
        target:
          entity_id: input_boolean.wasser_bereit_fur_den_winter
        options:
          behavior: any
          for: '00:00:00'
    then:
      - action: notify.mobile_app_handy_artur
        metadata: {}
        data:
          message: '{{ messageCold }}'
          title: '{{ mtittleCold }}'
          data:
            actions:
              - action: closed_outdoor_valve
                title: Dunezo!
    alias: check for freezing
  - if:
      - condition: template
        value_template: |-
          {{ (daily['weather.forecast_home'].forecast
              | map(attribute='templow') | min) > maxTemp }}
      - condition: switch.is_on
        target:
          entity_id: input_boolean.wasser_bereit_fur_den_winter
        options:
          behavior: any
          for: '00:00:00'
    then:
      - action: notify.mobile_app_CHANGEME
        metadata: {}
        data:
          message: '{{ messageWarm }}'
          title: '{{ mtittleWarm }}'
          data:
            actions:
              - action: opend_outdoor_valve
                title: Dunezo!
    alias: check for warm
mode: single
Automation for the Mobile action:
alias: Mobile Actions
mode: parallel
max: 10
triggers:
  - event_type: mobile_app_notification_action
    id: mobile_action_closed_outdoor_valve
    event_data:
      action: closed_outdoor_valve
    trigger: event
  - event_type: mobile_app_notification_action
    id: mobile_action_opend_outdoor_valve
    event_data:
      action: opend_outdoor_valve
    trigger: event
conditions: []
actions:
  - if:
      - condition: trigger
        id:
          - mobile_action_closed_outdoor_valve
    then:
      - action: input_boolean.turn_on
        metadata: {}
        target:
          entity_id: input_boolean.wasser_bereit_fur_den_winter
        data: {}
  - if:
      - condition: trigger
        id:
          - mobile_action_opend_outdoor_valve
    then:
      - action: input_boolean.turn_off
        metadata: {}
        target:
          entity_id: input_boolean.wasser_bereit_fur_den_winter
        data: {}
  • ahmedezat_katteb@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    12 hours ago

    Nice, this is one of those automations that pays for itself the first winter. Two small things that might make it nicer to live with:

    The loop with the namespace can be a one-liner, and you can limit it to the next couple of days so a cold snap six days out doesn’t nag you every morning all week:

    {{ (daily['weather.forecast_home'].forecast[:2]
        | map(attribute='templow') | min) < minTemp }}
    

    And to stop repeat alerts once you’ve actually done the work, pair it with an input_boolean like outdoor_water_winterized: add it as a condition (only notify when off), send the notification with an actionable button (“Done”) from the companion app, and have the button event flip the boolean on. Then a second automation turns it back off when the forecast lows climb above, say, 8 °C for a few days in spring. That also covers curbstickle’s point if you ever add more taps, one boolean per tap.

    • nap@sh.itjust.worksOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      10 hours ago

      That is a sexy loop. I need the heads up 6 days in advance so I am gonna leave it without the index. Gonna update the Post with my current solution.

  • canthangmightstain@lemmy.today
    link
    fedilink
    English
    arrow-up
    2
    ·
    15 hours ago

    “Your massage to go out and close those…”

    I assume you went snowblind from having to type “message” that many times lol.

    • nap@sh.itjust.worksOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      11 hours ago

      Hah, ty. Changed that for the Post cause my message is in German and I got problems enough with my dyslexia…

  • TeaWithDani@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    21 hours ago

    I plan to set one up with a little La Crosse weather station my parents gave me. Turns out it seems well supported and gives me accurate indoor and outdoor temperature as well as wind speed and other stuff like storm predictions. Gonna link my heat pump to it and have my NTFY ping me when I should start the fireplace instead.

    We get a lot of small microclimates where I live so its more reliable than the forecast.

  • curbstickle_lw@lemmy.worldM
    link
    fedilink
    English
    arrow-up
    3
    ·
    2 days ago

    What I might consider is a “winterized” variable per hose/pipe that may be a concern, and only notify if winterized is false for those, and have the notification list specifically not winterized.

    That state would be manual per, but then you would be able to get a more meaningful reminder to only those that would be at risk.

    • nap@sh.itjust.worksOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      2 days ago

      Yes, my usw case just considers one Valve leading outwards that I need to shut and bleed. Don’t need multiple freezing points for hight presure/isolated pipes. One fits all for me. The loop could be modified for those things. Now it is set to “2”. Not even considering °C or °F (°C in my case). Home Assistenten takes care of that

  • James R Kirk@startrek.website
    link
    fedilink
    English
    arrow-up
    7
    arrow-down
    1
    ·
    3 days ago

    Based on the title I thought this was a halting problem question and was like “oh dang OP is NOT going to like this answer…”

  • gdog05@lemmy.world
    link
    fedilink
    English
    arrow-up
    3
    arrow-down
    1
    ·
    3 days ago

    I have several of these set up. Mostly for opening windows to reduce AC use. If the temp outside is dropping and is within two degrees of interior temp, then it’s time to open the windows. And the inverse during autumn to close them. I could have saved you some time probably.

    • nap@sh.itjust.worksOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      3 days ago

      Thinking about it: i guess i should document my Automation a little more. It is checking the next 6 Days for freezing Temperatur not the current