Detect Watering and Fast Soil Moisture

</>blueprint:
name: Detect Watering and Fast Soil Moisture Drop
description: >
Detects when watering occurs (based on a sudden moisture increase),
then monitors soil moisture drop over 6 hours. Alerts if drop exceeds threshold.
domain: automation
input:
moisture_sensor:
name: Soil Moisture Sensor
selector:
entity:
domain: sensor
min_increase:
name: Minimum Moisture Increase to Detect Watering
default: 5
selector:
number:
min: 1
max: 20
unit_of_measurement: ‘%’
drop_threshold:
name: Moisture Drop Threshold (over 6 hours)
default: 15
selector:
number:
min: 5
max: 50
unit_of_measurement: ‘%’
notify_device:
name: Device to Notify
selector:
device:
integration: mobile_app

trigger:

  • platform: state
    entity_id: !input moisture_sensor

variables:
min_increase: !input min_increase
drop_threshold: !input drop_threshold
moisture_sensor: !input moisture_sensor

condition:

action:

  • variables:
    current: “{{ trigger.to_state.state | float }}”
    previous: “{{ trigger.from_state.state | float }}”
  • choose:
    • conditions:
      • condition: template
        value_template: >
        {{ (current - previous) >= min_increase }}
        sequence:
      • variables:
        start_value: “{{ current }}”
      • delay: “06:00:00”
      • variables:
        end_value: “{{ states[moisture_sensor] | float }}”
        drop: “{{ start_value - end_value }}”
      • condition: template
        value_template: >
        {{ drop >= drop_threshold }}
      • service: notify.mobile_app_{{ device_attr(notify_device, ‘name’) | lower | replace(’ ', ‘_’) }}
        data:
        message: >
        Fast soil moisture drop detected! Dropped {{ drop }}% in 6 hours after watering.
        title: Moisture Drop Warning
        mode: single </>

Hello Darren ,

Thanks for contributing to the community with a new Blueprint.

Would you be so kind as to adjusting the format of your code so that we can read it properly & check the YAML spacing, etc. Editing your original is the preferred way. It is very hard for us to tell what is what when the text formatter jumbles everything like that.
Use the </> button or this:
Here is an example of how to fix it from the site FAQ Page.
How to help us help you - or How to ask a good question.

Also
I have a suggestion for you. Many people who are not familiar with directory structures will have problems installing this without the Home Assistant MY tools.
Adding a MY link for this Blueprint to your top post would help them a lot.
Here is the link to make that.
Create a link – My Home Assistant