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

61 lines
1.8 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
blueprint:
name: 💧 DWC Plant Tracker
description: >
Track plants in Deep Water Culture (DWC) or soil setups.
Notifies you to change or add water every 7 days.
domain: automation
input:
plant_name:
name: Plant Name
description: Friendly name of your plant (e.g. "Lettuce 1").
default: "My Plant"
last_watered_helper:
name: Last Watered Helper
description: >
Select the Date/Time helper for when this plant was last watered.
selector:
entity:
domain: input_datetime
notification_target:
name: Notification Target
description: >
Choose how to receive reminders (e.g. mobile app, persistent_notification, etc.)
selector:
target:
# Trigger every day at midnight to check age
trigger:
- platform: time
at: "00:00:00"
variables:
plant_name: !input plant_name
last_watered_entity: !input last_watered_helper
# Conditions check if plant hasn't been watered in 7+ days
condition:
- condition: template
value_template: >
{% set last = states(last_watered_entity) %}
{% if last not in ['unknown', 'unavailable', None] %}
{{ ((as_timestamp(now()) - as_timestamp(last)) / 86400) | int >= 7 }}
{% else %}
false
{% endif %}
action:
- variables:
days_since: >
{% set last = states(last_watered_entity) %}
{% if last not in ['unknown','unavailable',None] %}
{{ ((as_timestamp(now()) - as_timestamp(last)) / 86400) | int }}
{% else %} 0 {% endif %}
- service: notify
target: !input notification_target
data:
title: "💧 DWC Water Change Reminder"
message: "{{ plant_name }} needs a water change! Its been {{ days_since }} days since last watering."
mode: single