Science and technology

How I automate plant care utilizing Raspberry Pi and open supply instruments

Automation is a scorching subject proper now. In my day job as an SRE a part of my remit is to automate as many repeating duties as attainable. But how many people try this in our day by day, not-work, lives? This yr, I’m targeted on automating away the toil in order that we will give attention to the issues which might be essential.

Home Assistant has so many options and integrations, it may be overwhelming at instances. And as I’ve talked about in earlier articles, I exploit it for a lot of issues, together with monitoring vegetation.

$ bluetoothctl scan le
Discovery began
[NEW] Device
[NEW] Device
[NEW] Device
[NEW] Device
[NEW] Device
[NEW] Device
[NEW] Device

There are quite a few little units you should purchase to control your vegetation. The Xiomi MiaFlora units are small, cheap, and have a local integration with Home Assistant. Which is nice—so long as the plant and Home Assistant are in the identical room.

We’ve all been in locations the place one spot there’s a nice sign, and transferring 1mm in any route makes it a useless zone—and it’s much more irritating when you’re indoors. Most Bluetooth LE (Low Energy) units have a spread of about 100m, however that is utilizing line of sight, and doesn’t embody interference from issues like partitions, doorways, home windows, or main home equipment (significantly, a fridge is a good large sign blocker). Remote Home Assistant is ideal for this. You can arrange a Raspberry Pi with Home Assistant Operating System (HASSOS) within the room with the vegetation, after which use the primary Home Assistant as a central management panel. I attempted this on a Raspberry Pi Zero W, and whereas the Pi Zero W can run Home Assistant, it would not do it very nicely. You in all probability desire a Pi 3 or Pi 4 when doing this.

Start with a contemporary HASSOS set up, and ensure all the things is up-to-date, then set up HACS and Remote Home Assistant like I did in my article Automate and manage multiple devices with Remote Home Assistant. Now for the tough bits. Install the SSH and Web Terminal Add-on, and switch off Protection Mode so to get a session on the bottom OS and never in a container. Start the add-on, and it seems on the sidebar. Click on it to load the terminal.

You at the moment are in a root session terminal on the Pi. Insert all of the warnings right here about being cautious and how one can mess up the system ( those). Inside the terminal, run bluetoothctl scan le to seek out the plant sensor, typically named “Flower Care” like mine.

(Kevin Sonney, CC BY-SA 40)

Make a observe of the tackle for the plant sensor. If you will have multiple, it may very well be complicated to determine which is which, and may take some trial and error. Once you have recognized the plant sensor, it’s time to add it to Home Assistant. This requires enhancing the configuration.yml file instantly, both with the file editor add on, or within the terminal you simply created. In my case, I added each a sensor and a plant block to the configuration.

sensor:
  - platform: miflora
    scan_interval: 60
    mac: "C4:7C:8D:6C:DE:FE"
    title: "pitcher_plant"
    plant:
    pitcher_plant:
        sensors:
            moisture: sensor.pitcher_plant_moisture
            battery: sensor.pitcher_plant_battery
            temperature: sensor.pitcher_plant_temperature
            conductivity: sensor.pitcher_plant_conductivity
            brightness: sensor.pitcher_plant_brightness

Save the file, and restart Home Assistant, and it is best to see a plant card on the Overview tab.

(Kevin Sonney, CC BY-SA 40)

Once that is executed, return to the primary Home Assistant, and add the newly accessible plant part to the record of issues to import from the distant. You can then add the part to dashboards on the primary HASS set up, and create automations and notifications primarily based on the plant standing.

I exploit this to watch a pitcher plant, and I’ve extra sensors on the best way so I can hold tabs on all my houseplants—all of which reside exterior the Bluetooth vary of my central Home Assistant Pi.

Most Popular

To Top