Installing Reactor on Home Assistant OS
Before following this procedure, you should have Home Assistant OS installed, configured, up and running on your target hardware.
To run Reactor on Home Assistant OS, you will install Portainer, a tool for managing containers via a graphical user interface (GUI). To install Portainer:
- Log in to your Hass system
- Go to Supervisor (left margin)
- Click Add-on Store (top of page)
- Type
Portainer
in the search field. - Click on the Portainer listing.
- Click on INSTALL.
- When the install completes, click START.
NOTE: I had to turn "Protection Mode" off to get Portainer to start and run on my system.
- When Portainer has started, click OPEN WEB UI
Now that Portainer is installed and running, let's create and start the Reactor container. Before you dive into this, you'll need to device where you want to
store your Reactor data. The Reactor data (which includes configuration, state data, logs, etc.) needs to be stored outside the container, or you'll lose all
of your settings and rules every time you upgrade/recreate the container. You have several choices here, including CIFS and NFS volumes that you may have mounted
in your HassOS configuration. For this procedure, we'll keep it simple and just store it in your user home directory (in /home/username
) on the HassOS system.
- Create your Reactor data directory. You can do this via SSH by logging in and typeing
mkdir -p /home/username/reactor-data
or you can use the XXXX to navigate to your user home directory and create the directory (folder) in the GUI. - In the Portainer UI, click on "Primary"
- Click Volumes
- Click Add volume
- Name the volume
reactor-data
- If you want your Reactor data stored on a NFS or CIFS share, turn that on and provide the requested configuration. Otherwise, leave both switches off.
- Click Create the volume. Portainer will show you the location of the container mount point.
- Click Containers (left margin)
- Click the Add container button
- For the container name, enter
Reactor
- Make sure DockerHub is the selected registry.
- In the Image field, type
toggledbits/reactor:tag
, wheretag
islatest-raspbian-armv7l
for the latest version of Reactor (developer builds), or a released version tag (e.g.1.0.0-raspbian-armv7l
). - Turn the Always pull the image switch on if you want Portainer to download a new image for each startup of the container. This may be useful if you're using
latest
to keep pace with development updates, but you risk downloading a broken/unstable image here, so it may be better to turn it off and upgrade the container manually when changes occur that you think you need. If you've selected a fixed version image (e.g.toggledbits/reactor:1.0.0-etc
), leave this switch off. POTENTIALLY SLOW: Maybe not recommended to be on? - In the Network ports configuration, click public a new network port (button next to Manual network port publishing), and enter 8111 in both fields (and click the TCP button).
- Under Advanced container settings, click Volumes
- Next to Volume mapping, click map additional volume
- Next to container", enter
/var/reactor
and then click the Volume* button. - Next to volume, select the volume previously created (
reactor-data
) and then click the Writable button. - Click on Env. If
TZ
is not listed, click on add environment variable and addTZ
with the value set to your local time zone (list of valid time zone names). - Click on Restart policy, and choose on On failure from the available options.
- Click Deploy the container (above the Advanced container settings section). It may take a few minutes to start if the image needs to be downloaded/updated.
If you need to view or change any of the container settings later, stop the container by selecting it in the list and clicking the Stop button. Then click on the container name, and click the Duplicate/Edit button. After editing whatever you need to change, click "Deploy the container*.
NOTE: There seems to be a bug in Portainer where it changes the volume during editing. Make sure you check that
reactor-data
is the selected volume before you redeploy any edits.
Upgrading your Container
If you turned on the Always pull the image switch when configuring the container, then:
- If you are using
latest
, your container automatically updates when you restart it. - If you are using a fixed version, update the image tag to the new version you want to run.
If Always pull the image is off:
- If you are using
latest
, stop the container, and then go to Images (left margin). Find thetoggledbits/reactor
image in the list, and click on the Id link in the row. Under Image tags you'll see the image's tag, and a download icon button (hover the cursor over the button, it should say "Pull from registry"). Click it. When you get a notification that the download has finished, restart the container. - If you are using a fixed version (or want to use a fixed version), stop the container, then click its name, then click Duplicate/Edit and change the image tag to that of the new image you want to use. Then start the container.
Finding Your Configuration and Log Files
The configuration and log files are stored in the directory listed under Volumes,
Install SSH * Turn on Advanced Mode in your user profile. * Go to Supervisor and choose an SSH tool (the official Terminal & SSH is a good choice if you're not sure). * When the install completes (it takes a couple of minutes), click START. * Go to COnfiguration for the add-on, and either add a password or add an authorized key. *