Putting Home Assistant onto a card will eventually murder the card with all the writes it does from the sensors. So I got myself a cheap portable SSD. Overall I am happy with the size of it and after a little bit of fiddling with the Pi 4 I ended up getting it to boot.
| Part | Name | Price |
|---|---|---|
![]() | Netac 250GB Portable SSD, USB3.2 Gen2 10Gbps | $39.99 |
![]() | SaiTech IT 4 Pack Short Length USB 3.0 Extension Cable | $14.99 |
![]() | Valtcan Solder Smoke Absorber Fume Extractor Fan | $69.99 |
| Total | $124.97 |
First I started out by shuttind down my existing home assistant setup and taking an image of the SD Card. Then I restored that backup to the SSD in the hopes that I could just boot as is without losing any data.
The bootloader that I had on the Pi 4 said it supported booting from USB so I configured it to do so in raspi-conf and it didnt work. It simply looked like it wasn't even powering on the USB port and attempting to boot.
I then followed this guide at Toms Hardware to make sure I updated the bootloader to the most current version. This got me a little farther in that it looks like it at least powered on the USB drive and then went to a black screen where I presume it couldnt figure out how to start the HASS Os.
This gave me some pause and I really didnt want to go through setting it up again but I booted up my old setup and backed up my config using the Home Assistant snapshot feature and then downloaded it for later. Then I installed the Raspberry Pi 4 default 64bit OS and it booted like a champ. Turns out there is installation instructions for Installing Home Assistant Supervised on Raspberry Pi OS this sounded like exactly the guide for me so I followed it and was presented with the homeassistant login after not too long.
Restored my previously downloaded snapshot and pretty much everything came up just like it was minus the previous history (which is not part of the snapshot). Only the Tesla Integration was really having trouble working and that just required a delete and reinstall of that plugin. Only other thing to note was that the zigbee addon didnt really find anything on startup but a reboot of that addon got everything up and running again. So far so good just history to get a handle on.
So I was missing the history and that was fine but for some reason the history tab was not really working anymore. Kinda looked around and found that you have to reset the database after a restore, but I was experiencing pretty poor performance already with the integrated SQL Lite database and did find out you can run a proper mysql instance to get a little bit better performance. So off I go to setup mysql
This wasn't too hard but there were some gotchas.
I installed the Potainer addon to make it easier on myself and I had lots of experience with docker but none with Potainer so it was kinda fun to streamline stuff into that thing. Lots of writeups tell you that you should use the https://hub.docker.com/r/hypriot/rpi-mysql/ container but it doesnt seem to work on 64 bit which is what I had installed ...Womp Womp...
I ened up finding https://hub.docker.com/r/mysql/mysql-server/ and using mysql/mysql-server:latest-aarch64 came up great but
it resets the root password and you cant really get into it... or at least everything I tried didnt work. Turns out
you can set up the environment variables
MYSQL_ROOT_PASSWORD
MYSQL_USER
MYSQL_PASSWORD
MYSQL_DATABASE
and it will initialize the database user for you. Set up a volume for simplicity of data and I was off and running
to get the history flowing into mysql you have to modify your configuration.yaml file and add the following
recorder:
db_url: mysql://hassuser:<your password>@<mysql host address>/hassio_db
Note: assigning your pi a static ip is pretty useful for this setup
And that was that ... history was back in home assistant. Only problem I have remaining is that the mysql container doesnt seem to start automatically so I need to do a little more setup to get it to start on boot.
The pi usb ports weren't playing nice with the zigbee and zwave usb sticks (they were physically running into each other) getting some short extension cables was the only solution I could think of so found some cheap 1" extensions.MySql
My wife had the idea to convert some of her accent candles over to be controlled by homeassistant so I have been doing some soldering lately. It wasn't very fun breathing in fumes so I figure its about time I at least get a small fan and save my lungs the smoke. Just arrived today so if I remember I will let you know how that one works.