Build Hydroponics Light Timer With Home Assistant
Hello, fellow garden enthusiasts! Have you ever found yourself getting annoyed over the lighting needs of your precious plants, or wishing you could put your garden’s lighting schedule on autopilot, without having that old timer buzzing away in the background?? I sure have! Just like you, my tomatoes, squash, and basil all crave that perfect glow.
Well, fear not! In this post, we’ll walk you through creating a do-it-yourself grow light timer for your garden using Home Assistant. We’ll also discuss some of the options available when it comes to choosing between Zigbee and WiFi plugs.
Tutorial Difficulty Level: 🌱 (Easy)
Getting Started with Home Assistant
Before we dive in, let’s go over some of the basics. Home Assistant is an open-source platform for automating your home. It integrates with a lot of different products and services, allowing you to create powerful automated rules and routines — like our grow light timer!
To get started, you’ll need to install Home Assistant on your computer or Raspberry Pi. There are lots of great tutorials available online that can help with this step — just check out the Home Assistant website for a seamless step-by-step guide. If you’re more of a visual learner, there’s a many informative video tutorials available. For instance, you may find this video tutorial particularly helpful.
It provides a clear, easy-to-follow walkthrough of the installation process. Now, let’s gear up and shed some light on how to automate your garden’s lighting system!
While you’re getting familiarized with Home Assistant, be sure to check out my previous blog post for a deeper dive into Automated Hydroponic Garden with Home Assistant
Selecting a Grow Light
To get started, you’ll need to choose a grow light that fits your needs. Whether you’re looking for LED, fluorescent, or something else, there are lots of great options available on the market. I use the viparSpectra LED grow light, as it’s perfect for my small indoor garden.
Once you’ve chosen your grow light and set it up in your desired location, you’re ready to go! Now, let’s move on to the fun part: setting up our Home Assistant automation.
Choosing between Zigbee and WiFi Plug
For our next step, we’ll need to choose between Zigbee and WiFi plugs. Zigbee is a wireless protocol used for communication between devices at short distances. It’s great for connecting multiple lights to one controller, as it has low latency and reduced power consumption and it will not fill your WiFi with too many connections.
On the other hand, WiFi plugs are perfect if you want direct control of your computer or just want to avoid having a hub in the middle. WiFi plugs also tend to be a little bit cheaper.
I use Zigbee plugs for my grow light timer because I have multiple devices that need to be connected at the same time. However, if you only have one or two lights, then WiFi might be a better option for you.
Integrating Your Plugs in Home Assistant
Now comes the exciting part: integrating your chosen Zigbee or WiFi plugs with Home Assistant. No matter which plug type you chose, the integration process is quite straightforward, and I am here to guide you through it!
Zigbee Plugs
If you opted for Zigbee plugs, you’ll need a compatible Zigbee hub to integrate them with Home Assistant. The good news is, many popular smart home hubs like Philips Hue Bridge or Samsung SmartThings support Zigbee.
Once your Zigbee plug is paired with your hub, you can add it to Home Assistant. Go to `Configuration` > `Integrations` and click on the `+ Add Integration` button. Select your hub from the list, follow the instructions, and your Zigbee plug will be integrated into your Home Assistant setup.
WiFi Plugs
For those of you who chose WiFi plugs, integration is even simpler. Just ensure your plug is connected to the same WiFi network as your Home Assistant device. Then, go to `Settings` > Configuration` > `Integrations` > `+ Add Integration` and select your WiFi plug from the list. Follow the prompts, and voila! Your WiFi plug is now part of your Home Assistant ecosystem. Sometimes the home assistant will even discover the WiFi plugs as new devices on the network, and you can just click to add them.
Building the Automation
Now that we have our plugs integrated with Home Assistant, it’s time to build our automation! You’ll want to go to `Configuration` > `Automations`, then click on the `+ Add Automation` button.
Creating Automation with a Date/Time Helper or Timestamp-Class Sensor
With our plugs ready and waiting, let’s dive into creating our automation. We’ll use a date/time helper or a timestamp-class sensor as triggers for our grow light automation. This will allow us to automate turning our grow light on and off at specific times.
Create Two Date/Time Helpers: From the Home Assistant sidebar, navigate to `Configuration` > `Helpers`. Click on the `+ Add Helper` button, and select `Date and Time`. Name your helper something appropriate, like “Grow Light Timer ON”.
Now Create another Date/Time Helper, this time for the off-time. Name it something like “Grow Light Timer OFF”.
Set up the Automation Trigger: Now, head to `Configuration` > `Automation`, and click on the `+ Add Automation` button. You’ll be prompted to choose a trigger type. Here, select `Time`. In the `At` field, click on the blue button and select your newly created “Grow Light Timer ON” helper.
Select the Action: After setting up the trigger, scroll down to `Action` and select `Device` from the dropdown menu. You’ll be prompted to choose the device you want to control, which will be your ZigBee or WiFi plug. You’ll also need to choose what you want it to do — in our case, we want it to turn on the grow light.
Now do the same thing, just for your “Grow Light Timer OFF” helper, and select the action to turn off the grow light.
Test and Save the Automation: Once you’ve configured the action, click on the `Save` button at the bottom of the page. It’s always a good idea to test your automation to make sure it’s working correctly. You can do this by clicking on the `Execute` button.
Adding to your Dashboard in Home Assistant
After you’ve set up your automation, it’s time to add it to your Home Assistant dashboard so you can monitor and manage it with ease. Here’s how:
Open your Home Assistant Dashboard: To add your newly created helper to your dashboard, first go to your Home Assistant dashboard. You can do this by clicking on the menu icon in the top left corner and selecting `Overview`.
Edit the Dashboard: On the dashboard, you’ll see a pencil icon in the top right corner. Click on this to start editing your dashboard.
Add a New Card: Click on the `+ Add Card` button at the bottom right. You will be prompted to choose a card type. For our purpose, the `Entities` card is a perfect fit.
Configure the Card: Fill in the title as something descriptive, like “Grow Light Timer”. Under `Entities`, click on the `+ Add` button, and in the entity drop-down list, find your two helpers “Grow Light Timer ON” and “Grow Light Timer OFF”.
In the same entity card also choose your Light plug entity, so you can turn ON and OFF the light manually
Save the Card: Once you’re happy with your configuration, click on the `Save` button at the bottom of the card configuration page.
And there you have it! Your new grow light timers are now visible on your Home Assistant dashboard. You can manually adjust the time ON/OFF or simply monitor your automation right from your dashboard.
Now you can build on this automation and add more features like a sun sensor to help you adjust the on/off times depending on the natural light outside. Or change light intensity adjust depending on the time of day or growth cycle of a plant.
I hope this guide gave you the tools and confidence to build your own grow light timer with Home Assistant. Good luck, and enjoy the journey!
Happy Gardening! 🌱💡😁
Apartment Gardener is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com. We also participate in other affiliate programs which compensate us for referring traffic.