xfangfang / homeassistant_on_openwrt

Install Home Assistant on your OpenWrt device with a single command | 私人使用无维护

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Homeassistant on OpenWrt

This repo provides tools to install the latest version of Home Assistant. (2022.8.0) on a system with lean's LEDE installed. It provides the reduced version of HA with only minimal list of components included. Additionally, it keeps MQTT, ESPHome, and ZHA components as they are widely used with smart home solutions.

It is distributed with a shell script that downloads and installs everything that required for a clean start.

Requirements:

  • 256 MB storage space
  • 128 MB RAM
  • lean's LEDE with python3 and some pre installed python3-libraries

(I provides a compilation configuration for Xiaomi R3P: r3p.config)

Generic installation

Then, download the installer and run it.

wget https://raw.githubusercontent.com/xfangfang/homeassistant_on_openwrt/lean/ha_install.sh -O - | sh

After script prints Done. you have Home Assistant installed. Start the service or reboot the device to get it start automatically. The web interface will be on 8123 port after all components load.

Home Assitant

The only components with flows included are MQTT and ZHA. After adding a component in the interface or via the config HA could install dependencies and fails on finding them after installation. In this case restarting HA could work.

Other components are not tested and may require additional changed in requirement versions or python libraries.

ZHA usage on Xiaomi Gateway

The component uses internal UART to communicate with ZigBee chip. The chip has to be flashed with a proper firmware to be able to communicate with the HA. The recommended firmware is v3.21:

https://github.com/openlumi/ZiGate/releases/download/990c--20220102-2320/ZigbeeNodeControlBridge_JN5169_COORDINATOR_115200.bin

You could try another Zigate firmwares for JN5169 chip. The baud rate must be 115200 as it is hardcoded in zigpy-zigate.

Use /dev/ttymxc1 port for ZHA configuration, it is connected to the zigbee chip.

It is REQUIRED to erase Persistent Data Manager (PDM) before adding new devices. Otherwise, device adding fails.

Use luci zigbee tools submenu to send erase PDM command with the button or erase PDM in console:

jntool erase_pdm

Zigbee port must not be locked with any program, like ZHA or zigbee2mqtt.

NOTE: It may require restarting Home Assistant after adding a new component via the UI to let it see newly installed requirements. E.g. ZHA installs paho-mqtt and will not allow configuring it unless HA is restarted.

Enabling other components and installing custom

You may want to add more components to your HA installation. In this case you have to download tar.gz from PyPI: https://pypi.org/project/homeassistant/2022.8.0/#files Then extract the content and copy the required components to /usr/lib/python3.9/site-packages/homeassistant-2022.8.0-py3.9.egg/homeassistant/components If the component uses the frontend wizard, you may want to uncomment the corresponding line in /usr/lib/python3.9/site-packages/homeassistant-2022.8.0-py3.9.egg/homeassistant/generated/config_flows.py also.

Or you can create custom_components directory in /etc/homeassistant and copy it there.

Try to install requirements from manifest.json with pip3 manually to check it installs and doesn't require pre-compiled C libraries. Otherwise, you have to cross-compile python3 dependencies and install them as ipk packages.

If the dependency is already installed via opkg or via pip3 you may want to fix the strict dependency in manifest.json to a weaker one or remove versions at all.

About

Install Home Assistant on your OpenWrt device with a single command | 私人使用无维护

License:MIT License


Languages

Language:Shell 89.8%Language:Makefile 10.2%