How to Create YOUR OWN Garden Watering System in Home Assistant!
TLDRThis tutorial video offers an in-depth guide to creating an automated garden watering system using Home Assistant. The presenter shares a two-year perfected automation, discussing the setup of helpers, scripts, and custom sensors. The system waters the garden in the morning, monitors temperature and rainfall over a 3-day span, and adjusts watering duration based on environmental conditions. It utilizes an open weather map API for real-time data and smart devices like plugs for remote control. The video walks viewers through setting up helpers for data storage, sensors for monitoring, and scripts for automation, ultimately guiding them to build a professional and efficient garden watering system.
Takeaways
- π The video is about sharing an automation for a garden watering system using Home Assistant over two years in development.
- π οΈ The system uses various components including helpers, scripts, automations, and custom sensors to manage watering.
- π The watering is scheduled in the morning at sunrise to prevent plant rot from overnight moisture.
- π‘οΈ Temperature and rainfall monitoring are key factors in determining when and how long to water the garden.
- π§ A smart plug connected to a water pump is used to remotely control the watering process through Home Assistant.
- π The system resets monitoring values every 3 days if watering isn't needed and after the garden has been watered.
- π Custom sensors are created for current temperature, days since last watering, and total expected precipitation.
- π Automations are set up to add current rain to the total, check if the garden should be watered, and monitor temperature changes.
- π The tutorial includes detailed steps for setting up helpers, sensors, and scripts in Home Assistant.
- π Open Weather Map is utilized for real-time weather data, requiring an API key and account setup.
- π¨βπ» The video creator provides code and additional resources on GitHub for those following the tutorial.
Q & A
What is the main topic of the video?
-The main topic of the video is about setting up an automated garden watering system using Home Assistant.
What problem did the speaker initially face with their garden watering?
-The speaker initially faced the problem of overwatering their garden, even when it was raining, and not knowing the optimal amount of water and frequency for watering.
What device does the speaker use to pump water for the garden?
-The speaker uses a special pump connected to a smart plug that can be controlled remotely with Home Assistant.
Why does the speaker choose to water the garden in the morning instead of the evening?
-The speaker chooses to water the garden in the morning because leaving water on the plants overnight can cause them to rot.
What is the maximum monitoring period for temperature and rainfall in this system?
-The maximum monitoring period for temperature and rainfall in this system is 3 days.
How does the speaker determine when to water the garden based on temperature?
-The speaker has different watering durations based on the temperature: above 31 degrees Celsius for 90 minutes, between 26 and 31 degrees Celsius with certain rainfall conditions for 75 minutes, and between 21 and 26 degrees Celsius with certain rainfall conditions for 60 minutes.
What are the helper inputs used in the automation?
-The helper inputs used in the automation are: maximum temperature measured, total rain fallen, watering duration, and last watering day.
What sensors are integrated from Open Weather Map for this project?
-The sensors integrated from Open Weather Map include rain, temperature, forecast precipitation, and forecast precipitation probability.
Can the values for temperature and rainfall be adjusted according to personal preference?
-Yes, the speaker mentions that the values for temperature and rainfall can be experimented with and adjusted according to personal preference.
What is the purpose of the custom sensors created in the system?
-The custom sensors are created to monitor specific conditions such as current temperature being higher than a stored value, the number of days since the last watering, total expected precipitation, and total rain fallen plus expected precipitation.
How does the speaker ensure the system knows when to reset values?
-The system resets values after the garden has been watered or if watering was not needed for three days, using scripts and automations to manage and reset the helper values.
What service does the speaker use to get weather data for the automation?
-The speaker uses Open Weather Map service to get weather data such as rainfall and temperature for the automation.
What is the importance of creating an API key from Open Weather Map?
-The API key from Open Weather Map is necessary to connect Home Assistant to the Open Weather Map service, allowing the system to access weather data for the automation.
What is the role of the 'sprinkler water the garden' script in the automation?
-The 'sprinkler water the garden' script is responsible for turning on the water pump or smart plug to water the garden for a duration set by the automation, and then turning it off after the set time.
How does the speaker notify themselves about the status of the watering system?
-The speaker uses a service to send notifications to their phone, informing them when the watering has started or stopped, and other status updates.
What does the speaker recommend to monitor the system effectively?
-The speaker recommends creating a dashboard to monitor all the values of helpers, sensors, automations, and scripts, which can help in debugging and keeping track of the system's status.
Outlines
π± Introduction to Automated Garden Watering System
The speaker introduces a tutorial on creating an automated garden watering system using Home Assistant. The system, which the speaker has been perfecting for over two years, includes various components such as helpers, scripts, automations, and custom sensors. The goal is to build a professional garden watering system that operates efficiently, even during the speaker's absence, such as while on holiday. The speaker mentions using a special pump connected to a smart plug for water distribution, which can be controlled remotely via Home Assistant.
π Setting Up the Watering System with Open Weather Map
The tutorial continues with setting up the automated garden watering system using Open Weather Map for weather data. The speaker explains the process of creating an account and obtaining an API key from Open Weather Map, which is then used in Home Assistant to access weather information. The speaker also details the steps to install and configure Open Weather Map in Home Assistant, emphasizing the importance of waiting for the API key to become active, which may take up to two hours.
π§ Configuring Helpers and Sensors for the System
The speaker proceeds to explain the configuration of helpers and sensors necessary for the automated watering system. Helpers are used to store data such as the last watering day, maximum temperature, total rain fallen, and watering duration. Sensors from Open Weather Map are utilized to monitor current rain, temperature, and forecasted precipitation. Additionally, custom sensors are created to track the number of days since the last watering, the total expected precipitation, and whether the current temperature is higher than previously recorded.
π§ Creating Custom Sensors Using YAML in Home Assistant
The speaker details the process of creating custom sensors in Home Assistant using YAML files. This involves using tools like Studio Code Server or the file editor, which can be installed through Home Assistant's add-ons store. The speaker provides guidance on editing the 'configuration.yaml' and 'templates.yaml' files, emphasizing the need to move any existing template sensors to 'templates.yaml'. The custom sensors are then defined with unique IDs, icons, and state values that perform specific calculations or checks related to the watering system.
π‘ Developing Automations for the Garden Watering System
The tutorial moves on to the creation of automations that will control the garden watering system. The speaker outlines three automations: one that adds current rain to the total rain fallen, another that checks if the garden needs watering based on various conditions including temperature and rainfall, and a third that updates the maximum temperature when the temperature changes. Each automation is meticulously explained, including the triggers, conditions, and actions involved.
π Scripting the Watering and Reset Processes
The speaker discusses the scripting of two key processes for the garden watering system: watering the garden and resetting helper values. The 'sprinkler water the garden' script sends a notification to the speaker's phone, activates the smart plug to start watering, introduces a delay based on the watering duration set by the automations, and then turns off the smart plug. It concludes by resetting the helper values and sending another notification that watering has stopped. The 'sprinkler reset helper values' script is used to reset all helper values to prepare for a new monitoring cycle.
π Monitoring and Debugging with a Custom Dashboard
In the final part of the tutorial, the speaker talks about the importance of monitoring the system using a custom dashboard. This dashboard provides an overview of the values from helpers, sensors, automations, and scripts, which is crucial for debugging and ensuring the system operates as intended. The speaker recommends creating such a dashboard for easy monitoring and maintenance of the automated garden watering system.
Mindmap
Keywords
π‘Automation
π‘Home Assistant
π‘Smart Plug
π‘Custom Sensors
π‘Helpers
π‘Scripts
π‘Open Weather Map
π‘API Key
π‘Templates
π‘YAML
π‘Triggers
Highlights
Introduction to sharing a valuable automation for a garden watering system using Home Assistant.
The automation has been perfected over two years of use.
The video will guide viewers on setting up custom sensors for a professional garden watering system.
The importance of watering the garden in the morning to prevent plant rot.
A 3-day monitoring system for temperature and rainfall is implemented before resetting values.
Criteria for watering the garden based on temperature and rainfall measurements.
Customization of watering durations and temperature thresholds to suit different garden needs.
The necessity of helpers such as input number maximum temperature measured and total rain fallen.
Utilization of open weather map integration for current temperature, rainfall, and forecast precipitation sensors.
Creation of custom sensors for current temperature comparison and days since last watering.
Scripting a garden watering sequence and resetting helper values.
Automations for adding current rain to total fallen and checking if the garden needs watering.
Instructions on creating an API key for open weather map and integrating it with Home Assistant.
Setting up helpers in Home Assistant for tracking watering days and maximum temperatures.
Guide on creating custom sensors using YAML files in Home Assistant.
Explanation of creating a custom sensor for total expected precipitation based on probability.
Automating the process to add current rain to the total rain fallen helper.
Complex automation scenarios for deciding when to water the garden based on various conditions.
Script for turning on/off the water pump and resetting helper values post watering.
Recommendation to create a dashboard for monitoring the garden watering system.
Transcripts
Browse More Related Video
Master Home Assistant Templates: State Based Entities
Professional ALARM SYSTEM in Home Assistant! How to set it up.
My Garden Has Never Looked Better... | FULL Spring 2022 Garden Tour
System statistics, automatic entities lists & device counters in Home Assistant
Zigbee2MQTT vs ZHA vs deCONZ - WATCH THIS BEFORE YOU DECIDE!
Templates and Custom Sensors in Home Assistant - How To TUTORIAL
5.0 / 5 (0 votes)
Thanks for rating: