{"id":341,"date":"2020-01-24T15:45:20","date_gmt":"2020-01-24T03:45:20","guid":{"rendered":"https:\/\/www.berserkir.net\/wordpress\/?p=341"},"modified":"2020-01-24T16:22:01","modified_gmt":"2020-01-24T04:22:01","slug":"home-assistant","status":"publish","type":"post","link":"https:\/\/www.berserkir.net\/wordpress\/home-assistant\/","title":{"rendered":"Home Assistant"},"content":{"rendered":"\n<p>Hass.IO<\/p>\n\n\n\n<p>Of all things, not something I expected I&#8217;d do. But, as it turns out &#8211; automation is definitely nice. I&#8217;ve got Wake-on-LAN working, and my lights etc &#8211; so I can turn on the lights in my office and boot up my workstation, with one button, on my phone. Everything is ready to use by the time I&#8217;ve made a coffee and walked from the kettle to the computer in the office.<\/p>\n\n\n\n<p>Setup was surprisingly easy. I followed the official instructions, but I added some extra steps along with them (because I liked the look and function better).<br>Rather than everything being in configuration.yaml, I now have sensors in their own folder, with a yaml file per sensor (radarr, sonarr etc each have their own). Switches, themes, device trackers, zones&#8230; all separate files. <\/p>\n\n\n\n<p>To be honest &#8211; it&#8217;s for my convenience. Being able to add a sensor and test around with it without risking damaging my existing config file is a godsend. YAML is space-sensitive, so one thing in the wrong place screws you.<\/p>\n\n\n\n<p><code>curl -sL \"https:\/\/raw.githubusercontent.com\/home-assistant\/hassio-installer\/master\/hassio_install.sh\" | bash -s<\/code><\/p>\n\n\n\n<p>That&#8217;s the command to install it on Ubuntu with docker already running. You need it for this method. After running it, open the web ui and create a user etc. Don&#8217;t bother going further than being able to log in &#8211; we&#8217;re going to change a lot.<br><code>mkdir \/usr\/share\/hassio\/homeassistant\/custom_components<\/code><br><code>mkdir \/usr\/share\/hassio\/homeassistant\/www<\/code><br><code>mkdir \/usr\/share\/hassio\/homeassistant\/device_trackers<\/code><br><code>mkdir \/usr\/share\/hassio\/homeassistant\/sensors<\/code><br><code>mkdir \/usr\/share\/hassio\/homeassistant\/switches<\/code><br><code>mkdir \/usr\/share\/hassio\/homeassistant\/themes<\/code><br><code>mkdir \/usr\/share\/hassio\/homeassistant\/zones<\/code><\/p>\n\n\n\n<p>The above commands will create the folders for HACS, and separate sensor configs. They help immensely. Next, we&#8217;re going to replace the default configuration file.<\/p>\n\n\n\n<p><code>mv \/usr\/share\/hassio\/homeassistant\/configuration.yaml \/usr\/share\/hassio\/homeassistant\/configuration_default.yaml<\/code><\/p>\n\n\n\n<p>That renames the default. It&#8217;s only there as a backup, for if this next bit royally f***s itself.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># Configure a default setup of Home Assistant (frontend, api, etc)\ndefault_config:\n\n# Uncomment this if you are using SSL\/TLS, running in Docker container, behind a reverse proxy and exposed to the web etc.\n#  http:\n#    base_url: *YOUR HASS WEB ADDRESS*\n#    use_x_forwarded_for: true\n\n###########################################\n# Simple Components\n###########################################\nmap:\nsun:\n\n# Wake-on-LAN\n# https:\/\/home-assistant.io\/components\/switch.wake_on_lan\/\nwake_on_lan:\n\n###########################################\n# Text to speech\n###########################################\ntts:\n  - platform: google_translate\n    service_name: google_say\n\n###########################################\n# Frontend\n###########################################\nfrontend:\n  themes: !include_dir_merge_named themes\n\n###########################################\n# Includes\n###########################################\n# Single Files\nautomation: !include automations.yaml\nscript: !include scripts.yaml\nscene: !include scenes.yaml\n\n# All Files in Folder\ndevice_tracker: !include_dir_merge_list device_trackers\ngroup: !include_dir_merge_list groups\nsensor: !include_dir_merge_list sensors\nswitch: !include_dir_merge_list switches\nzone: !include_dir_merge_list zones<\/pre>\n\n\n\n<p>That needs to go into <code>\/usr\/share\/hassio\/homeassistant\/configuration.yaml<\/code><br>To achieve this, <code>nano \/usr\/share\/hassio\/homeassistant\/configuration.yaml<\/code>, followed by CTRL+O and CTRL+X (Overwrite and eXit).<\/p>\n\n\n\n<p>Open your Web UI and go to <code>Configuration<\/code> -> <code>Server Controls<\/code> -> <code>Restart<\/code>. HASS will restart and reload the new config. Now any <em>valid <\/em>config file you place in the relevant folder will be loaded when restarting HASS. I&#8217;ve got a few Wake-on-LAN switches in the switches folder, some sensors for sonarr and radarr in the sensors folder, and hacs in the custom_components folder. <br>More on that in posts to follow.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hass.IO Of all things, not something I expected I&#8217;d do. But, as it turns out &#8211; automation is definitely nice. I&#8217;ve got Wake-on-LAN working, and my lights etc &#8211; so I can turn on the lights in my office and boot up my workstation, with one button, on my phone. Everything is ready to use &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"https:\/\/www.berserkir.net\/wordpress\/home-assistant\/\">Continue reading<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[90,16,78],"tags":[89,94,91,92,93,26,95],"class_list":["post-341","post","type-post","status-publish","format-standard","hentry","category-home-automation","category-software","category-web-systems","tag-automation","tag-docker","tag-hass-io","tag-homeassistant","tag-smart-home","tag-software","tag-ubuntu","item-wrap"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.berserkir.net\/wordpress\/wp-json\/wp\/v2\/posts\/341","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.berserkir.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.berserkir.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.berserkir.net\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.berserkir.net\/wordpress\/wp-json\/wp\/v2\/comments?post=341"}],"version-history":[{"count":5,"href":"https:\/\/www.berserkir.net\/wordpress\/wp-json\/wp\/v2\/posts\/341\/revisions"}],"predecessor-version":[{"id":348,"href":"https:\/\/www.berserkir.net\/wordpress\/wp-json\/wp\/v2\/posts\/341\/revisions\/348"}],"wp:attachment":[{"href":"https:\/\/www.berserkir.net\/wordpress\/wp-json\/wp\/v2\/media?parent=341"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.berserkir.net\/wordpress\/wp-json\/wp\/v2\/categories?post=341"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.berserkir.net\/wordpress\/wp-json\/wp\/v2\/tags?post=341"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}