Draft work: Home assistant my home (part 1)

This commit is contained in:
Felipe Martin 2020-12-05 23:46:39 +01:00
parent 13f2e82c57
commit 644d4d0e57
Signed by: fmartingr
GPG Key ID: 716BC147715E716F
5 changed files with 79 additions and 10 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View File

@ -1,4 +1,4 @@
title: Self hosting my home (part 1)
title: Home Assistant my home (part 1)
---
_discoverable: no
---
@ -6,14 +6,83 @@ pub_date: 2021-12-31
---
body:
- Move installation to USB / Install directly to USB?
- Since I already have the base ready, I would just move it.
- add persons, devices and picutres
- Install file editor
- Mysql
- modify commit and prune days
- backups
- Chromecast
- Weather
Summary
I wanted to install this on a USB Drive, but apparently that's still not supported for _Home Assistant OS_, so I'm stuck with an SD Card for now. The latest development version (as of writting) does support it but I'd rather go with the stable release.
## Base Home Assistant OS using an SD Card
For this just stick to the [official documentation](https://www.home-assistant.io/hassio/installation/). Only download the latest release [from github](https://github.com/home-assistant/operating-system/releases) and copy the _img_ card to your SD Card with `dd`, Balena or the tool of choice.
Put the SD Card on your Pi, turn it on and let's get started.
## Base installation
After booting, you will be welcomed with a wizard installation. Just follow the basic instructions to generate the main user/account, and the name and location for your home assistant.
Bonus: Use some website [like this](https://www.freemaptools.com/elevation-finder.htm) to get your elevenation if you're feeling picky.
After that, you will be greeted by something similar to this:
[![Base install after the wizard](./base-360.png)](./base.png)
## Update the system
Go to your Supervisor tab and check if you have any pending updates.
## Moving to MariaDB
The default database backend is SQLite, and that has it's limitations, so let's move everything to MariaDB before any other configuration.
1. Install the File editor addon from **Supervisor > Add-ons > File editor** and start it.
2. Install the MySQL addon from **Supervisor > Add-ons > MariaDB**
3. Once installed, go to the configuration tab and set a password
4. Under the Info tab start the MariaDB Service and enable the Watchdog service
5. Go to the file editor interface and edit the `configuration.yaml` file.
6. Add the configuration for the [`recorder`](https://www.home-assistant.io/integrations/recorder/) integration:
``` yaml
recorder:
db_url: mysql://homeassistant:<password>@core-mariadb/homeassistant?charset=utf8
commit_interval: 5
purge_keep_days: 90
history:
```
In this case I also set data to be stored for 90 days and a 5s delay between disk writes (since I'm using an SD Card and their lifespan is not very long with abundant I/O).
More information on the documentation: [`recorder`](https://www.home-assistant.io/integrations/recorder/), [`history`](https://www.home-assistant.io/integrations/history/)
7. Restart Home Assistant for the changes to take effect under **Configuration > Server Constrols > Restart**.
## Backups
TODO
## Setting up accounts and users that will use the system
This used to be more complex a while ago, now you only need to go to **Configuration > People** and add the users you need.
Now you can even add the avatar directly from the interface! Back in the day you required to upload the file and fidling with YAMLs.
## Adding integrations
TODO Summary
[![Notification telling that devices where found on network](./notification-360.png)](./notification.png)
### Chromecast
One of the simplest things to set up, just go to your integrations and add it. It will prompt you to select in which rooms each chromecast device is and that's it.
[![Chromecast configuration](./chromecast-360.png)](./chromecast.png)
### Weather (OpenWeatherMap)
Can't say much than I'm using the [`OpenWeatherMap`]() integration. You just need to register to the service and enable the integration under **Configuration > Integrations > OpenWeatherMap**, supply your API key and set the mode to __onecall_hourly__.
I had to wait for an hour or so until the API Key was valid for the integration to use.
## Phillips Hue
---
_discoverable: no

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB