You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Home Assistant is a home automation platform running on Python 3. It is able to track and control all devices at your home and offer a platform for automating control.
3
+
Home Assistant is a home automation platform. It is able to track and control all devices at your home and offer a platform for automating control.
4
4
5
5
## <aname="references"> References </a>
6
6
@@ -17,189 +17,23 @@ Home Assistant is a home automation platform running on Python 3. It is able to
17
17
18
18
There are two versions of Home Assistant:
19
19
20
-
*Hass.io (Home Assistant Core), and
21
-
* Home Assistant Container.
20
+
* Home Assistant Container; and
21
+
*Supervised Home Assistant (also known as both "Hass.io" and "Home Assistant Core").
22
22
23
23
Each version:
24
24
25
25
* provides a web-based management interface on port 8123; and
26
26
* runs in "host mode" in order to discover devices on your LAN, including devices communicating via multicast traffic.
27
27
28
-
IOTstack allows you to **install**either, or both, versions.
28
+
Home Assistant Container runs as a **single**Docker container, and doesn't support all the features that Supervised Home Assistant does (such as add-ons). Supervised Home Assistant runs as a **collection** of Docker containers under its own orchestration.
29
29
30
-
Note:
30
+
Technically, both versions of Home Assistant can be installed on your Raspberry Pi but you can't **run** both at the same time. Each version runs in "host mode" and binds to port 8123 so, in practice, the first version to start will claim the port and the second will then be blocked.
31
31
32
-
* Technically, both versions can **run** at the same time but it is not **supported**. Each version runs in "host mode" and binds to port 8123 so, in practice, the first version to start will claim the port and the second version will then be blocked.
33
-
34
-
### <aname="versionHassio"> Hass.io </a>
35
-
36
-
Hass.io uses its own orchestration:
37
-
38
-
* hassio\_supervisor
39
-
* hassio\_audio
40
-
* hassio\_cli
41
-
* hassio\_dns
42
-
* hassio\_multicast
43
-
* hassio\_observer
44
-
* homeassistant.
45
-
46
-
IOTstack can only offer limited configuration of Hass.io since it is its own platform.
47
-
48
-
### <aname="versionHAContainer"> Home Assistant Container </a>
49
-
50
-
Home Assistant Container runs as a single Docker container, and doesn't support all the features that Hass.io does (such as add-ons).
51
-
52
-
## <aname="menuInstallation"> Menu installation </a>
* If you are definitely going to install Hass.io then you **must** install its dependencies **before** you install Docker.
59
-
* One of Hass.io's dependencies is [Network Manager](https://wiki.archlinux.org/index.php/NetworkManager). Network Manager makes **serious** changes to your operating system, with side-effects you may not expect such as giving your Raspberry Pi's WiFi interface a random MAC address both during the installation and, then, each time you reboot. You are in for a world of pain if you install Network Manager without first understanding what is going to happen and planning accordingly.
60
-
* If you don't install Hass.io's dependencies before you install Docker, you will either have to uninstall Docker or rebuild your system. This is because both Docker and Network Manager adjust your Raspberry Pi's networking. Docker is happy to install after Network Manager, but the reverse is not true.
61
-
62
-
#### <aname="uninstallDocker"> Step 1: If Docker is already installed, uninstall it </a>
#### <aname="useEthernet"> Step 4: Connect to your Raspberry Pi via Ethernet </a>
89
-
90
-
You can skip this step if you interact with your Raspberry Pi via a screen connected to its HDMI port, along with a keyboard and mouse.
91
-
92
-
If, however, you are running "headless" (SSH or VNC), we **strongly recommend** connecting your Raspberry Pi to Ethernet. This is only a temporary requirement. You can return to WiFi-only operation after Hass.io is installed.
93
-
94
-
When the Ethernet interface initialises, work out its IP address:
95
-
96
-
```bash
97
-
$ ifconfig eth0
98
-
99
-
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
The reason for stipulating the IP address, rather than a name like `raspberrypi.local` is so that you are *definitely* connected to the Ethernet interface.
123
-
124
-
If you ignore the advice about connecting via Ethernet and install Network Manager while your session is connected via WiFi, your connection will freeze part way through the installation (when Network Manager starts running and unconditionally changes your Raspberry Pi's WiFi MAC address).
125
-
126
-
You *may* be able to re-connect after the WiFi interface acquires a new IP address and advertises that via multicast DNS associated with the name of your device (eg `raspberrypi.local`), but you may also find that the only way to regain control is to power-cycle your Raspberry Pi.
127
-
128
-
The advice about using Ethernet is well-intentioned. You should heed this advice even if means you need to temporarily relocate your Raspberry Pi just so you can attach it via Ethernet for the next few steps. You can go back to WiFi later, once everything is set up. You have been warned!
You can re-install Docker using the IOTstack menu or one of the scripts provided with IOTstack but the following commands guarantee an up-to-date version of `docker-compose` and also include a dependency needed if you want to run with the 64-bit kernel:
* Installing or re-installing Docker does **not** interfere with your existing `~/IOTstack` folder.
171
-
172
-
#### <aname="runHassioInstall"> Step 8: Run the Hass.io installation </a>
173
-
174
-
Start at:
175
-
176
-
```bash
177
-
$ cd~/IOTstack
178
-
$ ./menu.sh
179
-
```
180
-
181
-
Hass.io installation can be found inside the `Native Installs` menu on the main menu. You will be asked to select your device type during the installation.
182
-
183
-
The installation of Hass.io takes up to 20 minutes (depending on your internet connection). You may also need to respond "Y" to a prompt during the installation process. Refrain from restarting your machine until it has come online and you are able to create a user account.
184
-
185
-
Hass.io installation is provided as a convenience. It is independent of, is not maintained by, and does not appear in the `docker-compose.yml` for IOTstack. Hass.io has its own service for maintaining its uptime.
186
-
187
-
#### <aname="disableRandomMac2"> Re-check random MAC address allocation </a>
188
-
189
-
Installing Hass.io can re-enable random MAC address allocation. You should check this via:
190
-
191
-
```bash
192
-
$ tail -3 /etc/NetworkManager/NetworkManager.conf
193
-
[device]
194
-
wifi.scan-rand-mac-address=no
195
-
196
-
```
197
-
198
-
If you do **NOT** see `wifi.scan-rand-mac-address=no`, repeat [Step 6](#disableRandomMac1).
32
+
IOTstack used to offer a menu entry leading to a convenience script that could install Supervised Home Assistant but that stopped working when Home Assistant changed their approach. Now, the only method supported by IOTstack is Home Assistant Container.
199
33
200
34
### <aname="installHAContainer"> Installing Home Assistant Container </a>
201
35
202
-
Home Assistant can be found in the `Build Stack` menu. Selecting it in this menu results in a service definition being added to:
36
+
Home Assistant (Container) can be found in the `Build Stack` menu. Selecting it in this menu results in a service definition being added to:
###<aname="installHASupervised"> Installing Supervised Home Assistant </a>
226
60
227
-
Because Hass.io is independent of IOTstack, you can't deactivate it with any of the commands you normally use for IOTstack.
61
+
The direction being taken by the Home Assistant folks is to supply a ready-to-run image for your Raspberry Pi. That effectively dedicates your Raspberry Pi to Home Assistant and precludes the possibility of running alongside IOTstack and containers like Mosquitto, InfluxDB, Node-RED, Grafana, PiHole and WireGuard.
228
62
229
-
To deactivate Hass.io you first need to stop the service that controls it. Run the following commands in the terminal:
63
+
It is possible to run Supervised Home Assistant on the same Raspberry Pi as IOTstack. The recommended approach is to start from a clean slate and use [PiBuilder](https://github.com/Paraphraser/PiBuilder).
When you visit the PiBuilder link you may well have a reaction like "all far too complicated" but you should try to get past that. PiBuilder has two main use-cases:
235
66
236
-
This will stop the main service and prevent it from starting on the next boot. Next you need to stop and remove the dependent services:
67
+
1. Getting a Raspberry Pi built for IOTstack (and, optionally, Supervised Home Assistant) with the least fuss.
68
+
2. Letting you record all your own customisations so that you can rebuild your Pis quickly with all your customisations already in place (the "magic smoke" scenario).
It's the second use-case that produces most of the apparent complexity you see when you read the [PiBuilder README](https://github.com/Paraphraser/PiBuilder/blob/master/README.md) for the first time.
71
+
72
+
The first time you use PiBuilder, the process boils down to:
73
+
74
+
1. Clone the PiBuilder repo onto your support host (Mac, Windows, etc).
75
+
2. Customise two files within the PiBuilder scope:
76
+
77
+
- `wpa_supplicant.conf`
78
+
- `options.sh` where, among other things, you will enable:
79
+
80
+
- `HOME_ASSISTANT_SUPERVISED_INSTALL=true`
81
+
82
+
3. Choose a Raspbian image and transfer it to your installation media (SD/SSD). The imaging tools typically finish by ejecting the installation media.
83
+
4. Re-mount the installation media on your support host and either:
242
84
243
-
Double-check with `docker ps` to see if there are other containers running with a `hassio_` prefix. They can stopped and removed in the same fashion for `hassio_audio` and so-on.
85
+
- Run the supplied `setup_boot_volume.sh` script (if your support host is macOS or Unix); or
86
+
- Just drag the *contents* of the PiBuilder "boot" folder into the top level of the "/boot" partition on your installation media (if your support host is Windows).
244
87
245
-
The stored files are located in `/usr/share/hassio` which can be removed if you need to.
88
+
5. Move the installation media to your Raspberry Pi and apply power.
89
+
6. Run the scripts in order:
246
90
247
-
You can use Portainer to view what is running and clean up the unused images.
91
+
Step | Command run on support host | Command run on Raspberry Pi
At this point, Hass.io is stopped and will not start again after a reboot. Your options are:
105
+
where «name» is the name you give to your Raspberry Pi (eg "iot-hub").
250
106
251
-
* Leave things as they are; or
252
-
* Re-install Hass.io by starting over at [Installing Hass.io](#installHassio); or
253
-
* Re-activate Hass.io by:
107
+
After step 9, Supervised Home Assistant will be running. The `04_setup.sh` script also deals with the [random MACs](#aboutRandomMACs) problem. After step 11, you'll be able to either:
254
108
255
-
```bash
256
-
$ sudo systemctl enable hassio-supervisor.service
257
-
$ sudo systemctl start hassio-supervisor.service
258
-
```
109
+
1. Restore a backup; or
110
+
2. Run the IOTstack menu and choose your containers.
259
111
260
112
## <aname="aboutRandomMACs"> Why random MACs are such a hassle </a>
0 commit comments