Files
HASS_Plant_Monitor/PlantMonitor_bp.yaml
2025-11-08 21:56:54 -05:00

69 lines
2.1 KiB
YAML

blueprint:
name: 💧 DWC Plant Tracker (Planted + HA Notification)
description: >
Track a plant's age and days since last watering.
Creates a Home Assistant persistent notification when it's been 7+ days
since the last watering.
domain: automation
input:
plant_name:
name: Plant Name
description: e.g., "Hungarian Hot Wax 1".
default: "My Plant"
planted_date_helper:
name: Planted Date Helper
description: Select the DATE helper (no time) for when this plant was planted.
selector:
entity:
domain: input_datetime
last_watered_helper:
name: Last Watered Helper
description: Select the DATE/TIME helper for the last watering.
selector:
entity:
domain: input_datetime
# Check daily at midnight
trigger:
- platform: time
at: "00:00:00"
variables:
plant_name: !input plant_name
planted_date_entity: !input planted_date_helper
last_watered_entity: !input last_watered_helper
# Only notify when 7+ days since last watering
condition:
- condition: template
value_template: >
{% set watered = states(last_watered_entity) %}
{% if watered not in ['unknown','unavailable', None] %}
{{ ((as_timestamp(now()) - as_timestamp(watered)) / 86400) | int >= 7 }}
{% else %} false {% endif %}
action:
- variables:
days_since_water: >
{% set watered = states(last_watered_entity) %}
{% if watered not in ['unknown','unavailable',None] %}
{{ ((as_timestamp(now()) - as_timestamp(watered)) / 86400) | int }}
{% else %} 0 {% endif %}
age_days: >
{% set planted = states(planted_date_entity) %}
{% if planted not in ['unknown','unavailable',None] %}
{{ ((as_timestamp(now()) - as_timestamp(planted)) / 86400) | int }}
{% else %} 0 {% endif %}
- service: persistent_notification.create
data:
title: "💧 DWC Water Change Reminder"
message: >
{{ plant_name }} was planted {{ age_days }} days ago and
it's been {{ days_since_water }} days since it was last watered.
Time to refresh its water.
mode: single