{"id":2528,"date":"2018-12-13T00:00:41","date_gmt":"2018-12-12T23:00:41","guid":{"rendered":"https:\/\/iot.fkainka.de\/?p=2528"},"modified":"2018-11-21T12:30:05","modified_gmt":"2018-11-21T11:30:05","slug":"day13-2018","status":"publish","type":"post","link":"https:\/\/iot.fkainka.de\/en\/day13-2018","title":{"rendered":"Day 13: Smart Switch for Soundboard"},"content":{"rendered":"<p>Today we will find again a 1 kOhm resistor hidden behind the door of the Advent calendar. But we are not going to use it today. Instead I would like to show you how you can build a smart touch switch. We will use a simple setup that is made up of four loose hanging wires as touch buttons and a wire jumper to pin 23.<\/p>\n<div id=\"attachment_2529\" style=\"width: 509px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/iot.fkainka.de\/wp-content\/uploads\/2018\/11\/Day13_5tch_Steckplatine.png\"><img aria-describedby=\"caption-attachment-2529\" decoding=\"async\" loading=\"lazy\" class=\" wp-image-2529\" src=\"https:\/\/iot.fkainka.de\/wp-content\/uploads\/2018\/11\/Day13_5tch_Steckplatine-783x1024.png\" alt=\"Vier gelbe Dr\u00e4hte als Touch-Buttons\" width=\"499\" height=\"652\" data-id=\"2529\" srcset=\"https:\/\/iot.fkainka.de\/wp-content\/uploads\/2018\/11\/Day13_5tch_Steckplatine-783x1024.png 783w, https:\/\/iot.fkainka.de\/wp-content\/uploads\/2018\/11\/Day13_5tch_Steckplatine-230x300.png 230w, https:\/\/iot.fkainka.de\/wp-content\/uploads\/2018\/11\/Day13_5tch_Steckplatine-768x1004.png 768w, https:\/\/iot.fkainka.de\/wp-content\/uploads\/2018\/11\/Day13_5tch_Steckplatine.png 879w\" sizes=\"(max-width: 499px) 100vw, 499px\" \/><\/a><p id=\"caption-attachment-2529\" class=\"wp-caption-text\">Four yellow wires serving as touch buttons<\/p><\/div>\n<p>Our experiment today is special for its program, which you should activate now on the configuration page. Once enabled, you will notice that the status LED flashes briefly and then turns off, because the board is again running in the power-saving deep-sleep mode. It will not wake up after certain time however. It will wake up only, when you touch one of the touch buttons. The board then sends information via the touch button to the broker who triggered the wakeup. It will look something like this:<\/p>\n<p><strong>{&#8220;cmd&#8221;:&#8221;get_touch_state&#8221;,&#8221;pin_name&#8221;:&#8221;Touch4&#8243;,&#8221;pin_id&#8221;:6,&#8221;pin_nr&#8221;:14,&#8221;pin_state&#8221;:true}<\/strong><\/p>\n<p>While the connection is being established, you can see that the status LED is flashing green. Once the data is sent, the LED is lit green, which indicates that sending was successful. If the LED is red, sending did not work. The board goes back into deep-sleep mode immediately after that. The system is very energy efficient so that you could power the board by batteries and place the smart switch anywhere in your flat.<\/p>\n<p><strong>Note<\/strong>: Simply pull out the wire jumper from pin 23 and reset the board to leave deep-sleep mode and switch to normal mode.<\/p>\n<p>The smart switch itself is something special. We are going to connect the switch with Node-RED and an application. We will use the audio-out node once more in today\u2019s Node-RED flow, but this time we need it to play audio files, too. First of all, import today\u2019s flow; and, do not forget, disable previous flows and enter your personal ID instead of the <strong>[PID]<\/strong> placeholder.<\/p>\n<div id=\"attachment_2530\" style=\"width: 626px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/iot.fkainka.de\/wp-content\/uploads\/2018\/11\/T13Flow.png\"><img aria-describedby=\"caption-attachment-2530\" decoding=\"async\" loading=\"lazy\" class=\"size-large wp-image-2530\" src=\"https:\/\/iot.fkainka.de\/wp-content\/uploads\/2018\/11\/T13Flow-1024x351.png\" alt=\"Der Flow des heutigen Tages\" width=\"616\" height=\"211\" data-id=\"2530\" srcset=\"https:\/\/iot.fkainka.de\/wp-content\/uploads\/2018\/11\/T13Flow-1024x351.png 1024w, https:\/\/iot.fkainka.de\/wp-content\/uploads\/2018\/11\/T13Flow-300x103.png 300w, https:\/\/iot.fkainka.de\/wp-content\/uploads\/2018\/11\/T13Flow-768x263.png 768w, https:\/\/iot.fkainka.de\/wp-content\/uploads\/2018\/11\/T13Flow-972x333.png 972w, https:\/\/iot.fkainka.de\/wp-content\/uploads\/2018\/11\/T13Flow.png 1317w\" sizes=\"(max-width: 616px) 100vw, 616px\" \/><\/a><p id=\"caption-attachment-2530\" class=\"wp-caption-text\">Today\u2019s flow<\/p><\/div>\n<p><iframe style=\"border: none; width: 100%;\" src=\"https:\/\/pastebin.com\/embed_iframe\/efdYEFqx\"><\/iframe><\/p>\n<p>Check out and discover the functionalities of the individual buttons. But before that, turn down the volume of your speakers.<\/p>","protected":false},"excerpt":{"rendered":"<p>Today we will find again a 1 kOhm resistor hidden behind the door of the Advent calendar. But we are not going to use it today. Instead I would like to show you how you can build a smart touch&#8230;<br \/><a class=\"read-more-button\" href=\"https:\/\/iot.fkainka.de\/en\/day13-2018\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":2530,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[315,312,313],"tags":[],"jetpack_publicize_connections":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Day 13: Smart Switch for Soundboard - Internet of Things with the NanoESP<\/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:\/\/iot.fkainka.de\/day13-2018\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Day 13: Smart Switch for Soundboard - Internet of Things with the NanoESP\" \/>\n<meta property=\"og:description\" content=\"Today we will find again a 1 kOhm resistor hidden behind the door of the Advent calendar. But we are not going to use it today. Instead I would like to show you how you can build a smart touch...Read more\" \/>\n<meta property=\"og:url\" content=\"https:\/\/iot.fkainka.de\/day13-2018\" \/>\n<meta property=\"og:site_name\" content=\"Internet of Things with the NanoESP\" \/>\n<meta property=\"article:published_time\" content=\"2018-12-12T23:00:41+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-11-21T11:30:05+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/iot.fkainka.de\/wp-content\/uploads\/2018\/11\/T13Flow.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1317\" \/>\n\t<meta property=\"og:image:height\" content=\"451\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"fk\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"fk\" \/>\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\":\"WebPage\",\"@id\":\"https:\/\/iot.fkainka.de\/day13-2018\",\"url\":\"https:\/\/iot.fkainka.de\/day13-2018\",\"name\":\"Day 13: Smart Switch for Soundboard - Internet of Things with the NanoESP\",\"isPartOf\":{\"@id\":\"https:\/\/iot.fkainka.de\/#website\"},\"datePublished\":\"2018-12-12T23:00:41+00:00\",\"dateModified\":\"2018-11-21T11:30:05+00:00\",\"author\":{\"@id\":\"https:\/\/iot.fkainka.de\/#\/schema\/person\/d3205fdf2649027fc35e240d4f8b285a\"},\"breadcrumb\":{\"@id\":\"https:\/\/iot.fkainka.de\/day13-2018#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/iot.fkainka.de\/day13-2018\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/iot.fkainka.de\/day13-2018#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/iot.fkainka.de\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Tag 13: Smarter Schalter f\u00fcr ein Soundboard\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/iot.fkainka.de\/#website\",\"url\":\"https:\/\/iot.fkainka.de\/\",\"name\":\"Internet of Things with the NanoESP\",\"description\":\"The webpage for the Arduino compatible WiFi-Board\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/iot.fkainka.de\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/iot.fkainka.de\/#\/schema\/person\/d3205fdf2649027fc35e240d4f8b285a\",\"name\":\"fk\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/iot.fkainka.de\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/141cf958a831e66efabf9674e117e8d9?s=96&d=identicon&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/141cf958a831e66efabf9674e117e8d9?s=96&d=identicon&r=g\",\"caption\":\"fk\"},\"url\":\"https:\/\/iot.fkainka.de\/en\/author\/fk\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Day 13: Smart Switch for Soundboard - Internet of Things with the NanoESP","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:\/\/iot.fkainka.de\/day13-2018","og_locale":"en_US","og_type":"article","og_title":"Day 13: Smart Switch for Soundboard - Internet of Things with the NanoESP","og_description":"Today we will find again a 1 kOhm resistor hidden behind the door of the Advent calendar. But we are not going to use it today. Instead I would like to show you how you can build a smart touch...Read more","og_url":"https:\/\/iot.fkainka.de\/day13-2018","og_site_name":"Internet of Things with the NanoESP","article_published_time":"2018-12-12T23:00:41+00:00","article_modified_time":"2018-11-21T11:30:05+00:00","og_image":[{"width":1317,"height":451,"url":"https:\/\/iot.fkainka.de\/wp-content\/uploads\/2018\/11\/T13Flow.png","type":"image\/png"}],"author":"fk","twitter_card":"summary_large_image","twitter_misc":{"Written by":"fk","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/iot.fkainka.de\/day13-2018","url":"https:\/\/iot.fkainka.de\/day13-2018","name":"Day 13: Smart Switch for Soundboard - Internet of Things with the NanoESP","isPartOf":{"@id":"https:\/\/iot.fkainka.de\/#website"},"datePublished":"2018-12-12T23:00:41+00:00","dateModified":"2018-11-21T11:30:05+00:00","author":{"@id":"https:\/\/iot.fkainka.de\/#\/schema\/person\/d3205fdf2649027fc35e240d4f8b285a"},"breadcrumb":{"@id":"https:\/\/iot.fkainka.de\/day13-2018#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/iot.fkainka.de\/day13-2018"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/iot.fkainka.de\/day13-2018#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/iot.fkainka.de\/"},{"@type":"ListItem","position":2,"name":"Tag 13: Smarter Schalter f\u00fcr ein Soundboard"}]},{"@type":"WebSite","@id":"https:\/\/iot.fkainka.de\/#website","url":"https:\/\/iot.fkainka.de\/","name":"Internet of Things with the NanoESP","description":"The webpage for the Arduino compatible WiFi-Board","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/iot.fkainka.de\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/iot.fkainka.de\/#\/schema\/person\/d3205fdf2649027fc35e240d4f8b285a","name":"fk","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/iot.fkainka.de\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/141cf958a831e66efabf9674e117e8d9?s=96&d=identicon&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/141cf958a831e66efabf9674e117e8d9?s=96&d=identicon&r=g","caption":"fk"},"url":"https:\/\/iot.fkainka.de\/en\/author\/fk"}]}},"jetpack_featured_media_url":"https:\/\/iot.fkainka.de\/wp-content\/uploads\/2018\/11\/T13Flow.png","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p6McI0-EM","_links":{"self":[{"href":"https:\/\/iot.fkainka.de\/en\/wp-json\/wp\/v2\/posts\/2528"}],"collection":[{"href":"https:\/\/iot.fkainka.de\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/iot.fkainka.de\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/iot.fkainka.de\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/iot.fkainka.de\/en\/wp-json\/wp\/v2\/comments?post=2528"}],"version-history":[{"count":4,"href":"https:\/\/iot.fkainka.de\/en\/wp-json\/wp\/v2\/posts\/2528\/revisions"}],"predecessor-version":[{"id":2534,"href":"https:\/\/iot.fkainka.de\/en\/wp-json\/wp\/v2\/posts\/2528\/revisions\/2534"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/iot.fkainka.de\/en\/wp-json\/wp\/v2\/media\/2530"}],"wp:attachment":[{"href":"https:\/\/iot.fkainka.de\/en\/wp-json\/wp\/v2\/media?parent=2528"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/iot.fkainka.de\/en\/wp-json\/wp\/v2\/categories?post=2528"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/iot.fkainka.de\/en\/wp-json\/wp\/v2\/tags?post=2528"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}