Automate Override of Irrigation Based On Soil Moisture

I’m new to all this so please bare with me.
I have a Rachio Irrigation Controller and we wanted to be able to override each zone based on soil moisture. I am using Ecowitt soil moisture sensors for the input. To override each zone I am just using a shelly relay to turn off or open the common to the whole system. I created automations for each zone that basically say when this zone is turned on if sensor value is above said humidity level turn off the shelly relay. The Rachio control thinks it’s on due to schedule but because moisture level is so high it can not open the water valve. It works but I currently have to change the humidity level within the Yaml file or thru UI of the automation. I figured out how to make a helper that I can make variable a slider from 0 to 100% humidity.
Now here’s where I am lost. I have no idea how to tie together the automation and the helper so that on my dashboard I can easily just change the value of the humidity/moisture set point.
Getting to this point I feel I’ve achieved a lot due to certain condition I have. I was once an electronics repair tech and programmer for Honeywell working on automation. Unfortunately life didn’t go my way but I am still fighting.
Any help here would greatly be appreciated. Please keep it simple. :slight_smile:

if you’re totally new to home assistant and this is your first project, that’s super impressive. i think my first project was “turn off a light switch when i press a button”…

i’m not 100% sure i get where you’re having trouble, but let’s go step by step… it sounds to me like you’re asking how to add a slider on the dashboard so you can change the input_number.humidity helper… is that right? apologies if i’m wrong… but that’s what it sounds like… at the same time compared to what you’ve done so far… well…here you go.

first, adding your helper to the dashboard. i presume your helper is an input_number?

if so, go to the dashboard, hit the pen in the upper right, hit “add card” in the lower right, choose “by entity” select the helper input_number for humidity you created.
hit “continue” then “add to dashboard”

that’s the basic number slider… we can make it pretty later if you want, but start there…

now you can use the ui to change the humidity value easily. is that what you’re asking? you said you have automation already? so does that do all you need to?

if i’ve misunderstood what you’re looking for, apologies… pls clarify.

1 Like

Thanks for your reply.
I can be confusing when asking questions. My head doesn’t work like it use too.

Anyway, the value of humidity in my automation right now is a fixed value. There are 14 zones. My son, it’s his house I live at, wants to be able to just change that number by sliding a control. He doesn’t want to bother me to change that fixed value for each zone in the automation.

I played with a helper and see how I can create that slider for the dashboard but I have no idea how to program it into to the automation.

The moisture content of the soil is measured by a device that connects to the weather station. We put 14 of those in the ground because like I said there are 14 zones. We always just ran each zone for a certain time but because of conditions and weather some areas got to much water and others not enough. We managed a $600 water bill one month last year. We live in Texas and it gets hot and dry some months. We wanted to water some areas to best value and others let them dry out because not worried about their appearance.

I figured out I could use the soil moisture sensors and then pull their values into HA and be able to water each zone by soil moisture instead of time. Hopefully it helps us control water usage better.

Back to my problem as I said the real question is how do I use the sliders value in the automation.

Here is the automation for one zone.

alias: Irrigation Zone 1 Moisture Override
description: ""
  - platform: device
    type: turned_on
    device_id: 5feedf6944b2be86bba94e3ba9e6f74b
    entity_id: 7447ddbc8fb257fcd8d499ddfd58fa3c
    domain: switch
condition: []
  - if:
      - type: is_humidity
        condition: device
        device_id: cf15b5ae236f8a0a1a45000a5b1d0cf7
        entity_id: c62ec730d55e83ada1ee7781ad63f8ee
        domain: sensor
        above: 30
      - type: turn_off
        device_id: 13c6b87a6ab44d62fff7f74337539116
        entity_id: 865bbe1e581bee429fae365de72772e9
        domain: switch
      - type: turn_on
        device_id: 13c6b87a6ab44d62fff7f74337539116
        entity_id: 865bbe1e581bee429fae365de72772e9
        domain: switch
mode: single

The above: 30 would be my preset to compare to soil moisture sensors value.

I am not sure how to create the code. I get confused on step by step things and numbers. Programming use to flow out of me like water. Again…still fighting.

For all I know I could be doing this completely wrong but right now the automation works. Just need to be able to change the value with a slider.??
Thanks again for any help

i’m not sure how you want to use the input_number.humidity helper? do you want to compare it to 30? and do the “then” part if it’s above 30? or do you want it to be used instead of 30? or something else?

1 Like

Instead of the 30. I want that 30 to be a variable based on the slider. Just don’t know how to ie it all together.

just replace the 30 with the entity_id of your helper.

it should be something like input_number.humidity
input_number.<whatever you named it>

however your code is also incorrect from what i can see in other ways.

for the “if” clause, it should be more like this:

  - condition: numeric_state
    entity_id: sensor.[whatever your sensor entity id is]
    above: input_number.[whatever your humidity entity id is]
then: []

in all the places where you have device_id and entity_id, you should use just the friendly entity_id tag (e.g. for sensors, it will be sensor.your_entity_id )

where the entity_id is what you see for the item on the entity_id page (usually here: http://homeassistant.local:8123/config/entities)

1 Like

I’ll give it a try and let you know how I make out.
Thanks for all your help!!

it looks like you might be programming this directly in yaml. have you considered using the ui to do it? it would have walked you through this for the most part.

1 Like

That is what I used and went to yaml just to look at what it created. In UI it looked like I could only put a numeric fixed value you in and not a variable based on the slider. I could easily be wrong. I prefer to use the UI because code just confuses me. I see too much and my head goes crazy. It’s hard to explain.

armedad you are the best!
You got me thinking and I did go into the UI and figured out how to plug everything in.
I tested it and it works perfectly.
Thanks again for helping me and giving some encouragement.
It has been very tuff since I lost a whole lot after a brain surgery many years ago. I gave up but living here with my son has helped. He pushes me to try things and always says “you’ll figure it out pop just keep trying”.

Again thanks so much. I have a lot of plans for automation so it will be a constant battle but I won’t give up.
We’ve installed close to 100 devices in the house so far. He just helped me upgrade the whole network and that turned out great. We installed TP-Link Omada system with access points mounted on ceiling different places in the house.
I am working on putting all the security cameras and alarm system into HA also.

Thanks again.

in the ui it’s here:

see how it says abve “numeric value of another entity”
put the entity (the helper you made) in that box just below it.

1 Like