I am attempting my first automation: a plan watering system using a small submersible pump, a relay, an ESP32 WEMOS LOLIN32 (I think it is called this way) and a water level sensor (when the water is above the sensor it stays horizontal and when it goes below it tilts and breaks a connection).
I have managed using the following yaml configuration loaded on the ESP32 to create a switch that when I trigger it manually, stays open for a number of seconds and then turns itself off if the binary sensor is off and it will only turn on for a very short amount of time if the sensor is on:
What I would like to do from here is the following:
is there a way to avoid turning on the pump for a short while when the sensor state is on?
instead of manually turning on the pump like I do now for testing I would like to have the pump turn on once in the morning (say at 6 am) for 10 mins and once in the evening at 8 pm (for 10 mins) every day and only if the water level sensor is in the off position. If the sensor is on the ideally I would like the pump to not turn on at all (I place the water level sensor in the tank so that the pump will not run on empty but it is better to not turn it on at all if possible) and maybe send me a notification somehow through the HA interface.
Can anyone help a complete beginner with automations?
thank you for your reply. can you please clarify it a bit more please? where do I load these automations? on the esp32 yaml file? in the configuration.yaml file of home assistant?
Ok, thank you! I have not made any other automation until this point and I was a bit confused about where these scripts reside, and how to make them work.
I tried last night from the HA interface to create an automation using a set time as a trigger, a condition and the action but I couldnāt make it to fire the automation at the set time. The automation would work when I would hit execute manually but not at the set time I wanted. This adds to my confusion.
This is the code I have now. I changed it from the one I tried last night. I was hoping to get something going but nothing triggers:
- id: '1586674481614'
alias: water plants
description: ''
trigger:
- entity_id: switch.pump_switch
for: 10s
from: 'off'
platform: state
to: 'on'
condition:
- after: 09:55:00
before: '10:00:00'
condition: time
action:
- data: {}
entity_id: automation.water_plants
service: automation.turn_on
I figured if I manage to get the switch to turn on at a set time and then off after 10s I can then add an extra condition to check if the binary sensor is in a certain state too. But I set the time (in this case it was (9:55) and the time went and passed and nothing happened
As you can see I put a trigger time to test it and a small delay. What happens is as follows: the automation triggers at the set time but unfortunately the switch just stays on. It is as if the automation does not proceed to delay for 10 seconds and then switch off. Any idea what could be the cause of this behavior?
Thank you so much for your help btw!
P.S.: this code above is how it was generated by the UI. I have no idea what is with the - data: {} sections in the action block.
Sorry if this a somewhat unrelated question: what pump are you using? I tried with a couple of different pumps, but I canāt even get enough pressure to water one plant ā I was hoping I could use the same pump for 2-3 plants, but again, the water coming out of one mini sprayer is not enough for one single plant.
Sorry I took so long to answer by only now I saw your post. I got this pump:
It works ok for my application. I have three rectangular planters about 10 cm x 50 cm with three or four plants in each. I get the water from a 70l plastic bin where the pump is submerged. The distance between the bin and the planters is about 70 cm. The length of the tube I use is about 2.5 m. I push the water through a 8mm diameters tube and then it goes into the 2.5 m long tube with a diameter of 5 mm. I used that because I used some Gardena micro drippers. They are not ideal mind you. I do not have a sprayer so I have no idea how well it works with one.
Thanks!! Iāll try that, but I have a similar one and when I add the sprayer, it starts ādrippingā instead. Perhaps, I should just eliminate the sprayer and have āstarā like arrangement of dripping ends.
Again, thanks for the help!!
Cheers,
Hi, no problem. I do not have a sprayer connected to it. I have these dripping heads from Gardena. Microdrippers they are called I believe. I have no idea if it will work with a srayer. Maybe the pump isnāt strong enough to generate that much pressure. For that particular arrangement of flowers I find the drippers to work wonders!