Blueprint: Pflanzen-Feuchtigkeits-Manager (Individuell)
Ein präziser Home Assistant Blueprint zur Überwachung der Bodenfeuchtigkeit, indem für jede Pflanze eine eigene Automatisierung erstellt wird. Dies ermöglicht individuelle, maßgeschneiderte Feuchtigkeits-Grenzwerte.
Funktionen
-
Individuelle Grenzwerte: Stelle einen eigenen Feuchtigkeitsprozentsatz für jede Pflanze ein (z. B. Sukkulenten vs. Farne).
-
Einfache UI-Konfiguration: Wähle Handys und Alexa-Mediaplayer direkt über Dropdown-Menüs aus.
-
Benutzerdefinierte Namensbereinigung: Schneidet bestimmte Wörter automatisch aus den Sensornamen heraus für sauberere Benachrichtigungen.
-
Smarte & beständige Benachrichtigungen: Sofortige Warnungen bei Trockenheit, tägliche Erinnerungen und automatisches Löschen nach dem Gießen.
-
Alexa-Integration: Kündigt trockene Pflanzen an und liest den aktuellen Feuchtigkeitsprozentsatz live vor.
Voraussetzungen
-
Home Assistant Companion App.
-
Alexa Media Player Integration (aus dem HACS).
-
Feuchtigkeitssensoren mit der Geräteklasse
moisture.
Installation & Nutzung
-
Kopiere den YAML-Code in deinen Ordner
blueprints/automation/. -
Lade die Blueprints in Home Assistant neu.
-
Erstelle eine eigene Automatisierung pro Pflanze, um die individuellen Grenzwerte festzulegen.
blueprint:
name: Plant Moisture Manager (Individual)
description: Monitors an individual plant moisture sensor. Sends immediate and daily notifications to a mobile device and announces low moisture levels via Alexa. Automatically clears notifications once the plant is watered.
domain: automation
input:
moisture_sensor:
name: Plant Sensor
description: Select the moisture sensor you want to monitor for this plant.
selector:
entity:
domain: sensor
device_class: moisture
multiple: false
threshold:
name: Moisture Threshold (%)
description: Trigger an alert when moisture falls below this percentage.
default: 20
selector:
number:
min: 0
max: 100
unit_of_measurement: "%"
mode: slider
check_time:
name: Daily Reminder Time
description: Time for the daily morning notification and Alexa announcement.
default: "09:00:00"
selector:
time: {}
notify_device:
name: Notification Device
description: Select your primary mobile device for push notifications.
selector:
device:
integration: mobile_app
alexa_device:
name: Alexa Media Player
description: Select your Alexa media player or group. Leave blank to disable voice alerts.
default: ""
selector:
entity:
domain: media_player
word_to_remove:
name: Word to remove from sensor name
description: "Enter a word to strip from the sensor name (e.g., 'Bodenfeuchtigkeit' or 'Moisture'). Leave empty if names are already clean."
default: "Bodenfeuchtigkeit"
selector:
text:
multiline: false
mode: parallel
max: 50
variables:
target_sensor: !input moisture_sensor
notify_device_input: !input notify_device
notify_service: "notify.mobile_app_{{ device_attr(notify_device_input, 'name') | slugify }}"
alexa_target: !input alexa_device
threshold_val: !input threshold
strip_word: !input word_to_remove
strip_word_lower: "{{ strip_word | lower }}"
strip_word_upper: "{{ strip_word | capitalize }}"
trigger:
- platform: numeric_state
entity_id: !input moisture_sensor
below: !input threshold
id: "dry_detected"
- platform: time
at: !input check_time
id: "daily_reminder"
- platform: numeric_state
entity_id: !input moisture_sensor
above: !input threshold
id: "watered"
condition: []
action:
- choose:
# Fall 1: Pflanze wird im Laufe des Tages JETZT trocken
- conditions:
- condition: trigger
id: "dry_detected"
sequence:
# 1. Push-Nachricht an das ausgewählte Handy senden
- service: "{{ notify_service }}"
data:
title: "🌱 Pflanze braucht Wasser!"
message: "Die Pflanze '{{ state_attr(target_sensor, 'friendly_name') | replace(strip_word, '') | replace(strip_word_lower, '') | replace(strip_word_upper, '') | trim }}' ist zu trocken ({{ states(target_sensor) }}%)."
data:
tag: "pflanze_trocken_{{ target_sensor }}"
ttl: 0
priority: high
# 2. Sofortige Alexa-Sprachausgabe
- condition: template
value_template: "{{ alexa_target != '' }}"
- action: notify.alexa_media
data:
target: ["{{ alexa_target }}"]
message: "Achtung, die Pflanze {{ state_attr(target_sensor, 'friendly_name') | replace(strip_word, '') | replace(strip_word_lower, '') | replace(strip_word_upper, '') | trim }} benötigt Wasser. Sie hat nur noch {{ states(target_sensor) }} Prozent Bodenfeuchtigkeit."
data:
type: announce
# Fall 2: Die tägliche Erinnerung am Morgen läuft ab
- conditions:
- condition: trigger
id: "daily_reminder"
sequence:
- condition: template
value_template: "{{ states(target_sensor) | float(0) < threshold_val | float(20) }}"
# Handy-Erinnerung schicken
- service: "{{ notify_service }}"
data:
title: "🌱 Pflanze braucht Wasser!"
message: "Erinnerung: '{{ state_attr(target_sensor, 'friendly_name') | replace(strip_word, '') | replace(strip_word_lower, '') | replace(strip_word_upper, '') | trim }}' ist immer noch zu trocken ({{ states(target_sensor) }}%)."
data:
tag: "pflanze_trocken_{{ target_sensor }}"
ttl: 0
priority: high
# Tägliche Alexa-Erinnerung
- condition: template
value_template: "{{ alexa_target != '' }}"
- action: notify.alexa_media
data:
target: ["{{ alexa_target }}"]
message: "Erinnerung. Die Pflanze {{ state_attr(target_sensor, 'friendly_name') | replace(strip_word, '') | replace(strip_word_lower, '') | replace(strip_word_upper, '') | trim }} ist immer noch trocken und steht bei {{ states(target_sensor) }} Prozent."
data:
type: announce
# Fall 3: Pflanze wurde gegossen -> Nachricht auf dem Handy löschen
- conditions:
- condition: trigger
id: "watered"
sequence:
- service: "{{ notify_service }}"
data:
message: "clear_notification"
data:
tag: "pflanze_trocken_{{ target_sensor }}"