{"id":251,"date":"2017-12-19T08:00:36","date_gmt":"2017-12-19T16:00:36","guid":{"rendered":"http:\/\/www.diyfuturism.com\/?p=251"},"modified":"2017-12-19T17:46:03","modified_gmt":"2017-12-20T01:46:03","slug":"home-assistant-making-plant-sensors-talk","status":"publish","type":"post","link":"https:\/\/diyfuturism.com\/index.php\/2017\/12\/19\/home-assistant-making-plant-sensors-talk\/","title":{"rendered":"Home Assistant: Making My Plants Talk with IoT Sensors and a Python Script"},"content":{"rendered":"<p>Living in an urban city without a garden, I have been exercising my green thumb by accumulating more and more houseplants. I have them tucked away in every light-filled corner, hanging from every rafter in my tall ceilings. Which is a problem, because I have to get a ladder out to water most of them!<\/p>\n<p>Using some cheap <a href=\"http:\/\/amzn.to\/2BGhegH\" target=\"_blank\" rel=\"noopener\">plant soil sensors<\/a>\u00a0and a simple Python script, I will have Home Assistant check all of my plants and make a list of which need my attention. Then when more than a few need to be watered, I can be notified or have the voice assistant give me an update.<\/p>\n<p><!--more--><\/p>\n<p><script type=\"text\/javascript\">\namzn_assoc_placement = \"adunit0\";\namzn_assoc_tracking_id = \"diyfuturism-20\";\namzn_assoc_ad_mode = \"manual\";\namzn_assoc_ad_type = \"smart\";\namzn_assoc_marketplace = \"amazon\";\namzn_assoc_region = \"US\";\namzn_assoc_linkid = \"eb500c27d710f78cdb841b48ee001ade\";\namzn_assoc_design = \"in_content\";\namzn_assoc_asins = \"B074TY93JM,B01N3P763C,B01NCI629O,B01N9BA0O4,B01DLG4NZC\";\namzn_assoc_title = \"Plant Sensors\";\n<\/script><br \/>\n<script src=\"\/\/z-na.amazon-adsystem.com\/widgets\/onejs?MarketPlace=US\"><\/script><\/p>\n<h2>HARDWARE<\/h2>\n<p>You could use the <a href=\"http:\/\/amzn.to\/2BGhegH\">Xiaomi plant sensors<\/a> I&#8217;ve linked here, they occasionally go on sale on <a href=\"http:\/\/aliexpress.com\" target=\"_blank\" rel=\"noopener\">aliexpress.com<\/a>. A cheaper option would be to build them yourself (no soldering required) with an esp8266 board. Here&#8217;s a shopping list, you don&#8217;t need all the sensors but these are the sensors supported by the <a href=\"https:\/\/home-assistant.io\/components\/plant\/\" target=\"_blank\" rel=\"noopener\">plant platform<\/a>.<\/p>\n<ul>\n<li><a href=\"http:\/\/amzn.to\/2AV167j\" target=\"_blank\" rel=\"noopener\">Wemos D1 Mini<\/a><\/li>\n<li><a href=\"http:\/\/amzn.to\/2BvjDbN\" target=\"_blank\" rel=\"noopener\">Dupont Cables<\/a>\u00a0if you don&#8217;t want to solder<\/li>\n<li><a href=\"http:\/\/amzn.to\/2CZ5i7Q\" target=\"_blank\" rel=\"noopener\">DHT22<\/a>\u00a0temperature \/ humidity sensor<\/li>\n<li><a href=\"http:\/\/amzn.to\/2CABjly\" target=\"_blank\" rel=\"noopener\">Moisture Sensor<\/a>\u00a0analog output<\/li>\n<li><a href=\"http:\/\/amzn.to\/2BwDN5a\" target=\"_blank\" rel=\"noopener\">BH1750<\/a>\u00a0Digital light level sensor<\/li>\n<\/ul>\n<p>Building this is beyond this post, but it is fairly simple. Flash the Wemos D1 Mini with <a href=\"https:\/\/www.letscontrolit.com\/wiki\/index.php\/ESPEasy\" target=\"_blank\" rel=\"noopener\">ESP Easy<\/a> firmware, hook up the sensors, and configure them in the ESP Easy web menu to publish to MQTT. Home Assistant can then create sensors via the\u00a0<a href=\"https:\/\/home-assistant.io\/components\/sensor.mqtt\/\" target=\"_blank\" rel=\"noopener\">MQTT Sensor<\/a> platform.<\/p>\n<p>(Also if anyone knows of a DIY conductivity sensor, please comment, as I&#8217;m not aware of one).<\/p>\n<h2>PLANTS IN HASS<\/h2>\n<p>The <a href=\"https:\/\/home-assistant.io\/components\/plant\/\" target=\"_blank\" rel=\"noopener\">plant platform<\/a> allows us to combine these sensors into one plant entity &amp; set thresholds for alerts for that plant. Here is an example YAML config<\/p>\n<h3>plants.yaml<\/h3>\n<pre>  giant_pothos:\r\n    sensors:\r\n      moisture: sensor.giant_pothos_moisture\r\n      battery: sensor.giant_pothos_battery\r\n      temperature: sensor.giant_pothos_temperature\r\n      conductivity: sensor.giant_pothos_conductivity\r\n      brightness: sensor.giant_pothos_light_intensity\r\n    min_moisture: 10\r\n    max_moisture: 100\r\n    min_battery: 15\r\n    min_conductivity: 200\r\n    min_temperature: 45<\/pre>\n<p>And here&#8217;s the resulting plant entity in the Home Assistant UI<\/p>\n<div id=\"attachment_258\" style=\"width: 384px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-258\" data-attachment-id=\"258\" data-permalink=\"https:\/\/diyfuturism.com\/index.php\/2017\/12\/19\/home-assistant-making-plant-sensors-talk\/screenshot-from-2017-12-18-140005\/\" data-orig-file=\"https:\/\/i0.wp.com\/diyfuturism.com\/wp-content\/uploads\/2017\/12\/Screenshot-from-2017-12-18-140005.png?fit=374%2C355&amp;ssl=1\" data-orig-size=\"374,355\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot from 2017-12-18 14:00:05\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/diyfuturism.com\/wp-content\/uploads\/2017\/12\/Screenshot-from-2017-12-18-140005.png?fit=300%2C285&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/diyfuturism.com\/wp-content\/uploads\/2017\/12\/Screenshot-from-2017-12-18-140005.png?fit=374%2C355&amp;ssl=1\" loading=\"lazy\" class=\"wp-image-258 size-full\" src=\"https:\/\/i0.wp.com\/www.diyfuturism.com\/wp-content\/uploads\/2017\/12\/Screenshot-from-2017-12-18-140005.png?resize=374%2C355\" alt=\"Plant Entity\" width=\"374\" height=\"355\" srcset=\"https:\/\/i0.wp.com\/diyfuturism.com\/wp-content\/uploads\/2017\/12\/Screenshot-from-2017-12-18-140005.png?w=374&amp;ssl=1 374w, https:\/\/i0.wp.com\/diyfuturism.com\/wp-content\/uploads\/2017\/12\/Screenshot-from-2017-12-18-140005.png?resize=300%2C285&amp;ssl=1 300w\" sizes=\"(max-width: 374px) 100vw, 374px\" data-recalc-dims=\"1\" \/><p id=\"caption-attachment-258\" class=\"wp-caption-text\">A plant entity in Home Assistant UI<\/p><\/div>\n<p>This is wonderful, but I bought a dozen of these Xiaomi sensors when they were on sale. Wouldn&#8217;t it be great if, once I&#8217;m up on the ladder with a watering can, I could yell out to Alexa to list off which ones need it?<\/p>\n<p><script type=\"text\/javascript\">\namzn_assoc_placement = \"adunit0\";\namzn_assoc_tracking_id = \"diyfuturism-20\";\namzn_assoc_ad_mode = \"manual\";\namzn_assoc_ad_type = \"smart\";\namzn_assoc_marketplace = \"amazon\";\namzn_assoc_region = \"US\";\namzn_assoc_linkid = \"eb500c27d710f78cdb841b48ee001ade\";\namzn_assoc_design = \"in_content\";\namzn_assoc_asins = \"B01NCI629O,B01N9BA0O4,B01DLG4NZC\";\namzn_assoc_title = \"Plant Sensors\";\n<\/script><br \/>\n<script src=\"\/\/z-na.amazon-adsystem.com\/widgets\/onejs?MarketPlace=US\"><\/script><\/p>\n<h2>PYTHON SCRIPT<\/h2>\n<p>This script uses the <a href=\"https:\/\/home-assistant.io\/components\/python_script\/\" target=\"_blank\" rel=\"noopener\">python script<\/a> platform in Home Assistant. I&#8217;m going to trigger it anytime my plants update their status, like so:<\/p>\n<h3>automations.yaml<\/h3>\n<pre>- alias: 'Update Plant Problems'\r\n  trigger:\r\n    - platform: state\r\n      entity_id: plant.giant_philodendron, plant.giant_pothos, plant.hanging_red_pothos, plant.hanging_spider_plant, plant.kitchen_pothos, plant.palm, plant.projector_pothos, plant.rubber_plant, plant.small_philodendron, plant.window_spider_plant\r\n  action:\r\n    - service: python_script.plant_problems<\/pre>\n<p>And now for the script itself. It&#8217;s going to create 3 new entities:<\/p>\n<ul>\n<li>sensor.water_plants_number<\/li>\n<li>sensor.fertilize_plants_number<\/li>\n<li>sensor.problem_plants<\/li>\n<\/ul>\n<p>The last one will contain a number of attributes that will be useful for automations, including lists in human readable form.<\/p>\n<h3>python_scripts\/plant_problems.py<\/h3>\n<pre>Pastebin link: <a href=\"https:\/\/pastebin.com\/yCbbJ6uA\" target=\"_blank\" rel=\"noopener\">https:\/\/pastebin.com\/yCbbJ6uA<\/a><\/pre>\n<p>And here you have it:<\/p>\n<div id=\"attachment_259\" style=\"width: 360px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-259\" data-attachment-id=\"259\" data-permalink=\"https:\/\/diyfuturism.com\/index.php\/2017\/12\/19\/home-assistant-making-plant-sensors-talk\/9d3f65ed5dee838d428f03e870339ac0f6a0260f\/\" data-orig-file=\"https:\/\/i2.wp.com\/diyfuturism.com\/wp-content\/uploads\/2017\/12\/9d3f65ed5dee838d428f03e870339ac0f6a0260f.png?fit=720%2C1004&amp;ssl=1\" data-orig-size=\"720,1004\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"9d3f65ed5dee838d428f03e870339ac0f6a0260f\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i2.wp.com\/diyfuturism.com\/wp-content\/uploads\/2017\/12\/9d3f65ed5dee838d428f03e870339ac0f6a0260f.png?fit=215%2C300&amp;ssl=1\" data-large-file=\"https:\/\/i2.wp.com\/diyfuturism.com\/wp-content\/uploads\/2017\/12\/9d3f65ed5dee838d428f03e870339ac0f6a0260f.png?fit=720%2C1004&amp;ssl=1\" loading=\"lazy\" class=\"wp-image-259\" src=\"https:\/\/i2.wp.com\/www.diyfuturism.com\/wp-content\/uploads\/2017\/12\/9d3f65ed5dee838d428f03e870339ac0f6a0260f-215x300.png?resize=350%2C488\" alt=\"The new sensor.problem_plants in the UI\" width=\"350\" height=\"488\" srcset=\"https:\/\/i2.wp.com\/diyfuturism.com\/wp-content\/uploads\/2017\/12\/9d3f65ed5dee838d428f03e870339ac0f6a0260f.png?resize=215%2C300&amp;ssl=1 215w, https:\/\/i2.wp.com\/diyfuturism.com\/wp-content\/uploads\/2017\/12\/9d3f65ed5dee838d428f03e870339ac0f6a0260f.png?resize=600%2C837&amp;ssl=1 600w, https:\/\/i2.wp.com\/diyfuturism.com\/wp-content\/uploads\/2017\/12\/9d3f65ed5dee838d428f03e870339ac0f6a0260f.png?w=720&amp;ssl=1 720w\" sizes=\"(max-width: 350px) 100vw, 350px\" data-recalc-dims=\"1\" \/><p id=\"caption-attachment-259\" class=\"wp-caption-text\">The new sensor.problem_plants in the UI has a number of useful attributes.<\/p><\/div>\n<h2>TALK TO ME, PLANTS<\/h2>\n<p>This is a Home Assistant script, you will need to have a <a href=\"https:\/\/home-assistant.io\/components\/#text-to-speech\" target=\"_blank\" rel=\"noopener\">text-to-speech platform<\/a> configured.<\/p>\n<h3>scripts.yaml<\/h3>\n<pre>tts_plant_info:\r\n  alias: Announce Plant Info\r\n  sequence:\r\n    - service: tts.amazon_polly_say\r\n      data_template:\r\n        entity_id: media_player.vlc_tts\r\n        message: &gt;\r\n          {% if is_state_attr('sensor.plant_problems','water_number',0) %}\r\n          No plants need watering.\r\n          {% elif states.sensor.plant_problems.attributes.water_number | float &gt; 0 %}\r\n          {{states.sensor.plant_problems.attributes.water}} need to be watered.\r\n          {% endif %}\r\n          {% if is_state_attr('sensor.plant_problems','fertilize_number',0) %}\r\n          No plants need fertilizer.\r\n          {% elif states.sensor.plant_problems.attributes.fertilize_number | float &gt; 0 %}\r\n          These plants {{states.sensor.plant_problems.attributes.fertilize}} need fertilizing.\r\n          {% endif %}\r\n<\/pre>\n<p>And now your plants talk to you. Welcome to the future. I have added some additional functionality to my set up with Node-Red: Mine also tweet to the world when I&#8217;ve ignored them too long. Follow at <a href=\"https:\/\/twitter.com\/diyfuturism\" target=\"_blank\" rel=\"noopener\">@diyfuturism<\/a>.<\/p>\n<p><script type=\"text\/javascript\">\namzn_assoc_placement = \"adunit0\";\namzn_assoc_tracking_id = \"diyfuturism-20\";\namzn_assoc_ad_mode = \"manual\";\namzn_assoc_ad_type = \"smart\";\namzn_assoc_marketplace = \"amazon\";\namzn_assoc_region = \"US\";\namzn_assoc_linkid = \"eb500c27d710f78cdb841b48ee001ade\";\namzn_assoc_design = \"in_content\";\namzn_assoc_asins = \"B074TY93JM,B01N3P763C,B01NCI629O,B01N9BA0O4,B01DLG4NZC\";\namzn_assoc_title = \"Plant Sensors\";\n<\/script><br \/>\n<script src=\"\/\/z-na.amazon-adsystem.com\/widgets\/onejs?MarketPlace=US\"><\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"wpm_excerpt clearfix\"><p>Living in an urban city without a garden, I have been exercising my green thumb by accumulating more and more houseplants. I have them tucked away &hellip;<\/p>\n<\/div>","protected":false},"author":1,"featured_media":256,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"Making my house plants talk with @Home_Assistant! Fun project with cheap sensors. #homeassistant #smarthome #homeautomation #python #iot","jetpack_is_tweetstorm":false},"categories":[8,6,7,88,3,9],"tags":[101,47,111,109,110,28,97,31,104,106,107,105,93,59,25,112,108,39],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v16.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Home Assistant: Making My Plants Talk with IoT Sensors and a Python Script - DIY Futurism<\/title>\n<meta name=\"description\" content=\"Using Internet-of-Things sensors to make my plants talk to me with Home Assistant and a Python script.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/diyfuturism.com\/index.php\/2017\/12\/19\/home-assistant-making-plant-sensors-talk\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Home Assistant: Making My Plants Talk with IoT Sensors and a Python Script - DIY Futurism\" \/>\n<meta property=\"og:description\" content=\"Using Internet-of-Things sensors to make my plants talk to me with Home Assistant and a Python script.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/diyfuturism.com\/index.php\/2017\/12\/19\/home-assistant-making-plant-sensors-talk\/\" \/>\n<meta property=\"og:site_name\" content=\"DIY Futurism\" \/>\n<meta property=\"article:published_time\" content=\"2017-12-19T16:00:36+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-12-20T01:46:03+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i2.wp.com\/diyfuturism.com\/wp-content\/uploads\/2017\/12\/33644078760_c2187a3974_o.jpg?fit=1080%2C1080&#038;ssl=1\" \/>\n\t<meta property=\"og:image:width\" content=\"1080\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@diyfuturism\" \/>\n<meta name=\"twitter:site\" content=\"@diyfuturism\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"brad\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/diyfuturism.com\/#website\",\"url\":\"https:\/\/diyfuturism.com\/\",\"name\":\"DIY Futurism\",\"description\":\"Adventures in Open Source Smart Home Projects\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/diyfuturism.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/diyfuturism.com\/index.php\/2017\/12\/19\/home-assistant-making-plant-sensors-talk\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/i2.wp.com\/diyfuturism.com\/wp-content\/uploads\/2017\/12\/33644078760_c2187a3974_o.jpg?fit=1080%2C1080&ssl=1\",\"contentUrl\":\"https:\/\/i2.wp.com\/diyfuturism.com\/wp-content\/uploads\/2017\/12\/33644078760_c2187a3974_o.jpg?fit=1080%2C1080&ssl=1\",\"width\":1080,\"height\":1080},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/diyfuturism.com\/index.php\/2017\/12\/19\/home-assistant-making-plant-sensors-talk\/#webpage\",\"url\":\"https:\/\/diyfuturism.com\/index.php\/2017\/12\/19\/home-assistant-making-plant-sensors-talk\/\",\"name\":\"Home Assistant: Making My Plants Talk with IoT Sensors and a Python Script - DIY Futurism\",\"isPartOf\":{\"@id\":\"https:\/\/diyfuturism.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/diyfuturism.com\/index.php\/2017\/12\/19\/home-assistant-making-plant-sensors-talk\/#primaryimage\"},\"datePublished\":\"2017-12-19T16:00:36+00:00\",\"dateModified\":\"2017-12-20T01:46:03+00:00\",\"author\":{\"@id\":\"https:\/\/diyfuturism.com\/#\/schema\/person\/b93619fac07567640bd87cc613a55b7c\"},\"description\":\"Using Internet-of-Things sensors to make my plants talk to me with Home Assistant and a Python script.\",\"breadcrumb\":{\"@id\":\"https:\/\/diyfuturism.com\/index.php\/2017\/12\/19\/home-assistant-making-plant-sensors-talk\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/diyfuturism.com\/index.php\/2017\/12\/19\/home-assistant-making-plant-sensors-talk\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/diyfuturism.com\/index.php\/2017\/12\/19\/home-assistant-making-plant-sensors-talk\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/diyfuturism.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Home Assistant: Making My Plants Talk with IoT Sensors and a Python Script\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/diyfuturism.com\/#\/schema\/person\/b93619fac07567640bd87cc613a55b7c\",\"name\":\"brad\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/diyfuturism.com\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/7e2d60eb1f322b4ad6040a746946a361?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/7e2d60eb1f322b4ad6040a746946a361?s=96&d=mm&r=g\",\"caption\":\"brad\"},\"description\":\"I'm a professional artist who likes to tinker with building things in my spare time.\",\"sameAs\":[\"https:\/\/twitter.com\/@diyfuturism\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Home Assistant: Making My Plants Talk with IoT Sensors and a Python Script - DIY Futurism","description":"Using Internet-of-Things sensors to make my plants talk to me with Home Assistant and a Python script.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/diyfuturism.com\/index.php\/2017\/12\/19\/home-assistant-making-plant-sensors-talk\/","og_locale":"en_US","og_type":"article","og_title":"Home Assistant: Making My Plants Talk with IoT Sensors and a Python Script - DIY Futurism","og_description":"Using Internet-of-Things sensors to make my plants talk to me with Home Assistant and a Python script.","og_url":"https:\/\/diyfuturism.com\/index.php\/2017\/12\/19\/home-assistant-making-plant-sensors-talk\/","og_site_name":"DIY Futurism","article_published_time":"2017-12-19T16:00:36+00:00","article_modified_time":"2017-12-20T01:46:03+00:00","og_image":[{"width":1080,"height":1080,"url":"https:\/\/i2.wp.com\/diyfuturism.com\/wp-content\/uploads\/2017\/12\/33644078760_c2187a3974_o.jpg?fit=1080%2C1080&ssl=1","path":"\/var\/www\/html\/wp-content\/uploads\/2017\/12\/33644078760_c2187a3974_o.jpg","size":"full","id":256,"alt":"","pixels":1166400,"type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_creator":"@diyfuturism","twitter_site":"@diyfuturism","twitter_misc":{"Written by":"brad","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/diyfuturism.com\/#website","url":"https:\/\/diyfuturism.com\/","name":"DIY Futurism","description":"Adventures in Open Source Smart Home Projects","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/diyfuturism.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","@id":"https:\/\/diyfuturism.com\/index.php\/2017\/12\/19\/home-assistant-making-plant-sensors-talk\/#primaryimage","inLanguage":"en-US","url":"https:\/\/i2.wp.com\/diyfuturism.com\/wp-content\/uploads\/2017\/12\/33644078760_c2187a3974_o.jpg?fit=1080%2C1080&ssl=1","contentUrl":"https:\/\/i2.wp.com\/diyfuturism.com\/wp-content\/uploads\/2017\/12\/33644078760_c2187a3974_o.jpg?fit=1080%2C1080&ssl=1","width":1080,"height":1080},{"@type":"WebPage","@id":"https:\/\/diyfuturism.com\/index.php\/2017\/12\/19\/home-assistant-making-plant-sensors-talk\/#webpage","url":"https:\/\/diyfuturism.com\/index.php\/2017\/12\/19\/home-assistant-making-plant-sensors-talk\/","name":"Home Assistant: Making My Plants Talk with IoT Sensors and a Python Script - DIY Futurism","isPartOf":{"@id":"https:\/\/diyfuturism.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/diyfuturism.com\/index.php\/2017\/12\/19\/home-assistant-making-plant-sensors-talk\/#primaryimage"},"datePublished":"2017-12-19T16:00:36+00:00","dateModified":"2017-12-20T01:46:03+00:00","author":{"@id":"https:\/\/diyfuturism.com\/#\/schema\/person\/b93619fac07567640bd87cc613a55b7c"},"description":"Using Internet-of-Things sensors to make my plants talk to me with Home Assistant and a Python script.","breadcrumb":{"@id":"https:\/\/diyfuturism.com\/index.php\/2017\/12\/19\/home-assistant-making-plant-sensors-talk\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/diyfuturism.com\/index.php\/2017\/12\/19\/home-assistant-making-plant-sensors-talk\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/diyfuturism.com\/index.php\/2017\/12\/19\/home-assistant-making-plant-sensors-talk\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/diyfuturism.com\/"},{"@type":"ListItem","position":2,"name":"Home Assistant: Making My Plants Talk with IoT Sensors and a Python Script"}]},{"@type":"Person","@id":"https:\/\/diyfuturism.com\/#\/schema\/person\/b93619fac07567640bd87cc613a55b7c","name":"brad","image":{"@type":"ImageObject","@id":"https:\/\/diyfuturism.com\/#personlogo","inLanguage":"en-US","url":"https:\/\/secure.gravatar.com\/avatar\/7e2d60eb1f322b4ad6040a746946a361?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/7e2d60eb1f322b4ad6040a746946a361?s=96&d=mm&r=g","caption":"brad"},"description":"I'm a professional artist who likes to tinker with building things in my spare time.","sameAs":["https:\/\/twitter.com\/@diyfuturism"]}]}},"jetpack_featured_media_url":"https:\/\/i2.wp.com\/diyfuturism.com\/wp-content\/uploads\/2017\/12\/33644078760_c2187a3974_o.jpg?fit=1080%2C1080&ssl=1","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9q0Cl-43","jetpack-related-posts":[{"id":215,"url":"https:\/\/diyfuturism.com\/index.php\/2017\/12\/15\/useful-sensor-motion-last-seen-________\/","url_meta":{"origin":251,"position":0},"title":"Useful Sensor: Motion Last Seen &#038; Meta Motion Sensor","date":"December 15, 2017","format":false,"excerpt":"\u00a0 You know what's great about motion sensors? They are very, very cheap to build yourself. All it takes is an esp8266 module like the Wemos D1 Mini, some PIR sensors, and the ESP Easy firmware and you can have a bunch up and running in a few minutes. I\u00a0haven't\u2026","rel":"","context":"In &quot;Config&quot;","img":{"alt_text":"Motion Last Seen","src":"https:\/\/i0.wp.com\/diyfuturism.com\/wp-content\/uploads\/2017\/12\/Screen-Shot-2017-12-15-at-8.19.16-PM.png?fit=475%2C270&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":231,"url":"https:\/\/diyfuturism.com\/index.php\/2018\/01\/13\/useful-sensor-wind-direction-home-assistant\/","url_meta":{"origin":251,"position":1},"title":"Useful Sensor: Cardinal Wind Direction for Home Assistant","date":"January 13, 2018","format":false,"excerpt":"As someone who cycles to work most days, I keep a pretty close eye on the weather. One thing I like to know is which way the wind is blowing - a strong headwind means I should maybe opt for the road bike, not the cruiser. Home Assistant\u00a0has a ton\u2026","rel":"","context":"In &quot;Config&quot;","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/diyfuturism.com\/wp-content\/uploads\/2017\/12\/Screenshot-from-2017-12-17-141437.png?fit=1200%2C680&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":141,"url":"https:\/\/diyfuturism.com\/index.php\/2017\/11\/28\/config-setting-up-the-xiaomi-mi-robot-vacuum-in-home-assistant\/","url_meta":{"origin":251,"position":2},"title":"Config: Setting up the Xiaomi Mi Robot Vacuum in Home Assistant","date":"November 28, 2017","format":false,"excerpt":"I have a dog who sheds like crazy, and the only thing that keeps the dust bunnies from overrunning me is a robot vacuum. My aging Neato Botvac, after fulfilling several years of hard labor, ate it's 3rd expensive replacement battery recently. This was obviously a great excuse to get\u2026","rel":"","context":"In &quot;Config&quot;","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/diyfuturism.com\/wp-content\/uploads\/2017\/11\/006mZuRsgw1f7cwam8h4kj31hc0u0te9.jpg?fit=1200%2C675&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":14,"url":"https:\/\/diyfuturism.com\/index.php\/2017\/11\/20\/my-smart-home-hardware-list\/","url_meta":{"origin":251,"position":3},"title":"My Smart Home: Hardware List","date":"November 20, 2017","format":false,"excerpt":"An ongoing list of all the hardware I've gradually acquired. Links are to Amazon, but if you are patient most things can be imported from China for much cheaper. Want to get started in home automation for cheap?\u00a0Check out my\u00a0$200 DIY Smart Home Shopping List to get started with a\u2026","rel":"","context":"In &quot;Hardware&quot;","img":{"alt_text":"","src":"https:\/\/i1.wp.com\/diyfuturism.com\/wp-content\/uploads\/2017\/11\/Screen-Shot-2017-11-27-at-3.21.16-PM.png?fit=1200%2C694&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":237,"url":"https:\/\/diyfuturism.com\/index.php\/2017\/12\/29\/useful-sensor-bayesian-sleep-detection-in-home-assistant\/","url_meta":{"origin":251,"position":4},"title":"Useful Sensor: Bayesian Sleep Detection in Home Assistant","date":"December 29, 2017","format":false,"excerpt":"Sleep is not something I can directly observe in my smart home (at least not until I build that\u00a0DIY bed sensor). It would be nice to know though - then the alarm could be set, doors locked, thermostat set, music volume slowly dimmed, and internet bandwidth reprioritized automatically when it's\u2026","rel":"","context":"In &quot;Config&quot;","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/diyfuturism.com\/wp-content\/uploads\/2017\/12\/7770002228_c509b98d47_k.jpg?fit=1200%2C808&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":34,"url":"https:\/\/diyfuturism.com\/index.php\/2017\/11\/26\/presence-detection-with-home-assistant-bayesian-probability\/","url_meta":{"origin":251,"position":5},"title":"Presence Detection Part 1: Home Assistant &#038; Bayesian Probability","date":"November 26, 2017","format":false,"excerpt":"One of the most useful things to track for home automation is whether anyone is home or not. If you want the lights to turn off when no one is home, the vacuum robot to run when you're at work, or the heat to come on before you arrive home\u2026","rel":"","context":"In &quot;Config&quot;","img":{"alt_text":"","src":"https:\/\/i2.wp.com\/www.diyfuturism.com\/wp-content\/uploads\/2017\/11\/Screen-Shot-2017-11-25-at-8.31.52-PM.png?resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/diyfuturism.com\/index.php\/wp-json\/wp\/v2\/posts\/251"}],"collection":[{"href":"https:\/\/diyfuturism.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/diyfuturism.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/diyfuturism.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/diyfuturism.com\/index.php\/wp-json\/wp\/v2\/comments?post=251"}],"version-history":[{"count":7,"href":"https:\/\/diyfuturism.com\/index.php\/wp-json\/wp\/v2\/posts\/251\/revisions"}],"predecessor-version":[{"id":302,"href":"https:\/\/diyfuturism.com\/index.php\/wp-json\/wp\/v2\/posts\/251\/revisions\/302"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/diyfuturism.com\/index.php\/wp-json\/wp\/v2\/media\/256"}],"wp:attachment":[{"href":"https:\/\/diyfuturism.com\/index.php\/wp-json\/wp\/v2\/media?parent=251"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/diyfuturism.com\/index.php\/wp-json\/wp\/v2\/categories?post=251"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/diyfuturism.com\/index.php\/wp-json\/wp\/v2\/tags?post=251"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}