{"id":350,"date":"2020-06-09T15:56:02","date_gmt":"2020-06-09T03:56:02","guid":{"rendered":"https:\/\/www.berserkir.net\/wordpress\/?p=350"},"modified":"2020-06-09T15:56:06","modified_gmt":"2020-06-09T03:56:06","slug":"home-assistant-you-git","status":"publish","type":"post","link":"https:\/\/www.berserkir.net\/wordpress\/home-assistant-you-git\/","title":{"rendered":"Home Assistant&#8230; you git."},"content":{"rendered":"\n<p>See what I did there? #dadjoke (I know, I&#8217;ll show myself out).<\/p>\n\n\n\n<p>Seriously though, with the amount of time and effort I have put in so far (and will continue to put in), I thought it was time to give myself a little bit of a backup of my HomeAssistant config. Looking around, github seemed the best option.<\/p>\n\n\n\n<p>Sure, there are issues with this option. I can&#8217;t backup passwords to it, or API keys &#8211; but I have a few systems for those, that are also passworded.<br><s>I have to manually update it when I make changes.<\/s><\/p>\n\n\n\n<p>Why&#8217;s that crossed out? Because yes, I do &#8211; but that&#8217;s not an issue. In fact, version control is the whole point of this.<br>If I make a change that breaks something, I simply revert to the previous commit. I can make a branch to test something, risk free &#8211; and remove it later on, safely.<\/p>\n\n\n\n<p>So where is it? Well, <a href=\"https:\/\/github.com\/Berserkir-Wolf\/hass-config\" rel=\"nofollow\" title=\"HAss Config Repo\">here<\/a>. It&#8217;s running.<br>I created the repo on github, initialised the repo in the config folder, added a &#8216;remote&#8217; url, and pushed my existing config up to my repo.<br>Yes, I had to specify a .gitignore file &#8211; so that any text-to-speech snippets didn&#8217;t upload, no passwords, device histories, geolocations, etc &#8211; but that&#8217;s fine. Those are all things that I can recreate from my secure storage, with my notes. And I&#8217;m working on keeping better code notes, because it&#8217;s getting ridiculous.<\/p>\n\n\n\n<p>Best part? I can use a nice editor on any machine I like, make the changes, and push them to the repo. Then, I can run my update-hass script via ssh, which does a git pull and a hass restart. Awesome.<\/p>\n\n\n\n<p>Eventually, maybe, I&#8217;ll automate that part &#8211; maybe a button inside hass to run a shell command for git pull? We will have to see.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>See what I did there? #dadjoke (I know, I&#8217;ll show myself out). Seriously though, with the amount of time and effort I have put in so far (and will continue to put in), I thought it was time to give myself a little bit of a backup of my HomeAssistant config. Looking around, github seemed &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"https:\/\/www.berserkir.net\/wordpress\/home-assistant-you-git\/\">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,96,92,93],"class_list":["post-350","post","type-post","status-publish","format-standard","hentry","category-home-automation","category-software","category-web-systems","tag-automation","tag-hass","tag-homeassistant","tag-smart-home","item-wrap"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.berserkir.net\/wordpress\/wp-json\/wp\/v2\/posts\/350","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=350"}],"version-history":[{"count":1,"href":"https:\/\/www.berserkir.net\/wordpress\/wp-json\/wp\/v2\/posts\/350\/revisions"}],"predecessor-version":[{"id":351,"href":"https:\/\/www.berserkir.net\/wordpress\/wp-json\/wp\/v2\/posts\/350\/revisions\/351"}],"wp:attachment":[{"href":"https:\/\/www.berserkir.net\/wordpress\/wp-json\/wp\/v2\/media?parent=350"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.berserkir.net\/wordpress\/wp-json\/wp\/v2\/categories?post=350"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.berserkir.net\/wordpress\/wp-json\/wp\/v2\/tags?post=350"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}