{"id":713,"date":"2018-01-23T11:33:15","date_gmt":"2018-01-23T19:33:15","guid":{"rendered":"http:\/\/ismellsmoke.net\/\/?p=713"},"modified":"2018-01-23T11:41:18","modified_gmt":"2018-01-23T19:41:18","slug":"home-automation-hacking-part-iii","status":"publish","type":"post","link":"https:\/\/ismellsmoke.net\/?p=713","title":{"rendered":"Home Automation Hacking Part-III"},"content":{"rendered":"<p>This is Part-III of an ongoing series of Ol&#8217;e <em>Sopwith&#8217;s<\/em> adventures with a home automation project. <a href=\"https:\/\/ismellsmoke.net\/\/?p=661\" target=\"_blank\" rel=\"noopener\">Part-1<\/a>\u00a0started off with the ambitious idea of doing a bake-off between <em>openHAB<\/em> and <em>Home Assistant<\/em>. In Part-II, I learned the <em>openHAB<\/em> platform and achieved all of my goals of getting numerous Z-Wave devices on-line. I even took the time to create a detailed openHAB &#8220;How-To&#8221; to assist those of you that are new to the platform. Very happy with the results.<\/p>\n<p>Here in Part-III, my plan was to do the same with <em>Home Assistant.\u00a0<\/em>Dig into the bits and document how it works. My hope was to get all of my Z-Wave devices behaving the same way in <em>Home Assistant (HA)<\/em> as they were in <em>openHAB.<\/em><\/p>\n<p><a href=\"https:\/\/ismellsmoke.net\/\/wp-content\/uploads\/2018\/01\/homeassistant.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-664\" src=\"https:\/\/ismellsmoke.net\/\/wp-content\/uploads\/2018\/01\/homeassistant-300x151.png\" alt=\"\" width=\"300\" height=\"151\" srcset=\"https:\/\/ismellsmoke.net\/wp-content\/uploads\/2018\/01\/homeassistant-300x151.png 300w, https:\/\/ismellsmoke.net\/wp-content\/uploads\/2018\/01\/homeassistant-768x388.png 768w, https:\/\/ismellsmoke.net\/wp-content\/uploads\/2018\/01\/homeassistant-1024x517.png 1024w, https:\/\/ismellsmoke.net\/wp-content\/uploads\/2018\/01\/homeassistant-500x252.png 500w, https:\/\/ismellsmoke.net\/wp-content\/uploads\/2018\/01\/homeassistant.png 1082w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Not so fast Shirley. From the moment I started to learn <em>HA<\/em>, I ran into problems. For example, I started on this page, <a href=\"https:\/\/home-assistant.io\/getting-started\/\" target=\"_blank\" rel=\"noopener\">&#8220;Install Home Assistant&#8221;<\/a>, and followed the instructions exactly. I burned the image and booted the Pi. Notice the below instructions 6-8.<\/p>\n<p><!--more--><\/p>\n<ol start=\"5\">\n<li>&#8230;<\/li>\n<li>Connect your Raspberry Pi to the power supply so it turns on.<\/li>\n<li>The Raspberry Pi will now boot up, connect to the Internet and download the latest version of Home Assistant. This will take about 20 minutes.<\/li>\n<li>Home Assistant will be available at\u00a0http:\/\/hassio.local:8123.<\/li>\n<\/ol>\n<p>What happened next was weird. I had a KVM connected to my Pi and a wired Ethernet connection to the Internet. The Pi did boot and showed a white background with the blue\u00a0<em>HA <\/em>logo in the middle of the screen. After a few minutes, the screen went black. No keyboard activity bought the machine to life. &lt;Alt&gt;&lt;2&gt; did not give me a new console. The Pi was dead. I was expecting to see a console with the install progress that would take about 20 minutes. Nothing.<\/p>\n<p>At this point, I figured I screwed up burning the image. So, I re-burned the image and got the same result. I headed to Google and found out many others were complaining about the same thing.<\/p>\n<p>Then I found a post that explained the <em>Hass.io<\/em> image for the Raspberry Pi was a self-contained Docker container. When you boot the image, it immediately fires up a web browser. What you are supposed to do is boot the Pi, then open a browser and head over to\u00a0\u00a0http:\/\/hassio.local:8123. When I did this the second time around, I saw a white browser page and a banner that said &#8220;This will take about 20 minutes.&#8221; Aha- the install occurs in a browser!<\/p>\n<p>The Pi3 installed the bits pretty quicky and the system came up. The first thing I wanted to do was ssh to the Pi and set up the locale, timezone, keyboard, etc. Uh-Oh. SSH did not work. Huh? More Googling to discover the <em>Hass.io<\/em> docker image is completely locked down. You cannot install software on it, or do anything else with it. Black Box. at this point <em>Sopwith<\/em> is not liking the <em>HA<\/em> universe right now.<\/p>\n<p>I next discovered that <em>HA<\/em> does have a <em>Raspian<\/em> version for the Pi named <em>Hassbian.\u00a0<\/em>Terrific. But wait! On this <em>HA<\/em> web <a href=\"https:\/\/home-assistant.io\/docs\/installation\/hassbian\/\" target=\"_blank\" rel=\"noopener\">page<\/a>, it says:<\/p>\n<blockquote><p>&#8220;Hassbian is our customized operating system for the Raspberry Pi 3. It is the easiest way of installing Home Assistant.&#8221;<\/p><\/blockquote>\n<p>If this is so, why do the instructions on the main install page tell you to install <em>Hass.io<\/em>? Weird.<\/p>\n<p>I burned <em>Hassbian<\/em> to an SD card and fired it up. Now this had all the workings of a typical <em>Raspian<\/em> type install. I got everything configured and then discovered, to my chagrin, there are a lot of missing pieces in the <em>Hassbian<\/em> release that are in the <em>Hass.io<\/em> container. So guys, what am I supposed to use? Please don&#8217;t leave me hanging here!<\/p>\n<p>I decided to go back to the <em>Hass.io<\/em> container and build my system from there. As you will find out, this was just the beginning of my trouble.<\/p>\n<p>I spent the next two days literally going insane with this platform. In order to keep this Blog entry to a reasonable length, I will just highlight my unbelievable frustrations.<\/p>\n<ul>\n<li>The use of yaml as a configuration engine drove me to the loony bin. I spent more than 2 hours trying to get a simple working configuration.yaml file working. Shame on\u00a0 me for not knowing yaml, but hey, every time you change the configuration file you have to &#8220;check&#8221; the configuration to see if it is valid.\u00a0This took forever. On top of that, if the configuration check validates, you have to reboot the Pi to see your changes. I can flatly state right here: <span style=\"text-decoration: underline;\">Unless you are a yaml programmer, you will never get this platform up and running without some serious help.<\/span><\/li>\n<li>The <em>HA<\/em> documentation on their web site looks nice, but it lacks depth and assumes you know, in detail, the underlying architecture. For example, the third step of the <a href=\"https:\/\/home-assistant.io\/docs\/configuration\/devices\/\" target=\"_blank\" rel=\"noopener\">Configuration<\/a> documentation says you need to create an entry in the configuration.yaml file for each of your devices. I was able to get my Z-Wave devices up and recognized by the system, but below is the example the documentation provides.<\/li>\n<\/ul>\n<p><a href=\"https:\/\/ismellsmoke.net\/\/wp-content\/uploads\/2018\/01\/platform.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-715\" src=\"https:\/\/ismellsmoke.net\/\/wp-content\/uploads\/2018\/01\/platform-300x243.png\" alt=\"\" width=\"300\" height=\"243\" srcset=\"https:\/\/ismellsmoke.net\/wp-content\/uploads\/2018\/01\/platform-300x243.png 300w, https:\/\/ismellsmoke.net\/wp-content\/uploads\/2018\/01\/platform-370x300.png 370w, https:\/\/ismellsmoke.net\/wp-content\/uploads\/2018\/01\/platform.png 502w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<ul>\n<li>Ok &#8211; so I add my devices like it shows. But what platform do I use for a my Z-Wave devices? Where do I find a list of platforms? Lots of Googling determined <em>HA<\/em> itself does not use the term &#8216;platform&#8217; in all but a few places. I never did find the list. I did not know how to configure my devices. I ran into this same problem with the documentation everywhere. Examples that were terse and did not work.<\/li>\n<li>I finally did get my three garage door sensors in a group on the Main page of the application. I would estimate to get to this point took me more that 9 hours of screwing around. To me, this is unacceptable for a platform that is supposed to be a snap to get up and running. And I have 40 years of programming experience.<\/li>\n<li>Instead of giving up &#8211; I decided to try one more &#8220;simple&#8221; thing. My garage door sensors are binary switches &#8211; so they have a state of either &#8220;on&#8221; or &#8220;off&#8221;. In the UI this does not make any sense for a garage door. A door is either &#8220;open&#8221; or &#8220;closed&#8221; not &#8220;on&#8221; or &#8220;off&#8221;. I figured this would be as easy as configuring a map or a python dictionary. Nope. You have to create a Template. I followed instructions from the <em>HA<\/em> web site and blog posts, but I could not get it to work. I could not figure out how to get a templates output assigned to a control. This absolutely drove me crazy trying to figure it out. I never did get it to work.\u00a0 To have to create a template to do something so simple tells me the Framework is flawed.<\/li>\n<\/ul>\n<p><a href=\"https:\/\/ismellsmoke.net\/\/wp-content\/uploads\/2018\/01\/garages.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-717\" src=\"https:\/\/ismellsmoke.net\/\/wp-content\/uploads\/2018\/01\/garages-300x122.png\" alt=\"\" width=\"300\" height=\"122\" srcset=\"https:\/\/ismellsmoke.net\/wp-content\/uploads\/2018\/01\/garages-300x122.png 300w, https:\/\/ismellsmoke.net\/wp-content\/uploads\/2018\/01\/garages.png 477w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Those of you that know me, are very familiar with the fun I have fixing something that is broken &#8211; especially right out of the box. This experience of getting <em>HA<\/em> up and running was truly horrible. I cannot remember having this much frustration on a single project in years.<\/p>\n<p>Now before you <em>HA<\/em> aficionados started spamming me &#8211; this is just one man&#8217;s experience. I have no beef with <em>HA<\/em>.\u00a0I am not an <em>openHAB<\/em> homer. It is just a simple fact that I was able to get <em>openHAB<\/em> up and running with a terrific user interface without any major problems. The documentation is above average and the community is vibrant. <em>HA<\/em> was a disaster for me. It is a rare day that I walk away from a tech project, but that is what I did here. I just don&#8217;t have the time to spend on trying to figure it all out.<\/p>\n<p>Perhaps the most frustrating thing for me, above everything else, was that I never saw a single line of Python code when I was trying to get <em>HA<\/em> up and running. This platform may be written in Python, but you are going nowhere unless you know yaml and can deal with its crazy indentation and syntax.<\/p>\n<p>I apologize to my readers who were looking forward to a honest comparison between <em>HA<\/em> and <em>openHAB<\/em>.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is Part-III of an ongoing series of Ol&#8217;e Sopwith&#8217;s adventures with a home automation project. Part-1\u00a0started off with the ambitious idea of doing a bake-off between openHAB and Home Assistant. In Part-II, I learned the openHAB platform and achieved &hellip; <a href=\"https:\/\/ismellsmoke.net\/?p=713\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-713","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/ismellsmoke.net\/index.php?rest_route=\/wp\/v2\/posts\/713","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ismellsmoke.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ismellsmoke.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ismellsmoke.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ismellsmoke.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=713"}],"version-history":[{"count":8,"href":"https:\/\/ismellsmoke.net\/index.php?rest_route=\/wp\/v2\/posts\/713\/revisions"}],"predecessor-version":[{"id":723,"href":"https:\/\/ismellsmoke.net\/index.php?rest_route=\/wp\/v2\/posts\/713\/revisions\/723"}],"wp:attachment":[{"href":"https:\/\/ismellsmoke.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=713"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ismellsmoke.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=713"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ismellsmoke.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=713"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}