irrigation_unlimited icon indicating copy to clipboard operation
irrigation_unlimited copied to clipboard

Can you add rain sensor?

Open norbertjoni opened this issue 3 years ago • 2 comments

I have this diy rain sensor : https://community.home-assistant.io/t/commercial-2-wires-rain-sensor-converted-to-smart-sensor-with-shelly-d-w/194169

Can you add to your project please?

norbertjoni avatar Jun 22 '21 18:06 norbertjoni

My Watering system also has a sensor to indicate if it has rained or is raining. If there could be a link to a sensor to dissable the shedule or similar would be great.

timnell avatar Aug 03 '22 02:08 timnell

You control the schedule via an adjust_time service call which can be on/off or some other value to alter the duration. Here is an example taken from the documentation. It shows how to take any sensor in HA and make changes to watering time. Use this as a starting point to create an automation.

Cheers

automation:
  - alias: ESPHome soil moisture adjustment
    trigger:
      platform: state
      entity_id:
        - sensor.yard1_humidity
    action:
      service: irrigation_unlimited.adjust_time
      data:
        # Change the following to the entity/zone you wish to adjust
        entity_id: binary_sensor.irrigation_unlimited_c1_m
        percentage: >
          {# Threshold variable 0-100 percent #}
          {% set threshold = 40 %}

          {# Sensor data #}
          {% set humidity = states('sensor.yard1_humidity') | float %}

          {% if humidity < threshold %}
            {# Option 1 - A linear sliding scale #}
            {% set multiplier = 1 - (humidity / threshold) %}
            {# Option 2 - On or Off #}
            {% set multiplier = 1.0 %}
          {% else %}
            {% set multiplier = 0.0 %} {# It's too wet, turn off #}
          {% endif %}

          {# Return multiplier as a percentage #}
          {{ (multiplier * 100) | round(0) }}

rgc99 avatar Aug 04 '22 01:08 rgc99