How to Create YOUR OWN Garden Watering System in Home Assistant!

Smart Home Junkie
29 May 202239:19
32 Likes 10 Comments

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.

  • πŸ˜€ 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.

🌱 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.

Automation refers to the use of technology to create systems that perform tasks with minimal human intervention. In the context of the video, the main theme revolves around setting up an automated garden watering system using Home Assistant. The script discusses various components like helpers, scripts, and sensors that work together to automate the watering process based on environmental conditions.
πŸ’‘Home Assistant
Home Assistant is an open-source home automation platform that allows users to control various devices and systems in their homes through a centralized interface. The video script describes how the presenter has been using Home Assistant for over two years to perfect their garden watering automation, emphasizing its role as a central hub for managing the custom automation.
πŸ’‘Smart Plug
A smart plug is a device that can be connected to regular electrical outlets and allows for remote control and automation of non-smart appliances. In the script, the presenter mentions using a smart plug connected to a water pump to enable remote activation and deactivation of the garden watering system through Home Assistant.
πŸ’‘Custom Sensors
Custom sensors in the context of Home Assistant are user-defined sensors that can be created to monitor specific conditions or data points. The video script details the creation of custom sensors such as 'current temperature is higher' and 'day since last watering day' to tailor the automation to the garden's specific watering needs.
Helpers in Home Assistant are entities that store and manage data used by automations and scripts. The script mentions several helpers such as 'input number maximum temperature measured' and 'input number total rain fallen' that are integral to the functioning of the automated garden watering system, storing values like temperature and rainfall data.
Scripts in Home Assistant are sequences of actions that can be triggered by events or conditions. The video script discusses creating scripts like 'sprinkler water the garden' and 'sprinkler reset helper values' to control the watering process and reset the system's state after watering or when a reset is needed.
πŸ’‘Open Weather Map
Open Weather Map is a service that provides weather data and forecasts through an API. The video script describes using Open Weather Map to obtain real-time weather information such as current temperature and rainfall, which are critical for the garden watering system to make decisions on when to water the garden.
πŸ’‘API Key
An API key is a unique code that allows applications to access and use external services or data, such as Open Weather Map's weather data. The script explains the process of generating an API key for Open Weather Map and using it to connect Home Assistant to the weather service, which is essential for the functioning of the automated system.
In Home Assistant, templates are a way to create dynamic entities using scripts or other entities' states. The video script refers to 'templates.yaml' as the file where custom template sensors are defined, which are used to calculate values like 'total expected precipitation' based on the Open Weather Map forecast.
YAML (YAML Ain't Markup Language) is a human-readable data serialization standard used in configuration files and applications. The script mentions editing YAML files, specifically 'templates.yaml', to set up custom sensors, which is a key step in configuring the automated garden watering system in Home Assistant.
Triggers in the context of Home Assistant automations are events or changes that initiate an automation sequence. The video script explains using various triggers such as 'state' changes for the Open Weather Map rain sensor or 'Sun' triggers at sunrise to activate the check for whether the garden needs watering.

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.

Rate This

5.0 / 5 (0 votes)

Thanks for rating: