{"id":64676,"date":"2022-05-28T09:00:48","date_gmt":"2022-05-28T09:00:48","guid":{"rendered":"https:\/\/www.cryptocabaret.com\/?p=64676"},"modified":"2022-05-28T09:00:48","modified_gmt":"2022-05-28T09:00:48","slug":"how-i-automate-plant-care-using-raspberry-pi-and-open-source-tools","status":"publish","type":"post","link":"https:\/\/www.cryptocabaret.com\/?p=64676","title":{"rendered":"How I automate plant care using Raspberry Pi and open source tools"},"content":{"rendered":"<p><span class=\"field field--name-title field--type-string field--label-hidden\">How I automate plant care using Raspberry Pi and open source tools<\/span><br \/>\n<span class=\"field field--name-uid field--type-entity-reference field--label-hidden\"><a title=\"View user profile.\" href=\"https:\/\/opensource.com\/users\/ksonney\" class=\"username\">Kevin Sonney<\/a><\/span><br \/>\n<span class=\"field field--name-created field--type-created field--label-hidden\">Sat, 05\/28\/2022 &#8211; 03:00<\/span><\/p>\n<div data-drupal-selector=\"rate-node-70027\" class=\"rate-widget-thumbs-up\" title=\"Register or Login to like.\">\n<div class=\"rate-thumbs-up-btn-up vote-pending\"><a href=\"https:\/\/opensource.com\/user\/register\">Register<\/a> or <a href=\"https:\/\/opensource.com\/user\/login?current=\/rss.xml\">Login<\/a> to like<\/div>\n<div class=\"rate-score\"><a href=\"https:\/\/opensource.com\/user\/register\">Register<\/a> or <a href=\"https:\/\/opensource.com\/user\/login?current=\/rss.xml\">Login<\/a> to like<\/div>\n<\/div>\n<div class=\"clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item\">\n<p><em>Automation is a hot topic right now. In my day job as an SRE part of my remit is to automate as many repeating tasks as possible. But how many of us do that in our daily, not-work, lives? This year, I am focused on automating away the toil so that we can focus on the things that are important.<\/em><\/p>\n<p>Home Assistant has so many features and integrations, it can be overwhelming at times. And as I\u2019ve mentioned in previous articles, I use it for many things, including monitoring plants.<\/p>\n<pre>\n<div class=\"geshifilter\"><div class=\"bash geshifilter-bash\">$ bluetoothctl scan le<br>\nDiscovery started<br><span class=\"br0\">[<\/span>NEW<span class=\"br0\">]<\/span> Device<br><span class=\"br0\">[<\/span>NEW<span class=\"br0\">]<\/span> Device<br><span class=\"br0\">[<\/span>NEW<span class=\"br0\">]<\/span> Device<br><span class=\"br0\">[<\/span>NEW<span class=\"br0\">]<\/span> Device<br><span class=\"br0\">[<\/span>NEW<span class=\"br0\">]<\/span> Device<br><span class=\"br0\">[<\/span>NEW<span class=\"br0\">]<\/span> Device<br><span class=\"br0\">[<\/span>NEW<span class=\"br0\">]<\/span> Device<\/div><\/div><\/pre>\n<p>There are numerous little devices you can buy to keep an eye on your plants. The Xiomi MiaFlora devices are small, inexpensive, and have a native integration with Home Assistant. Which is great\u2014as long as the plant and Home Assistant are in the same room.<\/p>\n<\/p>\n<div class=\"embedded-resource-list callout-float-right\">\n<div class=\"field field--name-title field--type-string field--label-hidden field__item\">More on automation<\/div>\n<div class=\"field field--name-links field--type-link field--label-hidden field__items\">\n<div class=\"field__item\"><a href=\"https:\/\/www.redhat.com\/en\/engage\/automated-enterprise-ebook-20171115?intcmp=701f2000000h4RcAAI\">Download now: The automated enterprise eBook<\/a><\/div>\n<div class=\"field__item\"><a href=\"https:\/\/www.redhat.com\/en\/services\/training\/do007-ansible-essentials-simplicity-automation-technical-overview?intcmp=701f2000000h4RcAAI\">Free online course: Ansible essentials<\/a><\/div>\n<div class=\"field__item\"><a href=\"https:\/\/opensource.com\/downloads\/ansible-cheat-sheet?intcmp=701f2000000h4RcAAI\">Ansible cheat sheet<\/a><\/div>\n<div class=\"field__item\"><a href=\"https:\/\/opensource.com\/downloads\/home-automation-ebook?intcmp=701f2000000h4RcAAI\">eBook: A practical guide to home automation using open source tools<\/a><\/div>\n<div class=\"field__item\"><a href=\"https:\/\/opensource.com\/downloads\/ansible-quickstart?intcmp=701f2000000h4RcAAI\">A quickstart guide to Ansible<\/a><\/div>\n<div class=\"field__item\"><a href=\"https:\/\/opensource.com\/tags\/automation?intcmp=701f2000000h4RcAAI\">More articles about open source automation<\/a><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<p>We&#8217;ve all been in places where one spot there is a great signal, and moving 1mm in any direction makes it a dead zone\u2014and it is even more frustrating when you are indoors. Most Bluetooth LE (Low Energy) devices have a range of about 100m, but that&#8217;s using line of sight, and does not include interference from things like walls, doors, windows, or major appliances (seriously, a refrigerator is a great big signal blocker). Remote Home Assistant is perfect for this. You can set up a Raspberry Pi with Home Assistant Operating System (HASSOS) in the room with the plants, and then use the main Home Assistant as a central control panel. I tried this on a Raspberry Pi Zero W, and while the Pi Zero W can run Home Assistant, it doesn&#8217;t do it very well. You probably want a Pi 3 or Pi 4 when doing this.<\/p>\n<p>Start with a fresh HASSOS installation, and make sure everything is up-to-date, then install HACS and Remote Home Assistant like I did in my article\u00a0<a href=\"https:\/\/opensource.com\/article\/22\/5\/remote-home-assistant\" rel=\"bookmark noopener\" target=\"_blank\"><span class=\"field field--name-title field--type-string field--label-hidden\">Automate and manage multiple devices with Remote Home Assistant<\/span><\/a>. Now for the tricky bits. Install the <code>SSH and Web Terminal<\/code> Add-on, and turn off <code>Protection Mode<\/code> so that you can get a session on the base OS and not in a container. Start the add-on, and it appears on the sidebar. Click on it to load the terminal.<\/p>\n<p>You are now in a root session terminal on the Pi. Insert all the warnings here about being careful and how you can mess up the system (you know the ones). Inside the terminal, run <code>bluetoothctl scan le<\/code> to find the plant sensor, often named &#8220;Flower Care&#8221; like mine.<\/p>\n<article class=\"align-center media media--type-image media--view-mode-default\">\n<div class=\"field field--name-field-media-image field--type-image field--label-hidden field__item\">  <img decoding=\"async\" src=\"https:\/\/www.cryptocabaret.com\/wp-content\/uploads\/2022\/05\/Day_06-2.png\" width=\"778\" height=\"800\" alt=\"Image of finding plant sensors\" loading=\"lazy\"><\/div>\n<div class=\"field field--name-field-caption field--type-text-long field--label-hidden caption field__item\"><span class=\"caption__byline\">Image by: <\/span><\/p>\n<p>(Kevin Sonney, CC BY-SA 40)<\/p>\n<\/div>\n<\/article>\n<p>Make a note of the address for the plant sensor. If you have more than one, it could be confusing to figure out which is which, and can take some trial and error. Once you&#8217;ve identified the plant sensor, it is time to add it to Home Assistant. This requires editing the <code>configuration.yml<\/code> file directly, either with the file editor add on, or in the terminal you just created. In my case, I added both a sensor and a plant block to the configuration.<\/p>\n<pre>\n<div class=\"geshifilter\"><div class=\"bash geshifilter-bash\">sensor:<br>\n\u00a0 - platform: miflora<br>\n\u00a0 \u00a0 scan_interval: <span class=\"nu0\">60<\/span><br>\n\u00a0 \u00a0 mac: <span class=\"st0\">\"C4:7C:8D:6C:DE:FE\"<\/span><br>\n\u00a0 \u00a0 name: <span class=\"st0\">\"pitcher_plant\"<\/span><br>\n\u00a0 \u00a0 plant:<br>\n\u00a0 \u00a0 pitcher_plant:<br>\n\u00a0 \u00a0 \u00a0 \u00a0 sensors:<br>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 moisture: sensor.pitcher_plant_moisture<br>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 battery: sensor.pitcher_plant_battery<br>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 temperature: sensor.pitcher_plant_temperature<br>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 conductivity: sensor.pitcher_plant_conductivity<br>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 brightness: sensor.pitcher_plant_brightness<\/div><\/div><\/pre>\n<p>Save the file, and restart Home Assistant, and you should see a plant card on the Overview tab.<\/p>\n<article class=\"align-center media media--type-image media--view-mode-default\">\n<div class=\"field field--name-field-media-image field--type-image field--label-hidden field__item\">  <img decoding=\"async\" src=\"https:\/\/www.cryptocabaret.com\/wp-content\/uploads\/2022\/05\/Day_06-3.png\" width=\"998\" height=\"332\" alt=\"Image showing plant needs watering\" loading=\"lazy\"><\/div>\n<div class=\"field field--name-field-caption field--type-text-long field--label-hidden caption field__item\"><span class=\"caption__byline\">Image by: <\/span><\/p>\n<p>(Kevin Sonney, CC BY-SA 40)<\/p>\n<\/div>\n<\/article>\n<p>Once that&#8217;s done, go back to the main Home Assistant, and add the newly available <code>plant<\/code> component to the list of things to import from the remote. You can then add the component to dashboards on the main HASS installation, and create automations and notifications based on the plant status.<\/p>\n<p>I use this to monitor a pitcher plant, and I have more sensors on the way so I can keep tabs on all my houseplants\u2014all of which live outside the Bluetooth range of my central Home Assistant Pi.<\/p>\n<\/div>\n<div class=\"clearfix text-formatted field field--name-field-article-subhead field--type-text-long field--label-hidden field__item\">\n<p>I keep tabs on all my houseplants by using Home Assistant and a Raspberry Pi.<\/p>\n<\/div>\n<div class=\"field field--name-field-lead-image field--type-entity-reference field--label-hidden field__item\">\n<article class=\"media media--type-image media--view-mode-caption\">\n<div class=\"field field--name-field-media-image field--type-image field--label-hidden field__item\">  <img decoding=\"async\" src=\"https:\/\/www.cryptocabaret.com\/wp-content\/uploads\/2022\/05\/computer_desk_home_laptop_browser.png\" width=\"1040\" height=\"585\" alt=\"Digital images of a computer desktop\" title=\"Digital images of a computer desktop\" loading=\"lazy\"><\/div>\n<div class=\"field field--name-field-caption field--type-text-long field--label-hidden caption field__item\"><span class=\"caption__byline\">Image by: <\/span><\/p>\n<p>Opensource.com<\/p>\n<\/div>\n<\/article>\n<\/div>\n<div class=\"field field--name-field-tags field--type-entity-reference field--label-hidden field__items\">\n<div class=\"field__item\"><a href=\"https:\/\/opensource.com\/tags\/automation\" hreflang=\"en\">Automation<\/a><\/div>\n<div class=\"field__item\"><a href=\"https:\/\/opensource.com\/tags\/home-automation\" hreflang=\"en\">Home automation<\/a><\/div>\n<\/p><\/div>\n<div class=\"hidden field field--name-field-listicle-title field--type-string field--label-hidden field__item\">What to read next<\/div>\n<div class=\"field field--name-field-default-license field--type-list-string field--label-hidden field__item\"><a rel=\"license\" href=\"http:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/\"><br \/>\n        <img decoding=\"async\" alt=\"Creative Commons License\" src=\"https:\/\/www.cryptocabaret.com\/wp-content\/uploads\/2022\/05\/cc-by-sa--40.png\" title=\"This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License.\"><\/a>This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License.<\/div>\n<section class=\"field field--name-field-comments field--type-comment field--label-hidden comment-wrapper\">\n<div class=\"comments__count\">\n<div class=\"login\"><a href=\"https:\/\/opensource.com\/user\/register?absolute=1\">Register<\/a> or <a href=\"https:\/\/opensource.com\/user\/login?current=\/rss.xml&amp;absolute=1\">Login<\/a> to post a comment.<\/div>\n<\/p><\/div>\n<\/section>\n<p class=\"wpematico_credit\"><small>Powered by <a href=\"http:\/\/www.wpematico.com\" target=\"_blank\" rel=\"noopener\">WPeMatico<\/a><\/small><\/p>\n","protected":false},"excerpt":{"rendered":"<p>How I automate plant care using Raspberry Pi and open source tools Kevin Sonney Sat, 05\/28\/2022 &#8211; 03:00 Register or Login to like Register or Login to like Automation is a hot topic right now. In my day job as an SRE part of my remit is to automate as many repeating tasks as possible. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":64677,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[307],"tags":[],"class_list":["post-64676","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-open-source"],"_links":{"self":[{"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=\/wp\/v2\/posts\/64676","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=64676"}],"version-history":[{"count":0,"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=\/wp\/v2\/posts\/64676\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=\/wp\/v2\/media\/64677"}],"wp:attachment":[{"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=64676"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=64676"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=64676"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}