Commit 8fa0b5e0a8
Unsigned
Layout: unified · split
content/blog/2025-12-20-self-hosting-home-assistant.org added +136
| @@ -0,0 +1,136 @@ | |||
| 1 | #+date: <2025-12-20 Sat 20:27:08> | ||
| 2 | #+title: Self-Hosting Guide: Home Assistant | ||
| 3 | #+description: A guide to configuring and customizing Home Assistant. | ||
| 4 | #+slug: self-hosting-home-assistant | ||
| 5 | |||
| 6 | * Overview | ||
| 7 | |||
| 8 | I've used [[https://www.home-assistant.io][Home Assistant]] off and on for years, but I've never written a guide on | ||
| 9 | it because it always felt like a half-baked solution with my combinations of | ||
| 10 | products and my Home Assistant configuration. | ||
| 11 | |||
| 12 | However, Home Assistant looks much better these days and now has native [[https://help.ui.com/hc/en-us/articles/27878858632599-Getting-Started-with-UniFi-Protect][UniFi | ||
| 13 | Protect]] support, so I decided to switch back to using it full time and writing | ||
| 14 | up a proper guide to installing, configuring, and customizing the software. | ||
| 15 | |||
| 16 | * Installation | ||
| 17 | |||
| 18 | I happened to have a spare Raspberry Pi 4 sitting around I wasn't using, so I | ||
| 19 | opted for the [[https://www.home-assistant.io/installation/raspberrypi][Raspberry Pi]] installation tutorial from Home Assistant. This | ||
| 20 | tutorial guides you through the flashing of Home Assistant OS to an SD card and | ||
| 21 | initialization of the software. | ||
| 22 | |||
| 23 | This process is seamless and will result in a ready-to-use device with Home | ||
| 24 | Assistant. | ||
| 25 | |||
| 26 | * Configuration | ||
| 27 | |||
| 28 | Once the device is ready, all you need to do is create your account and complete | ||
| 29 | the initial setup wizard within the Home Assistant page (e.g., | ||
| 30 | =homeassistant.local:8123=). | ||
| 31 | |||
| 32 | At this point, you will have a functioning Home Assistant deployment. However, I | ||
| 33 | want to go further and configure the service to use my personal devices and | ||
| 34 | display information via customized interfaces. | ||
| 35 | |||
| 36 | To start with our configuration, we will visit the =Settings= > =Devices & | ||
| 37 | services= page. This page will display all currently configured integrations, as | ||
| 38 | well as automatically discovered integrations that you can configure. | ||
| 39 | |||
| 40 | [[https://img.cleberg.net/blog/20251220-self-hosting-home-assistant/integrations.webp]] | ||
| 41 | #+caption: Integrations | ||
| 42 | |||
| 43 | ** HACS | ||
| 44 | |||
| 45 | Another integration of note is the [[https://hacs.xyz][Home Assistnat Community Store (HACS)]], which | ||
| 46 | provides a familiar integration into the Home Assistant UI that allows you to | ||
| 47 | manage custom elements. | ||
| 48 | |||
| 49 | If you installed Home Assistant like I did using the OS method, you will need to | ||
| 50 | install the Get-HACS integration to install HACS and then restart Home Assistant | ||
| 51 | to start utilizing these custom elements. | ||
| 52 | |||
| 53 | Personally, I am using HACS in order to utilize the [[https://github.com/dahlb/ha_hatch][Hatch Rest]] integration for | ||
| 54 | my Hatch Rest Mini, Rest+, and Restore. | ||
| 55 | |||
| 56 | You can see it here in my =Media= dashboard: | ||
| 57 | |||
| 58 | [[https://img.cleberg.net/blog/20251220-self-hosting-home-assistant/media.webp]] | ||
| 59 | #+caption: Media Dashboard | ||
| 60 | |||
| 61 | Once you have installed all relevant integrations and synced your devices to | ||
| 62 | Home Assistant, you are ready to build your dashboards. | ||
| 63 | |||
| 64 | ** External Access | ||
| 65 | |||
| 66 | If you want to be able to external your instance externally, you will need to | ||
| 67 | expose the service to the internet somehow. One option is a reverse proxy, such | ||
| 68 | as Nginx, which I have covered in numerous self-hosting posts. Another option is | ||
| 69 | Cloudflare Tunnels, which I will cover here. | ||
| 70 | |||
| 71 | Configuring a tunnel to Home Assistant OS takes a few more steps than a normal | ||
| 72 | reverse proxy, but I currently find the security benefits worthwhile. | ||
| 73 | |||
| 74 | To start, install the [[https://github.com/homeassistant-apps/app-cloudflared][app-cloudflared]] app in the Add-ons menu within Home | ||
| 75 | Assistant. | ||
| 76 | |||
| 77 | Once installed, follow the instructions to configure the =External Home | ||
| 78 | Assistant Hostname=, =Cloudflare Tunnel Name=, and the =Cloudflare Tunnel Token= | ||
| 79 | within the Configuration tab of the installed add-on. Once configured, I | ||
| 80 | restarted Home Assistant to start fresh. | ||
| 81 | |||
| 82 | Next, I opened Cloudflare and configured the tunnel to expore the | ||
| 83 | =ha.example.com= domain to the =homeassistant.local:8123= address in | ||
| 84 | Cloudflare's Zero Trust dashboard. | ||
| 85 | |||
| 86 | From here, I can access Home Assistant anywhere I go from the =ha.example.com= | ||
| 87 | domain. | ||
| 88 | |||
| 89 | * Customization | ||
| 90 | |||
| 91 | Finally, let's customize our dashboards. The view below is my standard view when | ||
| 92 | greeted by my dashboard. | ||
| 93 | |||
| 94 | As you can see, I choose to keep general information in the main tab, such as | ||
| 95 | weather, time, and location. Instead of jamming every widget into a single tab, | ||
| 96 | I separate my tabs by function: | ||
| 97 | |||
| 98 | - Media: TVs, Speakers, and other playable entities | ||
| 99 | - Cameras: UniFi Protect cameras | ||
| 100 | - Lights: Hue bulbs and other lighting systems | ||
| 101 | - IoT: Other miscellaneous devices, such as printers, my Litter Robot, Roomba, | ||
| 102 | etc. | ||
| 103 | |||
| 104 | [[https://img.cleberg.net/blog/20251220-self-hosting-home-assistant/dashboard.webp]] | ||
| 105 | #+caption: Dashboard | ||
| 106 | |||
| 107 | When editing a dashboard, you're presented with a myriad of options. First, you | ||
| 108 | can choose to use a number of layout options (sections, masonry, sidebar, and | ||
| 109 | single card). Next, each element you add to the dashboard any number of | ||
| 110 | entities, names, themes, states, and more to configure. | ||
| 111 | |||
| 112 | Honestly, I had forgotten how customizable these dashboards were and I will | ||
| 113 | absolutely spend a lot of time customizing for very specific needs. | ||
| 114 | |||
| 115 | See below for some examples of editing and IoT elements: | ||
| 116 | |||
| 117 | [[https://img.cleberg.net/blog/20251220-self-hosting-home-assistant/edit.webp]] | ||
| 118 | #+caption: Editing Interface | ||
| 119 | |||
| 120 | [[https://img.cleberg.net/blog/20251220-self-hosting-home-assistant/iot.webp]] | ||
| 121 | #+caption: IoT Dashboard | ||
| 122 | |||
| 123 | Once you have configured and customized your dashboards to your heart's content, | ||
| 124 | you're reading to start automating and more! I highly suggest browsing the web | ||
| 125 | and Home Assistant forums for ideas and solutions that fit your needs. There are | ||
| 126 | more possibilities to this platform than you'll likely ever be able to use. | ||
| 127 | |||
| 128 | ** Mobile View | ||
| 129 | |||
| 130 | Before I finish this post, I wanted to show how reliable the mobile view of the | ||
| 131 | platform displays. These screenshots were captured on the iOS Home Assistant | ||
| 132 | app, using the remote URL for my instance. | ||
| 133 | |||
| 134 | | Dashboard | Entity | | ||
| 135 | |-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------| | ||
| 136 | | [[https://img.cleberg.net/blog/20251220-self-hosting-home-assistant/mobile_dashboard.webp]] | [[https://img.cleberg.net/blog/20251220-self-hosting-home-assistant/roomba.webp]] | | ||