Skip to content

thirdreality/HA-Box

Repository files navigation

Armbian logo
Armbian Linux Build Framework

GitHub Workflow Status GitHub Workflow Status GitHub Workflow Status

Twitter Follow Discord Liberapay patrons

Table of contents

Compile firmware

Download

git clone [email protected]:thirdreality/HA-Box.git

Compile

Run in the root directory of Armbian.

./compile.sh BOARD=jethubj100 BRANCH=current RELEASE=jammy BUILD_MINIMAL=no BUILD_DESKTOP=no KERNEL_ONLY=no KERNEL_CONFIGURE=no COMPRESS_OUTPUTIMAGE=sha,gpg,img

The compiled generated firmware is located:

output/images/Armbian_22.11.0-trunk_Jethubj100_jammy_current_5.10.166.img

(This firmware is not yet available for burning.)

Firmware

Unzip Armbian_convert.zip

Armbian_Convert.zip

Copy Armbian_22.11.0-trunk_Jethubj100_jammy_current_5.10.166.img to Armbian_Convert.

cp HA-Box/output/images/Armbian_22.11.0-trunk_Jethubj100_jammy_current_5.10.166.img Armbian_Convert/

(If the compiled firmware is not xxx.166.img, you need to change to the appropriate name in Armbian_Convert/build.sh.)

Add executable permissions to first, then run ./build.sh.

cd Armbian_Convert
chmod +x *
chmod +x tools/*
./build.sh

The generated firmware is located:

Armbian_Convert/output/Armbian_22.11.0-trunk_Jethubj100_jammy_current_5.10.166.burn.img 

Flash firmware

To prepare the burning environment on the computer:

  1. Download and extract the file Aml_Burn_Tool.zip.
  2. If this is your first time using the tool, click on Setup_Aml_Burn_Tool_V3.1.0.exe to install necessary drivers.
  3. Next, navigate to the v3 folder and run Aml_Burn_Tool.exe.
  4. Load the compiled **.img firmware file.
  5. Click on Start to initiate the burn process.
  6. Press and hold the button circled in the image below, then connect the black line to your computer and start flashing. You can release the button when you start flashing.

Armbian logo

Configuring HA

Serial debug

Connect both cables to your computer as shown in the image below. You will see the logging info from the PC terminal. (baud rate is: 115200)

Armbian logo

Create a root user

  • Create and verify root password
  • Choose default system command shell: choose 1) bash
  • We don't need to create regular users. Press Ctrl-C to abort

Armbian logo

Configure WiFi

Modify /etc/wpa_supplicant/wpa_supplicant-nl80211-wlan0.conf as follows.

network={
    ssid="<SSID>"
    psk="<PWD>"
}

Reboot the system.

reboot

Configure Zigbee

Flash zigbee firmware. The first flash takes a long time because some dependencies need to be installed. The command apt update is required before burning.

apt update
/usr/lib/firmware/bl706/bl706_func.sh flash

Add self-start.

systemctl enable bl706.service
systemctl start bl706.service

Install HA

Install necessary tools.

sudo apt update
sudo apt install udisks2 systemd-journal-remote -y

Install docker.

curl -fsSL get.docker.com | sh

Install OS Agent.

(View the latest installation package:https://github.com/home-assistant/os-agent/releases/latest)
wget https://github.com/home-assistant/os-agent/releases/download/1.5.1/os-agent_1.5.1_linux_aarch64.deb
dpkg -i os-agent_1.5.1_linux_aarch64.deb

Install Home Assistant. When homeassistant-supervised.deb is installed, NetworkManager will start so that the network cannot be connected. Therefore, we need to modify homeassistant-supervise.deb.

wget https://github.com/home-assistant/supervised-installer/releases/download/1.4.3/homeassistant-supervised.deb
dpkg-deb -R homeassistant-supervised.deb homeassistant-supervised

Modify homeassistant-supervised/DEBIAN/postinst and comment out the following.

# Restart NetworkManager
#info "Restarting NetworkManager"
#systemctl restart "${SERVICE_NM}"

Repackage homeassistant-supervise.deb.

dpkg-deb -b homeassistant-supervised homeassistant-supervised.deb

Install homeassistant-supervised.

BYPASS_OS_CHECK=true dpkg -i homeassistant-supervised.deb

Machine type. Choose raspberrypi4-64.

Armbian logo

After the installation is complete, the following screen is displayed.

Armbian logo

Configure HA

Wait about 20 minutes, then type http://10.1.0.97:8123 into your browser.

Click Settings -> Devices & Services.

Armbian logo

Click ADD INTEGRATION.

Armbian logo

Choose Zigbee Home Automation

Armbian logo

Choose ZiGate

Armbian logo

Input /dev/ttyAML3

Armbian logo

Choose Create a network

Armbian logo