Home Assistant With Version Control

Overview

Home Assistant works half in system (e.g. UI integrations) and half in YAML Ain’t Markup Language (YAML). YAML files are usually stored as .yml or .yaml (Home Assistant works best with the latter). More and more features are available in front end but one thing I miss is version control. Version control main benefit is the ability to go back to a prior (hopefully working) version if I mess anything up without having to do a full snapshot (backup) restore of the whole system.

Other benefits are comparing different versions if an automation doesn’t work quite as intended.

Pre-Requisites

Understanding of version control and more specifically git is required.

Follow these instructions to get git setup. This should be a minimum to get files managed in a modern version control.

Sharing your configuration on GitHub

The steps you need to complete depends on your tools (below). The minimum would be Step 5.

Additional Tools

I’d recommend Visual Studio Code (VSCode) add-on. It natively supports Git and has built in syntax highlighting, checking and formatting for YAML files.

VSCode also gives a visual way to manage your code repository as well without having to use the script on step 6 in Sharing your configuration on GitHub.

And a list of changes which you can see the changes before the change or compare it to your current file.

Summary

Once it’s setup, the power of version control comes into play. From historical log of changes to branching.

My configuration can be found here.

About Danny

I.T software professional always studying and applying the knowledge gained and one way of doing this is to blog. Danny also has participates in a part time project called Energy@Home [http://code.google.com/p/energyathome/] for monitoring energy usage on a premise. Dedicated to I.T since studying pure Information Technology since the age of 16, Danny Tsang working in the field that he has aimed for since leaving school. View all posts by Danny → This entry was posted in Home Automation, Infrastructure and tagged , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *.

All comments must go through an approval and anti-spam process before appearing on the website. Please be patience and do not re-submit your comment if it does not appear.

This site uses Akismet to reduce spam. Learn how your comment data is processed.