{"id":189,"date":"2018-11-06T15:03:39","date_gmt":"2018-11-06T15:03:39","guid":{"rendered":"https:\/\/willow.systems\/?p=189"},"modified":"2018-11-06T15:15:16","modified_gmt":"2018-11-06T15:15:16","slug":"iot-halloween","status":"publish","type":"post","link":"https:\/\/willow.systems\/blog\/iot-halloween\/","title":{"rendered":"Using technology to up the spookiness this halloween"},"content":{"rendered":"<p>Often when you think IOT, it&#8217;s the security (or often the complete lack of) which makes it scary. This post, however, focuses on using some IOT tech for a different scary reason &#8211; Halloween.<\/p>\n<p><!--more--><\/p>\n<figure id=\"attachment_190\" aria-describedby=\"caption-attachment-190\" style=\"width: 347px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" class=\"wp-image-190\" src=\"https:\/\/willow.systems\/wp-content\/uploads\/2018\/11\/House-Outside.gif\" alt=\"\" width=\"347\" height=\"455\" \/><figcaption id=\"caption-attachment-190\" class=\"wp-caption-text\">My house from the outside<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>I threw a bit of a last-minute Halloween party this year and, in typical fashion, decided that I should leverage the unhealthy amount of tech I have in my house to go that little bit further when it comes to decorating. In this post I&#8217;ll going to go over the cooler parts of the halloween decorations that made this year&#8217;s party that little bit spookier.<\/p>\n<p>&nbsp;<\/p>\n<h1 style=\"text-align: center;\">Overview<\/h1>\n<p><img loading=\"lazy\" class=\"aligncenter wp-image-194 size-full\" src=\"https:\/\/willow.systems\/wp-content\/uploads\/2018\/11\/annotated.png\" alt=\"\" width=\"573\" height=\"712\" srcset=\"https:\/\/willow.systems\/blog\/wp-content\/uploads\/2018\/11\/annotated.png 573w, https:\/\/willow.systems\/blog\/wp-content\/uploads\/2018\/11\/annotated-241x300.png 241w\" sizes=\"(max-width: 573px) 100vw, 573px\" \/><\/p>\n<p>I wanted the outside of the house to look good, normal decorations are fine (see the &#8216;do not enter&#8217; tape across the door and the&#8230; expertly carved pumpkin), but by the time the trick-or-treaters are out the suns&#8217;s gone down and there isn&#8217;t much to see, so I came up with a few things to fix that.<\/p>\n<p>&nbsp;<\/p>\n<h2 style=\"text-align: center;\">1. Display behind the window<\/h2>\n<p>This one was easy &#8211; My downstairs bathroom windows is just to the right of the front door and as you would hope, it&#8217;s frosted. This made it a great candidate for putting a screen behind and displaying ghoulish images.<\/p>\n<p>&nbsp;<\/p>\n<figure id=\"attachment_195\" aria-describedby=\"caption-attachment-195\" style=\"width: 407px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" class=\"wp-image-195 \" src=\"https:\/\/willow.systems\/wp-content\/uploads\/2018\/11\/20181031_201716-e1541435721546-768x1024.jpg\" alt=\"\" width=\"407\" height=\"542\" srcset=\"https:\/\/willow.systems\/blog\/wp-content\/uploads\/2018\/11\/20181031_201716-e1541435721546-768x1024.jpg 768w, https:\/\/willow.systems\/blog\/wp-content\/uploads\/2018\/11\/20181031_201716-e1541435721546-225x300.jpg 225w\" sizes=\"(max-width: 407px) 100vw, 407px\" \/><figcaption id=\"caption-attachment-195\" class=\"wp-caption-text\">Not the most elegant setup, but it worked a charm<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>For the actual graphics I simply searched for what I wanted plus &#8216;stock footage&#8217; on youtube, and found videos with a black background. Once I&#8217;d found what I wanted (Which here was a splash of blood) I changed the youtube.com part of the URL to youtuberepeat.com, which is a youtube mirror site that will loop your video indefinitely.<\/p>\n<p>&nbsp;<\/p>\n<h2 style=\"text-align: center;\">2. Backwards projection eyeball<\/h2>\n<p>A long time ago I bought one of those <a href=\"https:\/\/www.amazon.co.uk\/s\/ref=nb_sb_noss?url=search-alias%3Daps&amp;field-keywords=cheap+projector\">cheap projectors <\/a>on Amazon. For your \u00a360 you get a project that&#8217;ll put out about 240 &#8211; 360p at a pretty unimpressive brightness. Whilst I&#8217;ve never watched a film one it, it&#8217;s useful for projecting images and large text, so here it worked great.<\/p>\n<p>&nbsp;<\/p>\n<figure id=\"attachment_197\" aria-describedby=\"caption-attachment-197\" style=\"width: 696px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" class=\"wp-image-197 \" src=\"https:\/\/willow.systems\/wp-content\/uploads\/2018\/11\/eyeball-inside.gif\" alt=\"\" width=\"696\" height=\"521\" \/><figcaption id=\"caption-attachment-197\" class=\"wp-caption-text\">The eyeball projection from my bedroom. The flicker wasn&#8217;t visible to the naked eye<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>The video here comes from a looping powerpoint presentation with an eyeball image with custom motion paths, it let me create a looping, roaming eye in about 10 minutes. I projected it onto my closed blind, and the effect from outside was quite good:<\/p>\n<p>&nbsp;<\/p>\n<figure id=\"attachment_198\" aria-describedby=\"caption-attachment-198\" style=\"width: 344px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" class=\"wp-image-198\" src=\"https:\/\/willow.systems\/wp-content\/uploads\/2018\/11\/eyeball-outside.gif\" alt=\"\" width=\"344\" height=\"536\" \/><figcaption id=\"caption-attachment-198\" class=\"wp-caption-text\">It&#8217;s hard to see here, but at night it looked pretty good<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3 style=\"text-align: center;\">3. Phillips hue effects<\/h3>\n<p>I have <a href=\"https:\/\/www2.meethue.com\/en-gb\">Phillips hue<\/a> bulbs throughout my house, three of which are the<a href=\"https:\/\/www.amazon.co.uk\/Philips-Ambiance-Wireless-Lighting-Starter\/dp\/B01K1WP7Z4\/ref=sr_1_10?ie=UTF8&amp;qid=1541436563&amp;sr=8-10&amp;keywords=philips+hue\"> colour bulbs.<\/a> It was these that I used to create some cool lighting effects in the hallway and upstairs office. If I had more time to prepare I would have liked to sync the hue lights to audio, but perhaps something for next year. This year I had three effects, all created through a simple bash script that uses the hue hub API.<\/p>\n<p>&nbsp;<\/p>\n<h3 style=\"text-align: center;\">3.1 <em>Lightning<\/em><\/h3>\n<p>The first effect was lightning, which was a few API calls in rapid succession:<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter wp-image-202 size-full\" src=\"https:\/\/willow.systems\/wp-content\/uploads\/2018\/11\/code-lightningstrike.png\" alt=\"\" width=\"885\" height=\"669\" srcset=\"https:\/\/willow.systems\/blog\/wp-content\/uploads\/2018\/11\/code-lightningstrike.png 885w, https:\/\/willow.systems\/blog\/wp-content\/uploads\/2018\/11\/code-lightningstrike-300x227.png 300w, https:\/\/willow.systems\/blog\/wp-content\/uploads\/2018\/11\/code-lightningstrike-768x581.png 768w\" sizes=\"(max-width: 885px) 100vw, 885px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>The code here reads in the &#8216;user&#8217; for the Hue hub (the API token), then tells the hub to turn the light on and off at different intensities with a 0.1 second delay between. The result, which is hard to film, looks something like this:<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter wp-image-214\" src=\"https:\/\/willow.systems\/wp-content\/uploads\/2018\/11\/lightning-bulb4.gif\" alt=\"\" width=\"324\" height=\"476\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>And from outside the house:<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-211\" src=\"https:\/\/willow.systems\/wp-content\/uploads\/2018\/11\/lightning-outside3.gif\" alt=\"\" width=\"576\" height=\"338\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>I also wanted some less aggressive lighting effects to be looping on the downstairs lights, so I came up with two much simpler ones, <em>dim<\/em> and <em>flicker<\/em>.<\/p>\n<p>&nbsp;<\/p>\n<h3 style=\"text-align: center;\">3.2 <em>Dim<\/em><\/h3>\n<p>The dim effect works exactly as you&#8217;d expect, it just dims the bulb for a moment then brings it back up, similar to what you might see during a <a href=\"https:\/\/en.wikipedia.org\/wiki\/Voltage_sag\">voltage dip<\/a> or <a href=\"https:\/\/en.wikipedia.org\/wiki\/Brownout_(electricity)\">brownout<\/a>.<\/p>\n<p>The code for all three effects is very similar, with the important difference in the JSON sent to the hue hub.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter wp-image-217\" src=\"https:\/\/willow.systems\/wp-content\/uploads\/2018\/11\/code-dim.png\" alt=\"\" width=\"1010\" height=\"620\" srcset=\"https:\/\/willow.systems\/blog\/wp-content\/uploads\/2018\/11\/code-dim.png 1140w, https:\/\/willow.systems\/blog\/wp-content\/uploads\/2018\/11\/code-dim-300x184.png 300w, https:\/\/willow.systems\/blog\/wp-content\/uploads\/2018\/11\/code-dim-768x472.png 768w, https:\/\/willow.systems\/blog\/wp-content\/uploads\/2018\/11\/code-dim-1024x629.png 1024w\" sizes=\"(max-width: 1010px) 100vw, 1010px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Here it reduces the brightness of the light to 5 (out of 255) with a transition time of 5ms, waits 0.5 seconds, then brings the light back up to 20 immediately.<\/p>\n<figure id=\"attachment_216\" aria-describedby=\"caption-attachment-216\" style=\"width: 316px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" class=\"wp-image-216\" src=\"https:\/\/willow.systems\/wp-content\/uploads\/2018\/11\/dim.gif\" alt=\"\" width=\"316\" height=\"464\" \/><figcaption id=\"caption-attachment-216\" class=\"wp-caption-text\">The dim effect, similar to a voltage sag<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3 style=\"text-align: center;\">3.3 <em>Flicker<\/em><\/h3>\n<p>The flicker effect isn&#8217;t dissimilar to the dim effect, it provided another less in-your-face layer of ambience.<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter wp-image-218\" src=\"https:\/\/willow.systems\/wp-content\/uploads\/2018\/11\/code-flicker.png\" alt=\"\" width=\"838\" height=\"642\" srcset=\"https:\/\/willow.systems\/blog\/wp-content\/uploads\/2018\/11\/code-flicker.png 1152w, https:\/\/willow.systems\/blog\/wp-content\/uploads\/2018\/11\/code-flicker-300x230.png 300w, https:\/\/willow.systems\/blog\/wp-content\/uploads\/2018\/11\/code-flicker-768x589.png 768w, https:\/\/willow.systems\/blog\/wp-content\/uploads\/2018\/11\/code-flicker-1024x785.png 1024w\" sizes=\"(max-width: 838px) 100vw, 838px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>As you can see from the code there are a few more step and lighting levels, with no delay between levels. The effect is quite good.<\/p>\n<p>&nbsp;<\/p>\n<figure id=\"attachment_219\" aria-describedby=\"caption-attachment-219\" style=\"width: 352px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" class=\"wp-image-219\" src=\"https:\/\/willow.systems\/wp-content\/uploads\/2018\/11\/flicker.gif\" alt=\"\" width=\"352\" height=\"522\" \/><figcaption id=\"caption-attachment-219\" class=\"wp-caption-text\">I&#8217;d like to point out I usually do have lampshades&#8230;<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h2 style=\"text-align: center;\">4. The spooky secret weapon &#8211; A fog machine<\/h2>\n<p>Another last-minute addition &#8211; I bought a fog machine (specifically, <a href=\"https:\/\/www.amazon.co.uk\/gp\/product\/B075MB649N\">this one<\/a>) from amazon to add an extra layer of spookiness to the house. Whilst a little less homebrew than the other items in this list, it definitely deserves a mention as it made the lighting effects that much more pronounced and the atmosphere much more sinister.<\/p>\n<figure id=\"attachment_220\" aria-describedby=\"caption-attachment-220\" style=\"width: 350px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" class=\"wp-image-220 \" src=\"https:\/\/willow.systems\/wp-content\/uploads\/2018\/11\/20181031_211643-e1541509720110-768x1024.jpg\" alt=\"\" width=\"350\" height=\"466\" srcset=\"https:\/\/willow.systems\/blog\/wp-content\/uploads\/2018\/11\/20181031_211643-e1541509720110-768x1024.jpg 768w, https:\/\/willow.systems\/blog\/wp-content\/uploads\/2018\/11\/20181031_211643-e1541509720110-225x300.jpg 225w\" sizes=\"(max-width: 350px) 100vw, 350px\" \/><figcaption id=\"caption-attachment-220\" class=\"wp-caption-text\">Hallway before<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<figure id=\"attachment_221\" aria-describedby=\"caption-attachment-221\" style=\"width: 355px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" class=\"wp-image-221 \" src=\"https:\/\/willow.systems\/wp-content\/uploads\/2018\/11\/20181031_202446-e1541509768163-768x1024.jpg\" alt=\"\" width=\"355\" height=\"473\" srcset=\"https:\/\/willow.systems\/blog\/wp-content\/uploads\/2018\/11\/20181031_202446-e1541509768163-768x1024.jpg 768w, https:\/\/willow.systems\/blog\/wp-content\/uploads\/2018\/11\/20181031_202446-e1541509768163-225x300.jpg 225w\" sizes=\"(max-width: 355px) 100vw, 355px\" \/><figcaption id=\"caption-attachment-221\" class=\"wp-caption-text\">Hallway after: +100 spook<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<h2>Wrapping up<\/h2>\n<p>Overall, the effects came together to add an eerier mood to the evening. The hue effects were particularly cool, and I wrote a script to tie all 3 lightning effects together, and at random intervals pair a random effect to a random light (with the exception of the upstairs light, which only did lightning).<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter wp-image-224 size-full\" src=\"https:\/\/willow.systems\/wp-content\/uploads\/2018\/11\/code-halloween.png\" alt=\"\" width=\"403\" height=\"937\" srcset=\"https:\/\/willow.systems\/blog\/wp-content\/uploads\/2018\/11\/code-halloween.png 403w, https:\/\/willow.systems\/blog\/wp-content\/uploads\/2018\/11\/code-halloween-129x300.png 129w\" sizes=\"(max-width: 403px) 100vw, 403px\" \/><\/p>\n<p>I used the &#8216;od -An -N1 -i \/dev\/random&#8217; method of generating random numbers over BASH&#8217;s $RANDOM variable, as $RANDOM seemed to produce a certain pattern over time, but for the most part the above script is fairly self explanatory, it picks a random light, then if it isn&#8217;t light ID 6 (the upstairs light), performs a random light effect. If it is the upstairs light, it performs the lightning effect, which looked great from outdoors. The lightning looked particularly good from outside through the front door, so perhaps next year I&#8217;ll wire up a doorbell to affect the effects.<\/p>\n<p>It was a good start and I hope next year I can take it even more overboard&#8230;<\/p>\n<p>&nbsp;<\/p>\n<hr \/>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Often when you think IOT, it&#8217;s the security (or often the complete lack of) which makes it scary. This post, however, focuses on using some IOT tech for a different scary reason &#8211; Halloween.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/willow.systems\/blog\/wp-json\/wp\/v2\/posts\/189"}],"collection":[{"href":"https:\/\/willow.systems\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/willow.systems\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/willow.systems\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/willow.systems\/blog\/wp-json\/wp\/v2\/comments?post=189"}],"version-history":[{"count":28,"href":"https:\/\/willow.systems\/blog\/wp-json\/wp\/v2\/posts\/189\/revisions"}],"predecessor-version":[{"id":239,"href":"https:\/\/willow.systems\/blog\/wp-json\/wp\/v2\/posts\/189\/revisions\/239"}],"wp:attachment":[{"href":"https:\/\/willow.systems\/blog\/wp-json\/wp\/v2\/media?parent=189"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/willow.systems\/blog\/wp-json\/wp\/v2\/categories?post=189"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/willow.systems\/blog\/wp-json\/wp\/v2\/tags?post=189"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}