This document describes the basic process of deploying Home Assistant using Docker on the AI Pyramid platform. The documentation uses connecting the Atom EchoS3R voice assistant device and controlling the onboard RGB LED of Atom-Lite as an example to demonstrate the configuration method for voice interaction control. It also introduces the implementation of integrating local voice services (STT/TTS) and local large language model conversation capabilities (Local LLM Conversation) as needed.
root, password 123456). # ssh root@ IP Address
ssh root@192.168.100.207
You can refer to the Home Assistant Official Installation Documentation or directly use the following Docker command.
/PATH_TO_YOUR_CONFIG: Replace with your local configuration directory, keeping the :/config mount.MY_TIME_ZONE: Replace with your time zone, for example, America/Los_Angeles. Refer to the IANA Time Zone Database for a list of time zones.docker run -d \
--name homeassistant \
--privileged \
--restart=unless-stopped \
-e TZ=MY_TIME_ZONE \
-v /PATH_TO_YOUR_CONFIG:/config \
-v /run/dbus:/run/dbus:ro \
--network=host \
ghcr.io/home-assistant/home-assistant:stable
http://homeassistant.local:8123/http://Device_IP:8123/
This tutorial uses the Atom EchoS3R voice assistant + Atom-Lite RGB LED as an example. Please click the firmware flashing buttons below to flash the firmware online and complete the Wi-Fi configuration.
If the Wi-Fi configuration option is not provided after completing the firmware flashing, you can try resetting the device and clicking the flashing button again to connect.
This chapter is used to deploy a local voice pipeline on AI Pyramid and integrate it into the Home Assistant voice assistant workflow. Once completed, you can achieve:
The overall process is divided into 4 phases: Environment Preparation, STT Integration, TTS Integration, and Joint Debugging Check.
AI Pyramid comes pre-installed with a Local Voice Assistant Demo. To avoid port or service conflicts, please disable its auto-start entry and restart the device.
vim /etc/rc.local
reboot
Download and extract the local voice service script package. This package contains the core scripts used in subsequent steps:
wyoming_sensevoice_asr_service.py: STT service script (listening on port 10300).wyoming_melotts_service.py: TTS service script (listening on port 10200).ha_llm_proxy.py: Local LLM proxy script (listening on port 8100), used for subsequent Local LLMs integration.wget https://m5stack-doc.oss-cn-shenzhen.aliyuncs.com/1213/ai_pyramid_ha_local_voice_service.tar.gz tar -zxvf ai_pyramid_ha_local_voice_service.tar.gz
apt update
apt install lib-llm llm-sys llm-asr llm-openai-api llm-model-sense-voice-small-10s-ax650
systemctl restart llm-*
pip install openai wyoming nohup python3 wyoming_sensevoice_asr_service.py > asr_service.log 2>&1 & The service will start in the background, listening on the local port 10300 by default. You can use the following command to continuously view the logs:
tail -f asr_service.log When Server listening on tcp://0.0.0.0:10300 appears in the log, the STT service has started successfully.
Go to「Settings → Devices & services → Add integration」, search for and add Wyoming Protocol:
Fill in the connection parameters:
127.0.0.110300
Go to 「Settings → Voice assistants」, create or edit a voice assistant, and set Speech-to-Text (STT) to sense-voice-small-10s-ax650:
apt install lib-llm llm-sys llm-melotts llm-openai-api llm-model-melotts-en-us-ax650
systemctl restart llm-*
pip install openai wyoming llm-model-melotts-zh-cn-ax650, llm-model-melotts-ja-jp-ax650, etc., which can be installed as needed.nohup python3 wyoming_melotts_service.py > tts_service.log 2>&1 & You can view the running logs using the following command:
tail -f tts_service.log When Server started, waiting for connections... appears in the log, the TTS service has started successfully.
Go to 「Settings → Devices & services → Add integration」, search for and add Wyoming Protocol:
Fill in the connection parameters:
127.0.0.110200
Go to 「Settings → Voice assistants」, create or edit an assistant configuration, set Text-to-Speech (TTS) to the newly added MeloTTS, and select the language and voice as needed (example shows American English):
After completing STT and TTS integration, it is recommended to perform a full voice test:
sense-voice-small-10s-ax650 on the Voice Assistant page.asr_service.log and tts_service.log in the terminal to ensure real-time log output during voice requests.If there is no response or the integration is unavailable, prioritize checking the following:
10300 and 10200 respectively.HACS (Home Assistant Community Store) is a community extension store for Home Assistant, used to install third-party integrations.
docker exec -it homeassistant bash wget -O - https://get.hacs.xyz | bash -
Ctrl+D to exit the container, then restart Home Assistant:docker restart homeassistant
https://github.com/login/device in the pop-up page to complete GitHub authorization:
home-llm plugin and add it:http://<HA地址>:8123/hacs/repository?owner=acon96&repository=home-llm&category=Integration
This chapter aims to integrate the local model capabilities of AI Pyramid into the Local LLMs plugin of Home Assistant through the OpenAI-compatible API, thereby enabling localized intelligent conversations and device control.
The overall process is divided into 4 phases: Service Preparation, Proxy Startup, Home Assistant Integration Configuration, and Joint Debugging Verification.
Install the dependencies required for running Local LLM and the HA scenario model:
apt install lib-llm llm-sys llm-asr llm-openai-api llm-model-qwen2.5-ha-0.5b-ctx-ax650
systemctl restart llm-*
pip install fastapi httpx uvicorn ai_pyramid_ha_local_voice_service.tar.gz downloaded in Chapter 6 "Environment Preparation" already includes ha_llm_proxy.py; there is no need to download it again.
If you are configuring directly from this chapter, please first return to Chapter 6 to complete the download and extraction of the script package, and then proceed with the subsequent steps.
nohup python3 ha_llm_proxy.py > ha_llm_proxy.log 2>&1 & The default listening port is 8100. You can view the logs using the following command:
tail -f ha_llm_proxy.log When Uvicorn running on http://0.0.0.0:8100 appears in the log, the proxy service has started successfully.
Go to 「Settings → Devices & services → Add integration → Local LLMs」, select OpenAI Compatible 'Conversations' API for the backend, and keep the model language as English by default:
Fill in 127.0.0.1 for API Hostname and 8100 for Port:
Select the HA-specific model in the agent configuration:
Check Home Assistant Services:
In Advanced Parameters, set Tool Call Prefix, Tool Call Suffix, Maximum Tool Call Attempts, and be sure to check Enable Legacy Tool Calling:
Fill in the device information in the system prompt. An example is as follows:
You are AI, a helpful AI assistant that controls smart home devices.
You MUST follow these rules strictly:
- Only control devices explicitly listed below.
- Never invent, rename, or modify device names, areas, or domains.
- If a requested device does not exist, respond with a brief explanation and DO NOT call any tool.
- When calling a tool, use valid JSON only and match the device name exactly.
Current time and date: {{ now }}
Available devices (authoritative list):
- light.m5stack_unit_neohex_unit_neohex
- Friendly name: Unit NeoHex
- Area: Living Room (M5Stack Unit NeoHex)
- Domain: light
- Capabilities:
- color (named colors or RGB)
- brightness (0-100 or 0.0-1.0)
When a user requests an action:
1. Identify the exact device(s) from the available devices list.
2. Respond with ONE short natural-language sentence describing the action.
3. Immediately call the appropriate tool.
4. Do not include any extra commentary or explanations.
Tool usage rules:
- Use HassLightSet for all light changes.
- Use "name" when controlling a specific device.
- Use "area" only if explicitly requested by the user and the area exists.
- Brightness must be a number within the supported range.
- Color must be a valid named color or RGB value.
Output format:
- Natural language sentence
- Followed by exactly one <functioncall> block
- No text after the function call
### Example (correct behavior)
User: Set the NeoHex in the Living Room to red
Assistant: Setting the Unit NeoHex to red.
homeassistant
{"name":"HassLightSet","arguments":{"name":"light.m5stack_unit_neohex_unit_neohex","rgb_color":"(255,0,0)"}}
The description of each field in the system prompt is as follows:
Available devices: The Entity ID of available devices in Home Assistant.Friendly name: Device alias.Area: The area where the device is located.Domain: Device type.Capabilities: Device capabilities, such as light color and brightness, fan speed, air conditioner mode and temperature, etc.In this case, the xxxxx used is an RGB LED device.
For more parameter descriptions, refer to the Model Prompting Documentation. For prompt references for different types of devices, refer to 9. Appendix: Prompt Reference below.
Click Assistant to open the dialogue box:
Click the assistant to open the dialog box:
Enter turn on the light and wait for the model response. Please be patient as the first inference takes longer due to model initialization:
If the model returns an error, go to 「Settings → System → Logs」 to view detailed information:
Under normal circumstances, the light will be turned on:
Go to「Settings → Voice Assistants」,select the configured model, and then you can enable voice control.
ha_llm_proxy.py process is still running.127.0.0.1:8100.Entity ID in the system prompt matches the one in HA.- {HA_Device_Entity_ID}
- Friendly name: Switch
- Area: Kitchen
- Domain: switch
- Capabilities:
- on
- off - {HA_Device_Entity_ID}
- Friendly name: RGB Light
- Area: Bedroom
- Domain: light
- Capabilities:
- color (named colors or RGB)
- brightness (0-100 or 0.0-1.0) - {HA_Device_Entity_ID}
- Friendly name: LCD Backlight
- Area: Living Room
- Domain: light
- Capabilities:
- brightness (0-100 or 0.0-1.0)