Hardware
- Raspberry Pi 4
- 5V 3A power supply
- 128GB SD card
Software
- Synpse - provides app deployment, SSH and HTTPS access.
- Gladys - a privacy-first, open-source home assistant.
- Ubuntu 20.04.2 LTS image. Feel free to use Raspberry Pi OS (previously called Raspbian).
- Docker - deploying containers on the edge devices prevents a lot of issues.
Intro
There are multiple ways listed on setting up the Gladys Home Assistant on your PC/laptop/RaspberryPi in the official docs https://gladysassistant.com/docs/. However, most of them lack things like ensuring remote HTTPS access to your Gladys instance, SSH, updates and so on. We will try to address them :)
In this short tutorial we will setup a Gladys on a RaspberryPi. Using this installation method you will get few great things out of the box:
- Monitor your device uptime, CPU/RAM metrics.
- SSH from anywhere, even if you can’t ping your device directly.
- Public HTTPS URL to connect to Gladys from anywhere in a form https://dev-{YOUR ID}.synpse.cloud
Step 1: Install Docker
Depending on your RaspberryPi OS Docker installation might vary but in most cases this script from https://docs.docker.com/engine/install/ubuntu should do the job:
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
Step 2: Install Synpse agent on your device
Log into your Synpse account, navigate to the “Devices” section and then click on “Provision”. Use the command in your RaspberryPi terminal. This will download, install and initialize the synpse agent.
Once the device has appeared in your Synpse dashboard:
Once device is visible, click on the “edit labels” from the menu. Add a label ‘type: rpi’:
In Synpse, applications are installed into the devices based on device labels so it’s a good practice to label your devices accordingly.
Step 3: Create Gladys deployment
Applications in Synpse are defined in yaml format. If you have used Docker Compose or Kubernetes before, it will feel familiar. You can read more about them here.
To create the application:
- Select the namespace (should be ‘default’ on the left side menu)
- Click on “New Application” button in the top
- Copy paste the yaml from below
Or, login into cloud.synpse.net and click on the button below:
Deployment spec that you can copy to Synpse looks like this:
|
|
Data on the device will be stored in the /data/gladysassistant/ directory. This will ensure that after updating the Gladys Assistant Docker image your configuration doesn’t disappear.
Getting public HTTPS URL to Gladys
To connect to Gladys you can either access it directly on http://
After enabling, you should see your device URL in a format similar to https://xxx.synpse.cloud . Open it and complete the initial configuration steps (or restore it from the previous backup). Once done, you should have your username/password based authentication on the public URL:
SSH access
Through Synpse you can always using web interface to open an SSH terminal to your device. Use this when debugging any issues or downloading/uploading backups from your device:
Next steps
Try connecting Gladys to your local Hue bridge or deploy Node-RED next to the Gladys for additional low-code automation! We have a blog post on deploying Node-RED container as well here.