Update PlantMonitor_bp.yaml
This commit is contained in:
@@ -1,60 +1,74 @@
|
|||||||
blueprint:
|
blueprint:
|
||||||
name: 💧 DWC Plant Tracker
|
name: 💧 DWC Plant Tracker (with Reset Button)
|
||||||
description: >
|
description: >
|
||||||
Track plants in Deep Water Culture (DWC) or soil setups.
|
Tracks plant age and watering schedule.
|
||||||
Notifies you to change or add water every 7 days.
|
Notifies if watering is overdue (7+ days)
|
||||||
|
and supports a manual reset button to log watering.
|
||||||
domain: automation
|
domain: automation
|
||||||
input:
|
input:
|
||||||
plant_name:
|
plant_name:
|
||||||
name: Plant Name
|
name: Plant Name
|
||||||
description: Friendly name of your plant (e.g. "Lettuce 1").
|
description: The friendly name of your plant (e.g. "Hungarian Hot Wax 1").
|
||||||
default: "My Plant"
|
default: "My Plant"
|
||||||
last_watered_helper:
|
|
||||||
name: Last Watered Helper
|
planted_date_helper:
|
||||||
description: >
|
name: Planted Date Helper
|
||||||
Select the Date/Time helper for when this plant was last watered.
|
description: Select the Date helper for when this plant was planted.
|
||||||
selector:
|
selector:
|
||||||
entity:
|
entity:
|
||||||
domain: input_datetime
|
domain: input_datetime
|
||||||
|
|
||||||
|
last_watered_helper:
|
||||||
|
name: Last Watered Helper
|
||||||
|
description: Select the Date/Time helper for the plant’s last watering.
|
||||||
|
selector:
|
||||||
|
entity:
|
||||||
|
domain: input_datetime
|
||||||
|
|
||||||
notification_target:
|
notification_target:
|
||||||
name: Notification Target
|
name: Notification Target
|
||||||
description: >
|
description: Choose how to receive water-change reminders.
|
||||||
Choose how to receive reminders (e.g. mobile app, persistent_notification, etc.)
|
|
||||||
selector:
|
selector:
|
||||||
target:
|
target:
|
||||||
|
|
||||||
# Trigger every day at midnight to check age
|
# Trigger daily at midnight
|
||||||
trigger:
|
trigger:
|
||||||
- platform: time
|
- platform: time
|
||||||
at: "00:00:00"
|
at: "00:00:00"
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
plant_name: !input plant_name
|
plant_name: !input plant_name
|
||||||
|
planted_date_entity: !input planted_date_helper
|
||||||
last_watered_entity: !input last_watered_helper
|
last_watered_entity: !input last_watered_helper
|
||||||
|
|
||||||
# Conditions check if plant hasn't been watered in 7+ days
|
|
||||||
condition:
|
condition:
|
||||||
- condition: template
|
- condition: template
|
||||||
value_template: >
|
value_template: >
|
||||||
{% set last = states(last_watered_entity) %}
|
{% set watered = states(last_watered_entity) %}
|
||||||
{% if last not in ['unknown', 'unavailable', None] %}
|
{% if watered not in ['unknown', 'unavailable', None] %}
|
||||||
{{ ((as_timestamp(now()) - as_timestamp(last)) / 86400) | int >= 7 }}
|
{{ ((as_timestamp(now()) - as_timestamp(watered)) / 86400) | int >= 7 }}
|
||||||
{% else %}
|
{% else %} false {% endif %}
|
||||||
false
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
action:
|
action:
|
||||||
- variables:
|
- variables:
|
||||||
days_since: >
|
days_since_water: >
|
||||||
{% set last = states(last_watered_entity) %}
|
{% set watered = states(last_watered_entity) %}
|
||||||
{% if last not in ['unknown','unavailable',None] %}
|
{% if watered not in ['unknown','unavailable',None] %}
|
||||||
{{ ((as_timestamp(now()) - as_timestamp(last)) / 86400) | int }}
|
{{ ((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 %}
|
{% else %} 0 {% endif %}
|
||||||
|
|
||||||
- service: notify
|
- service: notify
|
||||||
target: !input notification_target
|
target: !input notification_target
|
||||||
data:
|
data:
|
||||||
title: "💧 DWC Water Change Reminder"
|
title: "💧 DWC Water Change Reminder"
|
||||||
message: "{{ plant_name }} needs a water change! It’s been {{ days_since }} days since last watering."
|
message: >
|
||||||
|
{{ plant_name }} was planted {{ age_days }} days ago
|
||||||
|
and it’s been {{ days_since_water }} days since last watering.
|
||||||
|
Time to refresh its water!
|
||||||
|
|
||||||
mode: single
|
mode: single
|
||||||
|
|||||||
Reference in New Issue
Block a user