AutomationDataset/Napalm478/Napalm478_automations.yaml

102 lines
4.8 KiB
YAML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

- alias: Intelligente Gartenbewässerung nach Wetterlage
description: Voll dynamische Gartenbewässerung mit Regen, Temperatur, UV-Index,
Luftfeuchtigkeit und Wintermodus.
triggers:
- event: sunrise
trigger: sun
- event: sunset
trigger: sun
conditions:
- condition: numeric_state
entity_id: sensor.YOUR_WIND_SPEED_SENSOR
below: 25
- condition: numeric_state
entity_id: sensor.YOUR_TEMP_MIN_SENSOR
above: 5
actions:
- choose:
- conditions:
- condition: template
value_template: '{{ allow_watering | bool }}'
sequence:
- target:
entity_id: switch.YOUR_WATERING_SWITCH
action: switch.turn_on
data: {}
- data:
message: '🚿 **Bewässerung gestartet!** 🕐 Zeit: {{ now().strftime(''%H:%M'')
}}
🌡️ Temperatur Min/Max: {{ temperature_min }}°C / {{ temperature_max }}°C 💨
Wind: {{ wind_speed }} km/h 💧 Luftfeuchtigkeit: {{ humidity }} % 🌧️
Regen heute: {{ rain_today }} mm 🌧️ Regen gestern: {{ rain_yesterday
}} mm 🌦️ Regen morgen: {{ rain_forecast_tomorrow }} mm 📈 Regen-Wahrscheinlichkeit
morgen: {{ (rain_probability_tomorrow * 100) | round(0) }} % 🔆 UV-Index:
{{ uv_index }} 🕒 Geplante Laufzeit: {{ watering_duration }} Minuten
'
action: notify.telegram
- delay:
minutes: '{{ watering_duration }}'
- target:
entity_id: switch.YOUR_WATERING_SWITCH
action: switch.turn_off
data: {}
- data:
message: '🛑 **Bewässerung beendet!** 🕐 Zeit: {{ now().strftime(''%H:%M'')
}}
'
action: notify.telegram
default:
- data:
message: '❌ **Keine Bewässerung notwendig** 🕐 Zeit: {{ now().strftime(''%H:%M'')
}}
Grund: {{ no_watering_reason }}
🌡️ Temperatur Min/Max: {{ temperature_min }}°C / {{ temperature_max }}°C 💨
Wind: {{ wind_speed }} km/h 💧 Luftfeuchtigkeit: {{ humidity }} % 🌧️
Regen heute: {{ rain_today }} mm 🌧️ Regen gestern: {{ rain_yesterday }}
mm 🌦️ Regen morgen: {{ rain_forecast_tomorrow }} mm 📈 Regen-Wahrscheinlichkeit
morgen: {{ (rain_probability_tomorrow * 100) | round(0) }} % 🔆 UV-Index:
{{ uv_index }}
'
action: notify.telegram
variables:
temperature_min: '{{ states(''sensor.YOUR_TEMP_MIN_SENSOR'') | float(0) }}'
temperature_max: '{{ states(''sensor.YOUR_TEMP_MAX_SENSOR'') | float(0) }}'
wind_speed: '{{ states(''sensor.YOUR_WIND_SPEED_SENSOR'') | float(0) }}'
humidity: '{{ states(''sensor.YOUR_HUMIDITY_SENSOR'') | float(0) }}'
uv_index: '{{ states(''sensor.YOUR_UV_INDEX_SENSOR'') | float(5) }}'
rain_today: '{{ states(''sensor.YOUR_RAIN_TODAY_SENSOR'') | float(0) }}'
rain_yesterday: '{{ states(''sensor.YOUR_RAIN_YESTERDAY_SENSOR'') | float(0) }}'
rain_forecast_today: '{{ states(''sensor.YOUR_RAIN_FORECAST_TODAY_SENSOR'') |
float(0) }}'
rain_forecast_tomorrow: '{{ states(''sensor.YOUR_RAIN_FORECAST_TOMORROW_SENSOR'')
| float(0) }}'
rain_probability_tomorrow: '{{ states(''sensor.YOUR_RAIN_PROBABILITY_TOMORROW_SENSOR'')
| float(0) }}'
month: '{{ now().month }}'
wintermode: '{{ month in [11,12,1,2,3] }}'
allow_watering: "{{ not wintermode\n and humidity <= 90\n and rain_today <=\
\ 5\n and rain_yesterday <= 5\n and rain_forecast_tomorrow <= 2\n and\
\ rain_probability_tomorrow <= 60\n and temperature_min > 5 }}\n"
watering_duration: "{% if month in [3, 4, 5, 9, 10] %}\n 15\n{% elif temperature_max\
\ < 12 %}\n 15\n{% elif temperature_max > 30 %}\n {% if uv_index > 7 %}\n\
\ 45\n {% else %}\n 40\n {% endif %}\n{% else %}\n {% if uv_index >\
\ 7 %}\n 25\n {% else %}\n 30\n {% endif %}\n{% endif %}\n"
no_watering_reason: "{% if wintermode %}\n \"❄️ Wintermodus aktiv: Keine Bewässerung\
\ zwischen November und März\"\n{% elif humidity > 90 %}\n \"\U0001F4A7 Hohe\
\ Luftfeuchtigkeit: {{ humidity }}%\"\n{% elif rain_today > 5 %}\n \"\U0001F327\
Heute schon genug Regen: {{ rain_today }} mm\"\n{% elif rain_yesterday > 5\
\ %}\n \"\U0001F327 Gestern schon genug Regen: {{ rain_yesterday }} mm\"\n\
{% elif rain_forecast_tomorrow > 2 %}\n \"\U0001F326 Morgen wird Regen erwartet:\
\ {{ rain_forecast_tomorrow }} mm\"\n{% elif rain_probability_tomorrow > 60\
\ %}\n \"\U0001F326 Hohe Regenwahrscheinlichkeit morgen: {{ (rain_probability_tomorrow\
\ * 100) | round(0) }}%\"\n{% elif temperature_min < 5 %}\n \"❄️ Zu kalt für\
\ Bewässerung (min {{ temperature_min }}°C)\"\n{% else %}\n \"Unbekannter Grund\"\
\n{% endif %}\n"
mode: single