{"id":34,"date":"2017-11-26T06:38:05","date_gmt":"2017-11-26T06:38:05","guid":{"rendered":"http:\/\/www.diyfuturism.com\/?p=34"},"modified":"2017-12-18T16:47:20","modified_gmt":"2017-12-19T00:47:20","slug":"presence-detection-with-home-assistant-bayesian-probability","status":"publish","type":"post","link":"https:\/\/diyfuturism.com\/index.php\/2017\/11\/26\/presence-detection-with-home-assistant-bayesian-probability\/","title":{"rendered":"Presence Detection Part 1: Home Assistant &#038; Bayesian Probability"},"content":{"rendered":"<p>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&#8217;re at work, or the heat to come on before you arrive home on a cold night you need to reliably be able to tell if the house is occupied.<\/p>\n<p>How can we track the state of something that is not directly observable? We can&#8217;t plug ourselves directly into the internet (&#8230;yet). After trying several approaches to monitoring presence, I&#8217;ve come up with a method that is very near 100% reliable.<\/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 = \"4ae5c1e47662223e8161b5b21502aa65\";\namzn_assoc_design = \"in_content\";\namzn_assoc_asins = \"B01L3VEC08,B01I57KL7G,B00JJ4P864,B01MXYLQ8C\";\namzn_assoc_title = \"Improve Presence with Beacons\";\n<\/script><br \/>\n<script src=\"\/\/z-na.amazon-adsystem.com\/widgets\/onejs?MarketPlace=US\"><\/script><\/p>\n<h3>STEP ONE:\u00a0 Multiple Device Trackers<\/h3>\n<p>Take a look through the <a href=\"https:\/\/home-assistant.io\/components\/device_tracker\/\">list of device tracking platforms<\/a> supported by Home Assistant, there are quite a few. In my experience, no one platform will\u00a0<em>always<\/em> be correct. What works best is to add multiple trackers for each person, and then use the <a href=\"https:\/\/home-assistant.io\/components\/binary_sensor.bayesian\/\">Bayesian sensor<\/a> to look at all of them and determine if the person being tracked is home or not.<\/p>\n<p>I am tracking myself using:<\/p>\n<ul>\n<li><a href=\"https:\/\/home-assistant.io\/components\/binary_sensor.ping\/\">ping<\/a> &#8211; My phone has a static IP on my wifi, so a simple ping tells whether I&#8217;m connected or not<\/li>\n<li><a href=\"https:\/\/home-assistant.io\/components\/device_tracker.owntracks\/\">Owntracks<\/a>\u00a0&#8211; This has been the most reliable GPS platform for me. It also supports bluetooth iBeacons.<\/li>\n<li>Hass iOS &#8211; The Home Assistant iOS app does location tracking as well as iBeacons.<\/li>\n<li><a href=\"https:\/\/home-assistant.io\/components\/device_tracker.tile\/\">Tile<\/a> &#8211; The Tile app tracks my phone and a beacon attached to my keys.<\/li>\n<li><a href=\"http:\/\/www.diyfuturism.com\/index.php\/2017\/11\/27\/useful-sensor-improving-presence-detection-with-node-red\/\">Node-Red<\/a>\u00a0&#8211; A custom GPS tracker using Node-Red, <a href=\"http:\/\/www.diyfuturism.com\/index.php\/2017\/11\/27\/useful-sensor-improving-presence-detection-with-node-red\/\">see blog post<\/a><\/li>\n<\/ul>\n<div id=\"attachment_36\" style=\"width: 704px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-36\" data-attachment-id=\"36\" data-permalink=\"https:\/\/diyfuturism.com\/index.php\/2017\/11\/26\/presence-detection-with-home-assistant-bayesian-probability\/screen-shot-2017-11-25-at-8-31-52-pm\/\" data-orig-file=\"https:\/\/i2.wp.com\/diyfuturism.com\/wp-content\/uploads\/2017\/11\/Screen-Shot-2017-11-25-at-8.31.52-PM.png?fit=694%2C250&amp;ssl=1\" data-orig-size=\"694,250\" 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=\"Screen Shot 2017-11-25 at 8.31.52 PM\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i2.wp.com\/diyfuturism.com\/wp-content\/uploads\/2017\/11\/Screen-Shot-2017-11-25-at-8.31.52-PM.png?fit=300%2C108&amp;ssl=1\" data-large-file=\"https:\/\/i2.wp.com\/diyfuturism.com\/wp-content\/uploads\/2017\/11\/Screen-Shot-2017-11-25-at-8.31.52-PM.png?fit=694%2C250&amp;ssl=1\" loading=\"lazy\" class=\"wp-image-36 size-full\" 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=694%2C250\" alt=\"\" width=\"694\" height=\"250\" srcset=\"https:\/\/i2.wp.com\/diyfuturism.com\/wp-content\/uploads\/2017\/11\/Screen-Shot-2017-11-25-at-8.31.52-PM.png?w=694&amp;ssl=1 694w, https:\/\/i2.wp.com\/diyfuturism.com\/wp-content\/uploads\/2017\/11\/Screen-Shot-2017-11-25-at-8.31.52-PM.png?resize=600%2C216&amp;ssl=1 600w, https:\/\/i2.wp.com\/diyfuturism.com\/wp-content\/uploads\/2017\/11\/Screen-Shot-2017-11-25-at-8.31.52-PM.png?resize=300%2C108&amp;ssl=1 300w\" sizes=\"(max-width: 694px) 100vw, 694px\" data-recalc-dims=\"1\" \/><p id=\"caption-attachment-36\" class=\"wp-caption-text\">Multiple Trackers<\/p><\/div>\n<p>I do recommend adding some cheap iBeacons to your smart home hardware to increase the reliability of presence detection. An iBeacon is a simple Bluetooth transmitter that broadcasts it&#8217;s name to the world. When the Owntracks or Home Assistant apps see the beacon, it forces an update. This ensures your comings and goings are detected immediately.<\/p>\n<div id=\"amzn-assoc-ad-8ba45d28-72f3-4d97-89af-ef96de2a7468\"><\/div>\n<p><script async src=\"\/\/z-na.amazon-adsystem.com\/widgets\/onejs?MarketPlace=US&#038;adInstanceId=8ba45d28-72f3-4d97-89af-ef96de2a7468\"><\/script><\/p>\n<h3>STEP TWO: Bayesian Binary Sensor<\/h3>\n<p>The Bayesian sensor is really cool, even if I don&#8217;t fully understand the math behind it. It allows us to guess whether something is true or not based on multiple observations. In this case, we are going to guess the probability of whether I am home based on the states of multiple device trackers in Home Assistant. My YAML looks like this:<\/p>\n<pre>- platform: bayesian\r\n  prior: 0.5\r\n  name: 'Brad Presence'\r\n  probability_threshold: 0.9\r\n  observations:\r\n    - entity_id: 'device_tracker.brad_ping'\r\n      prob_given_true: 0.9\r\n      prob_given_false: 0.1\r\n      platform: 'state'\r\n      to_state: 'home'\r\n    - entity_id: 'device_tracker.brad_ios'\r\n      prob_given_true: 0.9\r\n      prob_given_false: 0.2\r\n      platform: 'state'\r\n      to_state: 'home'\r\n    - entity_id: 'device_tracker.brad_owntracks'\r\n      prob_given_true: 0.9\r\n      prob_given_false: 0.4\r\n      platform: 'state'\r\n      to_state: 'home'\r\n    - entity_id: 'device_tracker.brad_nodered'\r\n      prob_given_true: 0.8\r\n      prob_given_false: 0.2\r\n      platform: 'state'\r\n      to_state: 'home'\r\n    - entity_id: 'device_tracker.tile_keys'\r\n      prob_given_true: 0.8\r\n      prob_given_false: 0.4\r\n      platform: 'state'\r\n      to_state: 'home'<\/pre>\n<p><a href=\"https:\/\/pastebin.com\/JFehKRaE\">https:\/\/pastebin.com\/JFehKRaE<\/a><\/p>\n<p>Let&#8217;s break it down:<\/p>\n<ul>\n<li>&#8220;prior&#8221; Indicates the probability that this is true in a day &#8211; let&#8217;s say I&#8217;m home half the time, or 0.5<\/li>\n<li>&#8220;probability_threshold&#8221; How sure should it be to guess that I&#8217;m home? By setting the bar high at 90%, we are requiring more than one platform to be &#8216;home&#8217; before it will flip to on.<\/li>\n<\/ul>\n<p>Now we list our observations for each device_tracker entity:<\/p>\n<ul>\n<li>&#8220;prob_given_true&#8221; If I&#8217;m home, how likely is this state true? In other words, how reliable is that platform at marking me home?<\/li>\n<li>&#8220;prob_given_false&#8221; How likely is this platform to be wrong &#8211; for it to be &#8216;home&#8217; when I&#8217;m not home?<\/li>\n<\/ul>\n<p>I have to be physically present to be on the wifi for the &#8216;ping&#8217; platform, so that one is the highest probability. Owntracks and the iOS app are pretty accurate, but also occasionally wrong, so we&#8217;ll weight their prob_given_false higher.<\/p>\n<p>This may require some tinkering with the numbers in response to your individual setup, but the goal is to trigger the Bayesian to &#8216;on&#8217; when more than one platform is &#8216;home&#8217;.<\/p>\n<div id=\"attachment_39\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-39\" data-attachment-id=\"39\" data-permalink=\"https:\/\/diyfuturism.com\/index.php\/2017\/11\/26\/presence-detection-with-home-assistant-bayesian-probability\/screen-shot-2017-11-25-at-10-09-59-pm\/\" data-orig-file=\"https:\/\/i0.wp.com\/diyfuturism.com\/wp-content\/uploads\/2017\/11\/Screen-Shot-2017-11-25-at-10.09.59-PM.png?fit=720%2C606&amp;ssl=1\" data-orig-size=\"720,606\" 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=\"Screen Shot 2017-11-25 at 10.09.59 PM\" data-image-description=\"\" data-image-caption=\"&lt;p&gt;Observations and the calculated probability&lt;\/p&gt;\n\" data-medium-file=\"https:\/\/i0.wp.com\/diyfuturism.com\/wp-content\/uploads\/2017\/11\/Screen-Shot-2017-11-25-at-10.09.59-PM.png?fit=300%2C253&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/diyfuturism.com\/wp-content\/uploads\/2017\/11\/Screen-Shot-2017-11-25-at-10.09.59-PM.png?fit=720%2C606&amp;ssl=1\" loading=\"lazy\" class=\"size-medium wp-image-39\" src=\"https:\/\/i2.wp.com\/www.diyfuturism.com\/wp-content\/uploads\/2017\/11\/Screen-Shot-2017-11-25-at-10.09.59-PM-300x253.png?resize=300%2C253\" alt=\"\" width=\"300\" height=\"253\" srcset=\"https:\/\/i0.wp.com\/diyfuturism.com\/wp-content\/uploads\/2017\/11\/Screen-Shot-2017-11-25-at-10.09.59-PM.png?resize=300%2C253&amp;ssl=1 300w, https:\/\/i0.wp.com\/diyfuturism.com\/wp-content\/uploads\/2017\/11\/Screen-Shot-2017-11-25-at-10.09.59-PM.png?resize=600%2C505&amp;ssl=1 600w, https:\/\/i0.wp.com\/diyfuturism.com\/wp-content\/uploads\/2017\/11\/Screen-Shot-2017-11-25-at-10.09.59-PM.png?w=720&amp;ssl=1 720w\" sizes=\"(max-width: 300px) 100vw, 300px\" data-recalc-dims=\"1\" \/><p id=\"caption-attachment-39\" class=\"wp-caption-text\">Observations and the calculated probability<\/p><\/div>\n<h2>NEXT STEPS<\/h2>\n<p>Let&#8217;s convert this bayesian_sensor into a device_tracker in my next post, and create a new and better device_tracker to use as an additional data source.<\/p>\n<p><a href=\"http:\/\/www.diyfuturism.com\/index.php\/2017\/11\/27\/useful-sensor-improving-presence-detection-with-node-red\/\">Improving Presence Detection with Node-Red<\/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 = \"4ae5c1e47662223e8161b5b21502aa65\";\namzn_assoc_design = \"in_content\";\namzn_assoc_asins = \"B01L3VEC08,B01I57KL7G,B00JJ4P864,B01MXYLQ8C\";\namzn_assoc_title = \"Improve Presence with Beacons\";\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>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 &hellip;<\/p>\n<\/div>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false},"categories":[8,7,3,9],"tags":[47,60,61,36,31,54,44,59,25,50,58],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v16.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Presence Detection Part 1: Home Assistant &amp; Bayesian Probability - DIY Futurism<\/title>\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\/11\/26\/presence-detection-with-home-assistant-bayesian-probability\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Presence Detection Part 1: Home Assistant &amp; Bayesian Probability - DIY Futurism\" \/>\n<meta property=\"og:description\" content=\"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 &hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/diyfuturism.com\/index.php\/2017\/11\/26\/presence-detection-with-home-assistant-bayesian-probability\/\" \/>\n<meta property=\"og:site_name\" content=\"DIY Futurism\" \/>\n<meta property=\"article:published_time\" content=\"2017-11-26T06:38:05+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-12-19T00:47:20+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.diyfuturism.com\/wp-content\/uploads\/2017\/11\/Screen-Shot-2017-11-25-at-8.31.52-PM.png\" \/>\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\/11\/26\/presence-detection-with-home-assistant-bayesian-probability\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"http:\/\/www.diyfuturism.com\/wp-content\/uploads\/2017\/11\/Screen-Shot-2017-11-25-at-8.31.52-PM.png\",\"contentUrl\":\"http:\/\/www.diyfuturism.com\/wp-content\/uploads\/2017\/11\/Screen-Shot-2017-11-25-at-8.31.52-PM.png\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/diyfuturism.com\/index.php\/2017\/11\/26\/presence-detection-with-home-assistant-bayesian-probability\/#webpage\",\"url\":\"https:\/\/diyfuturism.com\/index.php\/2017\/11\/26\/presence-detection-with-home-assistant-bayesian-probability\/\",\"name\":\"Presence Detection Part 1: Home Assistant & Bayesian Probability - DIY Futurism\",\"isPartOf\":{\"@id\":\"https:\/\/diyfuturism.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/diyfuturism.com\/index.php\/2017\/11\/26\/presence-detection-with-home-assistant-bayesian-probability\/#primaryimage\"},\"datePublished\":\"2017-11-26T06:38:05+00:00\",\"dateModified\":\"2017-12-19T00:47:20+00:00\",\"author\":{\"@id\":\"https:\/\/diyfuturism.com\/#\/schema\/person\/b93619fac07567640bd87cc613a55b7c\"},\"breadcrumb\":{\"@id\":\"https:\/\/diyfuturism.com\/index.php\/2017\/11\/26\/presence-detection-with-home-assistant-bayesian-probability\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/diyfuturism.com\/index.php\/2017\/11\/26\/presence-detection-with-home-assistant-bayesian-probability\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/diyfuturism.com\/index.php\/2017\/11\/26\/presence-detection-with-home-assistant-bayesian-probability\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/diyfuturism.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Presence Detection Part 1: Home Assistant &#038; Bayesian Probability\"}]},{\"@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":"Presence Detection Part 1: Home Assistant & Bayesian Probability - DIY Futurism","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\/11\/26\/presence-detection-with-home-assistant-bayesian-probability\/","og_locale":"en_US","og_type":"article","og_title":"Presence Detection Part 1: Home Assistant & Bayesian Probability - DIY Futurism","og_description":"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 &hellip;","og_url":"https:\/\/diyfuturism.com\/index.php\/2017\/11\/26\/presence-detection-with-home-assistant-bayesian-probability\/","og_site_name":"DIY Futurism","article_published_time":"2017-11-26T06:38:05+00:00","article_modified_time":"2017-12-19T00:47:20+00:00","og_image":[{"url":"http:\/\/www.diyfuturism.com\/wp-content\/uploads\/2017\/11\/Screen-Shot-2017-11-25-at-8.31.52-PM.png"}],"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\/11\/26\/presence-detection-with-home-assistant-bayesian-probability\/#primaryimage","inLanguage":"en-US","url":"http:\/\/www.diyfuturism.com\/wp-content\/uploads\/2017\/11\/Screen-Shot-2017-11-25-at-8.31.52-PM.png","contentUrl":"http:\/\/www.diyfuturism.com\/wp-content\/uploads\/2017\/11\/Screen-Shot-2017-11-25-at-8.31.52-PM.png"},{"@type":"WebPage","@id":"https:\/\/diyfuturism.com\/index.php\/2017\/11\/26\/presence-detection-with-home-assistant-bayesian-probability\/#webpage","url":"https:\/\/diyfuturism.com\/index.php\/2017\/11\/26\/presence-detection-with-home-assistant-bayesian-probability\/","name":"Presence Detection Part 1: Home Assistant & Bayesian Probability - DIY Futurism","isPartOf":{"@id":"https:\/\/diyfuturism.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/diyfuturism.com\/index.php\/2017\/11\/26\/presence-detection-with-home-assistant-bayesian-probability\/#primaryimage"},"datePublished":"2017-11-26T06:38:05+00:00","dateModified":"2017-12-19T00:47:20+00:00","author":{"@id":"https:\/\/diyfuturism.com\/#\/schema\/person\/b93619fac07567640bd87cc613a55b7c"},"breadcrumb":{"@id":"https:\/\/diyfuturism.com\/index.php\/2017\/11\/26\/presence-detection-with-home-assistant-bayesian-probability\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/diyfuturism.com\/index.php\/2017\/11\/26\/presence-detection-with-home-assistant-bayesian-probability\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/diyfuturism.com\/index.php\/2017\/11\/26\/presence-detection-with-home-assistant-bayesian-probability\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/diyfuturism.com\/"},{"@type":"ListItem","position":2,"name":"Presence Detection Part 1: Home Assistant &#038; Bayesian Probability"}]},{"@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":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9q0Cl-y","jetpack-related-posts":[{"id":237,"url":"https:\/\/diyfuturism.com\/index.php\/2017\/12\/29\/useful-sensor-bayesian-sleep-detection-in-home-assistant\/","url_meta":{"origin":34,"position":0},"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":215,"url":"https:\/\/diyfuturism.com\/index.php\/2017\/12\/15\/useful-sensor-motion-last-seen-________\/","url_meta":{"origin":34,"position":1},"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":70,"url":"https:\/\/diyfuturism.com\/index.php\/2017\/11\/27\/useful-sensor-improving-presence-detection-with-node-red\/","url_meta":{"origin":34,"position":2},"title":"Presence Detection Part 2: Improving Presence with Node-Red","date":"November 27, 2017","format":false,"excerpt":"In my previous post about presence detection, I showed how you can combine multiple device trackers into one highly accurate Bayesian sensor. In Home Assistant, this new binary_sensor that I created is either on or off. It would be a little nicer if it were a device_tracker\u00a0entity instead that was\u2026","rel":"","context":"In &quot;Config&quot;","img":{"alt_text":"","src":"https:\/\/i1.wp.com\/diyfuturism.com\/wp-content\/uploads\/2017\/11\/Screen-Shot-2017-11-26-at-7.30.26-PM.png?fit=1200%2C618&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":34,"position":3},"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":251,"url":"https:\/\/diyfuturism.com\/index.php\/2017\/12\/19\/home-assistant-making-plant-sensors-talk\/","url_meta":{"origin":34,"position":4},"title":"Home Assistant: Making My Plants Talk with IoT Sensors and a Python Script","date":"December 19, 2017","format":false,"excerpt":"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\u2026","rel":"","context":"In &quot;Config&quot;","img":{"alt_text":"","src":"https:\/\/i2.wp.com\/diyfuturism.com\/wp-content\/uploads\/2017\/12\/33644078760_c2187a3974_o.jpg?fit=1080%2C1080&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":16,"url":"https:\/\/diyfuturism.com\/index.php\/2017\/11\/26\/big-list-of-home-automation-nodes-for-node-red\/","url_meta":{"origin":34,"position":5},"title":"Big List of Useful Home Automation Nodes for Node-Red","date":"November 26, 2017","format":false,"excerpt":"An ongoing list of nodes I have found useful for constructing home automation flows. I have not included device platform nodes, as all state tracking and actions are performed in Home Assistant.","rel":"","context":"In &quot;Node-Red&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/diyfuturism.com\/index.php\/wp-json\/wp\/v2\/posts\/34"}],"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=34"}],"version-history":[{"count":13,"href":"https:\/\/diyfuturism.com\/index.php\/wp-json\/wp\/v2\/posts\/34\/revisions"}],"predecessor-version":[{"id":272,"href":"https:\/\/diyfuturism.com\/index.php\/wp-json\/wp\/v2\/posts\/34\/revisions\/272"}],"wp:attachment":[{"href":"https:\/\/diyfuturism.com\/index.php\/wp-json\/wp\/v2\/media?parent=34"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/diyfuturism.com\/index.php\/wp-json\/wp\/v2\/categories?post=34"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/diyfuturism.com\/index.php\/wp-json\/wp\/v2\/tags?post=34"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}