input_number:
  irrigation_moisture_threshold:
    name: Irrigation moisture threshold
    min: 0
    max: 4095
    step: 1

template:
  - binary_sensor:
      - name: Irrigation Zone Dry
        state: >
          {{ states('sensor.irrigation_moisture') | int(0) >
             states('input_number.irrigation_moisture_threshold') | int(2450) }}

automation:
  - alias: Irrigation request marker
    trigger:
      - platform: state
        entity_id: binary_sensor.irrigation_zone_dry
        to: "on"
        for: "00:10:00"
    action:
      - service: persistent_notification.create
        data:
          title: Irrigation zone needs water
          message: Check weather, tank level, and pump lockout before watering.
