This is a revisit of https://gist.github.com/BillyNate/d3124edfa903f288bfc8b7f37a155971, but using some different methods.
These are the steps taken to have Home Assistant 2025.7.1 with Python 3.13 on piCore 16
Newer version might work as well (or maybe even better), but have not been tested.
Follow steps of Basic setup of TinyCore/PiCore on a Raspberry Pi
- Install dependencies:
tce-load -wi squashfs-tools - Download, untar, pack, install & cleanup:
mkdir -p ./tmp/usr/local/bin && \ wget https://github.com/astral-sh/uv/releases/latest/download/uv-aarch64-unknown-linux-musl.tar.gz && \ tar xvf uv-aarch64-unknown-linux-musl.tar.gz -C ./tmp/usr/local/bin --strip-components=1 && \ mksquashfs ./tmp /etc/sysconfig/tcedir/optional/uv.tcz && \ echo "uv.tcz" >> /etc/sysconfig/tcedir/onboot.lst && \ tce-load -i uv && \ rm -rf ./tmp uv-aarch64-unknown-linux-musl.tar.gz - UV should now be available:
uv --version - Create persistent UV directory (this goes against the "RAM only", but is our best option):
mkdir -p /etc/sysconfig/tcedir/persistent/uv && \ mkdir ~/.local/share && \ ln -s /etc/sysconfig/tcedir/persistent/uv ~/.local/share/uv - Make sure UV's cache is also in the persistent directory:
- Create
/etc/profile.d/uv.shand addexport UV_CACHE_DIR="$HOME/.local/share/uv/cache" - Add
/etc/profile.d/uv.shto/opt/.filetool.lst - Run
source /etc/profile.d/uv.sh
- Create
- Save:
backup
- Install Python 3.13 through UV:
uv python install 3.13 - Test:
uv run python --version
- Install dependencies:
tce-load -wi compiletc rust bluez openssl-dev openjpeg-dev autoconf ffmpeg libjpeg-turbo-dev - Install Home Assistant:
uv tool install homeassistant(or usehomeassistant==2025.7.1for a specific version) - Save:
backup(only because~/.local/bin/hassis created) - Run Home Assistant once:
uv tool run --from homeassistant hass -v --skip-pip, this generates the needed configuration - Create persistent custom components directory:
mkdir -p /etc/sysconfig/tcedir/persistent/custom_components && \ ln -s /etc/sysconfig/tcedir/persistent/custom_components ~/.homeassistant/custom_components - Optionally: Disable Cloud (Nabu Casa):
- Remove
default_configfrom~/.homeassistant/configuration.yaml - Install Mostly Default Config as
custom_component(see Install HACS on how to install a custom component) - Update
configuration.yaml:mostly_default_config: exclude: - cloud - ...
- Remove
- Run Home Assistant again:
uv tool run --from homeassistant hass -vand let it install the needed integrations. Once it says "Starting Home Assistant" it's finished! - Open the web interface and create your basic config. Once done exit through
Developer tools->Services->Home Assistant Core Integration: Stop - Clean up the home directory as much as possible
- Add
.homeassistant/home-assistant.log*,.homeassistant/tts,.homeassistant/deps,.homeassistant/*.db-wal&.homeassistant/*.db-shmto/opt/.xfiletool.lst - Have Home Assistant start on boot:
- Create startup script
/opt/hassboot.shcontainingsu - tc -c "uv tool run --from homeassistant hass -c /home/tc/.homeassistant" - Turn startup script into executable:
sudo chmod +x /opt/hassboot.sh - Add
/opt/hassboot.sh &to/opt/bootlocal.shin order to have Home Assistant auto start at boot
- Create startup script
- Save:
backup
- Install iptables:
tce-load -wi iptables - Prepend
iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8123to/opt/hassboot.sh - Save:
backup
Home Assistant records data and keeps it in the home-assistant_v2.db file, which keeps on growing in size. To keep user data backups small the recorder data can be kept in a seperate file, not saved on backups:
- Update
~/.homeassistant/configuration.yamlto keep recorder data in seperate file:recorder: db_url: sqlite:////home/tc/.homeassistant/history.db - Add
.homeassistant/history.db*to/opt/.xfiletool.lst - Save:
backup
It's also possible to set the db_url to a remote (MariaDB for example) location
- Install unzip:
tce-load -wi unzip - Download latest package:
wget https://github.com/hacs/integration/releases/latest/download/hacs.zip - Create directory:
mkdir -p ~/.homeassistant/custom_components/hacs - Unzip package:
unzip hacs.zip -d ~/.homeassistant/custom_components/hacs - Clean up the home directory
- Restart Home Assistant
- Go to
Settings>Devices & services>Add integration, and add HACS - Check if everything is installed correctly
- Save:
backup
If Home Assistant needs to be updated later on:
- Stop the running Home Assistant process
- Upgrade:
uv tool upgrade homeassistant - Save:
backup - Reboot:
sudo reboot
Ok Billy, stupid me finally figured out what I was doing wrong. I appended the start hass command to the end of bootlocal.sh but shouldnt have.
I had to put it before the pcp_startup script.
also I learned what putting the & at the end of the line means in a script….
in addition I modded the hassboot command to
sudo su - tc -c "screen -S HASS -d -m uv tool run --from homeassistant hass -c /home/tc/.homeassistant"
Dont know if it makes it better but I can check into the terminal now.
thanks for your guide, and help!