{"id":1199,"date":"2022-04-18T20:19:00","date_gmt":"2022-04-19T01:19:00","guid":{"rendered":"https:\/\/lab.rapternet.us\/?p=1199"},"modified":"2022-02-11T21:02:17","modified_gmt":"2022-02-12T03:02:17","slug":"motion-sensing-lights-with-home-assistant","status":"publish","type":"post","link":"https:\/\/lab.rapternet.us\/?p=1199","title":{"rendered":"Motion Sensing Lights with Home Assistant"},"content":{"rendered":"\n<p>I&#8217;ve already setup some fairy lights on the stairs which come on just before sundown and stay on until bedtime, but I started wondering, can I use them as night lights on the stairs for when I don&#8217;t want to turn on the main overheads, and can I do that all with motion sensors. For this project, I&#8217;d like to take my lights from here and add motion sensors so they turn on for some time period after being triggered and act as automated stairway night lights. <\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\" id=\"hardware\">Hardware <\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>CloudFree Smart Plug <\/li><li>Zooz 4 in one <\/li><li>Zooz Z-Wave Plus S2 Motion<\/li><\/ul>\n\n\n\n<p>I decided to use the zooz motion sensors, and since I wanted to see the various capabilities of the sensors, I got two different motion sensors of theirs.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"turn-on\">Turn On <\/h3>\n\n\n\n<p>The automation to turn on the lights is straight forward. If either of the motion sensors triggers, then turn on the lights. The automation does have some conditions so that it only turns on the lights at night and to be active after my night lights automation has completed.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"trigger\">Trigger<\/h4>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"469\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-7-1024x469.png\" alt=\"\" class=\"wp-image-1205\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-7-1024x469.png 1024w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-7-300x137.png 300w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-7-768x352.png 768w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-7.png 1083w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption> Motion Sensor 1 Trigger <\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"460\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-8-1024x460.png\" alt=\"\" class=\"wp-image-1206\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-8-1024x460.png 1024w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-8-300x135.png 300w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-8-768x345.png 768w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-8.png 1110w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption> Motion Sensor 2 Trigger <\/figcaption><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"condition\">Condition<\/h4>\n\n\n\n<p>The main complication in this is the condition to allow the automation to run around my timer based nightlight automation. This could be a simple or for before sunrise and after sunset without the other automation.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"399\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-9-1024x399.png\" alt=\"\" class=\"wp-image-1207\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-9-1024x399.png 1024w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-9-300x117.png 300w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-9-768x299.png 768w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-9.png 1079w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption>Run in the Early Morning<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"575\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-10-1024x575.png\" alt=\"\" class=\"wp-image-1208\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-10-1024x575.png 1024w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-10-300x169.png 300w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-10-768x431.png 768w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-10.png 1100w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption>Or After Bedtime on Weekdays<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"666\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-11-1024x666.png\" alt=\"\" class=\"wp-image-1209\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-11-1024x666.png 1024w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-11-300x195.png 300w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-11-768x500.png 768w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-11.png 1070w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption>Or After Bedtime on Weekends<\/figcaption><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"action\">Action<\/h4>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"222\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-12-1024x222.png\" alt=\"\" class=\"wp-image-1210\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-12-1024x222.png 1024w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-12-300x65.png 300w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-12-768x167.png 768w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-12.png 1162w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption>Turn on the Smart Plug<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"turn-off\">Turn Off <\/h3>\n\n\n\n<p>The automation to turn off the lights is relatively similar to that turning them on. In this case, it triggers two minutes after the motion is originally detected, and has the same conditions as the automation to turn on the lights.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"trigger\">Trigger <\/h4>\n\n\n\n<p>For turning off the lights, I want to make sure there hasn&#8217;t been motion for two minutes, while this is far longer than needed to go straight up the stairs, it&#8217;ll let you pause and check to see what the dogs are getting into when they think you&#8217;re leaving, or let someone ease their way up the stairs without getting the lights shut off on them.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-2-1024x467.png\" alt=\"\" class=\"wp-image-1200\" width=\"674\" height=\"307\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-2-1024x467.png 1024w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-2-300x137.png 300w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-2-768x351.png 768w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-2.png 1093w\" sizes=\"auto, (max-width: 674px) 100vw, 674px\" \/><figcaption>Motion Sensor 1 Trigger<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"478\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-31-1024x478.png\" alt=\"\" class=\"wp-image-1318\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-31-1024x478.png 1024w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-31-300x140.png 300w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-31-768x358.png 768w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-31.png 1055w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption> Motion Sensor 2 Trigger <\/figcaption><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"conditions\">Conditions <\/h4>\n\n\n\n<p>Similar conditions to the turn on automation, all to work around the night light timer automation (which we still wanted as a signal for getting the dogs out on a walk).<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"683\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-3-1024x683.png\" alt=\"\" class=\"wp-image-1201\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-3-1024x683.png 1024w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-3-300x200.png 300w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-3-768x512.png 768w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-3.png 1062w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption>After Bedtime on Weekdays<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"593\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-4-1024x593.png\" alt=\"\" class=\"wp-image-1202\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-4-1024x593.png 1024w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-4-300x174.png 300w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-4-768x445.png 768w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-4.png 1044w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption>After Bedtime on Weekends<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"404\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-5-1024x404.png\" alt=\"\" class=\"wp-image-1203\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-5-1024x404.png 1024w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-5-300x118.png 300w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-5-768x303.png 768w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-5.png 1052w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption>Before Sunrise<\/figcaption><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"action\">Action<\/h4>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"235\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-6-1024x235.png\" alt=\"\" class=\"wp-image-1204\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-6-1024x235.png 1024w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-6-300x69.png 300w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-6-768x176.png 768w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2021\/11\/image-6.png 1063w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption>Turn off the Smart Plug<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\">Conclusion <\/h2>\n\n\n\n<p>The automation is working great, without any problems other than the occasional failure for it to turn off after sunrise if the motion is triggered right near sunrise. I&#8217;m not too bothered by this and the WAF is high for this automation without any comments yet on the lights staying on in the morning.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve already setup some fairy lights on the stairs which come on just before sundown and stay on until bedtime, but I started wondering, can I use them as night lights on the stairs for when I don&#8217;t want to turn on the main overheads, and can I do that all with motion sensors. For &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/lab.rapternet.us\/?p=1199\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Motion Sensing Lights with Home Assistant&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[39,49],"class_list":["post-1199","post","type-post","status-publish","format-standard","hentry","category-how-to","tag-home-assistant","tag-smart-home"],"_links":{"self":[{"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/posts\/1199","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1199"}],"version-history":[{"count":25,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/posts\/1199\/revisions"}],"predecessor-version":[{"id":1711,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/posts\/1199\/revisions\/1711"}],"wp:attachment":[{"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1199"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1199"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1199"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}