Okay, I gave it a shot in case somebody else stumbles upon this, just follow the steps below and the device should pop up during the onboarding process with HA (at least with Docker), but the same should apply with a virtEnv installation.
Prerequisites
- Home Assistant Yellow with Raspberry Pi OS on the CM4 installed
- SSH enabled
Copy drivers, edit boot and run in docker
-
Flash Installer for HA Yellow on a USB stick
-
Copy to existing HA Yellow Installation (on RasPi OS) from USB stick directory:
scp .\bcm2711-rpi-cm4-ha-yellow.dtb user@yourdeviceIP:/home/youruser scp .\overlays\rpivid-v4l2.dtbo user@yourdeviceIP:/home/youruser
-
copy files from home to boot directory (permissions are overwritten):
sudo mv bcm2711-rpi-cm4-ha-yellow.dtb /boot/ sudo mv rpivid-v4l2.dtbo /boot/overlays/
-
Replace the
console=
incmdline.txt
withconsole=ttyAMA2,115200n8
-
Backup original config.txt file:
sudo cp config.txt config.bkp
-
Edit the config.txt file to look like this (based on HA Yellow config.txt):
# Additional overlays and parameters are documented /boot/overlays/README # DISABLE audio (loads snd_bcm2835) dtparam=audio=off # DO NOT Automatically load overlays for detected cameras camera_auto_detect=0 # DO NOT Automatically load overlays for detected DSI displays display_auto_detect=0 # Enable DRM VC4 V3D driver #dtoverlay=vc4-kms-v3d #max_framebuffers=2 # Run in 64-bit mode arm_64bit=1 # Disable compensation for displays with overscan disable_overscan=1 # Make room for larger initramfs gpu_mem=16 # fixes rpi (3B, 3B+, 3A+, 4B and Zero W) ttyAMA0 serial console dtoverlay=miniuart-bt # enable autoprobing of Bluetooth driver without need of hciattach/btattach dtoverlay=krnbt=on dtoverlay=vc4-kms-v3d-pi4 dtoverlay=imx219 # Enable UART debug prints enable_uart=1 uart_2ndstage=1 # Use Yellow device tree device_tree=bcm2711-rpi-cm4-ha-yellow.dtb [cm4] # Enable host mode on the 2711 built-in XHCI USB controller. # This line should be removed if the legacy DWC2 controller is required # (e.g. for USB device mode) or if USB support is not required. otg_mode=1
-
reboot HA Yellow
-
Install Docker according to Install Docker Engine on Debian | Docker Documentation
-
Install docker-compose:
sudo apt install docker-compose
-
Add user to docker group:
sudo usermod youruser -aG docker
-
Log out and into SSH again
-
Make a docker-compose.yml:
version: '3.7' services: homeassistant: container_name: home-assistant image: homeassistant/home-assistant volumes: - /home/youruser/hass-files-tmp:/config - /etc/localtime:/etc/localtime:ro - /etc/hosts:/etc/hosts:ro devices: - /dev/ttyAMA1:/dev/ttyAMA1 network_mode: host restart: always
-
Pull image:
docker-compose pull
-
Run container:
docker-compose up -d
-
Go to http://yourhost.lan:8123/, finish onboarding process, add ZHA. Chip should be visible at
/dev/ttyAMA1
.
Hope this helps.
Best,
Chris