Update PlantMonitor_bp.yaml
This commit is contained in:
@@ -1,37 +1,31 @@
|
|||||||
blueprint:
|
blueprint:
|
||||||
name: 💧 DWC Plant Tracker (with Reset Button)
|
name: 💧 DWC Plant Tracker (Planted + HA Notification)
|
||||||
description: >
|
description: >
|
||||||
Tracks plant age and watering schedule.
|
Track a plant's age and days since last watering.
|
||||||
Notifies if watering is overdue (7+ days)
|
Creates a Home Assistant persistent notification when it's been 7+ days
|
||||||
and supports a manual reset button to log watering.
|
since the last watering.
|
||||||
domain: automation
|
domain: automation
|
||||||
input:
|
input:
|
||||||
plant_name:
|
plant_name:
|
||||||
name: Plant Name
|
name: Plant Name
|
||||||
description: The friendly name of your plant (e.g. "Hungarian Hot Wax 1").
|
description: e.g., "Hungarian Hot Wax 1".
|
||||||
default: "My Plant"
|
default: "My Plant"
|
||||||
|
|
||||||
planted_date_helper:
|
planted_date_helper:
|
||||||
name: Planted Date Helper
|
name: Planted Date Helper
|
||||||
description: Select the Date helper for when this plant was planted.
|
description: Select the DATE helper (no time) for when this plant was planted.
|
||||||
selector:
|
selector:
|
||||||
entity:
|
entity:
|
||||||
domain: input_datetime
|
domain: input_datetime
|
||||||
|
|
||||||
last_watered_helper:
|
last_watered_helper:
|
||||||
name: Last Watered Helper
|
name: Last Watered Helper
|
||||||
description: Select the Date/Time helper for the plant’s last watering.
|
description: Select the DATE/TIME helper for the last watering.
|
||||||
selector:
|
selector:
|
||||||
entity:
|
entity:
|
||||||
domain: input_datetime
|
domain: input_datetime
|
||||||
|
|
||||||
notification_target:
|
# Check daily at midnight
|
||||||
name: Notification Target
|
|
||||||
description: Choose how to receive water-change reminders.
|
|
||||||
selector:
|
|
||||||
target:
|
|
||||||
|
|
||||||
# Trigger daily at midnight
|
|
||||||
trigger:
|
trigger:
|
||||||
- platform: time
|
- platform: time
|
||||||
at: "00:00:00"
|
at: "00:00:00"
|
||||||
@@ -41,11 +35,12 @@ variables:
|
|||||||
planted_date_entity: !input planted_date_helper
|
planted_date_entity: !input planted_date_helper
|
||||||
last_watered_entity: !input last_watered_helper
|
last_watered_entity: !input last_watered_helper
|
||||||
|
|
||||||
|
# Only notify when 7+ days since last watering
|
||||||
condition:
|
condition:
|
||||||
- condition: template
|
- condition: template
|
||||||
value_template: >
|
value_template: >
|
||||||
{% set watered = states(last_watered_entity) %}
|
{% set watered = states(last_watered_entity) %}
|
||||||
{% if watered not in ['unknown', 'unavailable', None] %}
|
{% if watered not in ['unknown','unavailable', None] %}
|
||||||
{{ ((as_timestamp(now()) - as_timestamp(watered)) / 86400) | int >= 7 }}
|
{{ ((as_timestamp(now()) - as_timestamp(watered)) / 86400) | int >= 7 }}
|
||||||
{% else %} false {% endif %}
|
{% else %} false {% endif %}
|
||||||
|
|
||||||
@@ -62,13 +57,12 @@ action:
|
|||||||
{{ ((as_timestamp(now()) - as_timestamp(planted)) / 86400) | int }}
|
{{ ((as_timestamp(now()) - as_timestamp(planted)) / 86400) | int }}
|
||||||
{% else %} 0 {% endif %}
|
{% else %} 0 {% endif %}
|
||||||
|
|
||||||
- service: notify
|
- service: persistent_notification.create
|
||||||
target: !input notification_target
|
|
||||||
data:
|
data:
|
||||||
title: "💧 DWC Water Change Reminder"
|
title: "💧 DWC Water Change Reminder"
|
||||||
message: >
|
message: >
|
||||||
{{ plant_name }} was planted {{ age_days }} days ago
|
{{ plant_name }} was planted {{ age_days }} days ago and
|
||||||
and it’s been {{ days_since_water }} days since last watering.
|
it's been {{ days_since_water }} days since it was last watered.
|
||||||
Time to refresh its water!
|
Time to refresh its water.
|
||||||
|
|
||||||
mode: single
|
mode: single
|
||||||
|
|||||||
Reference in New Issue
Block a user