<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>blog.matterxiaomi.com</title>
  <id>http://blog.matterxiaomi.com/</id>
  <subtitle>This site is all about blog.matterxiaomi.com.</subtitle>
  <generator uri="https://github.com/madskristensen/Miniblog.Core" version="1.0">Miniblog.Core</generator>
  <updated>2026-08-13T08:14:47Z</updated>
  <entry>
    <id>http://blog.matterxiaomi.com/blog/run-local-llm-server-part7/</id>
    <title>part 7 - Build Your Own Private AI Station: Llama server with Docker+ Open WebUI with Docker</title>
    <updated>2026-08-20T15:18:45Z</updated>
    <published>2026-08-13T08:14:47Z</published>
    <link href="http://blog.matterxiaomi.com/blog/run-local-llm-server-part7/" />
    <author>
      <name>test@example.com</name>
      <email>blog.matterxiaomi.com</email>
    </author>
    <category term="ai" />
    <content type="html">&lt;p&gt;I am running llama.cpp&amp;nbsp; server with&amp;nbsp; Gemma 4 (E2B) model on an rp55 8GB.&lt;/p&gt;
&lt;p&gt;Connecting llama.cpp running Gemma 4 (E2B) to Home Assistant via HA-MCP allows the AI model to perform local, tool-calling smart home control.&lt;/p&gt;
&lt;p&gt;RPi5 8GB +docker llama.cpp server + Gemma 4 E2B + docker Home Assistant + ha-mcp-integration(build-in ha-mcp server )+docker Open WebUI.&lt;/p&gt;
&lt;p&gt;Open WebUI will begin using your local Llama.cpp server as a backend!&lt;/p&gt;
&lt;div class="mce-toc"&gt;
&lt;h2&gt;Table of Contents&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#mcetoc_1k03canlal"&gt;Overview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#mcetoc_1k03canlam"&gt;How it work?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#mcetoc_1k0e3osc9q"&gt;Install&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#mcetoc_1k0e3qsm916"&gt;Step 1: Install Llama.cpp server with docker&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#mcetoc_1k0e3qsm917"&gt;Step 2: Install Open WebUI with docker&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#mcetoc_1k0e3qsm917"&gt;Step 3: Install ha-mcp-integration(build-in ha-mcp server ) in home assistant&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#mcetoc_1k0e3m1opl"&gt;Connections&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#mcetoc_1k0e3m1opm"&gt;Step 4:&amp;nbsp;Connect &amp;nbsp;Llama.cpp server via Open WebUI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#mcetoc_1k0e3m1opn"&gt;Step 5: Connect ha-mcp server via Open WebUI&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#mcetoc_1k0e3m1opo"&gt;&amp;nbsp;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;h2 id="mcetoc_1k03canlal"&gt;Overview&lt;/h2&gt;
&lt;p&gt;Runs the full ha-mcp server inside Home Assistant.Transport: use Streamable HTTP&lt;/p&gt;
&lt;p&gt;Set up your Llama.cpp server with docker&lt;/p&gt;
&lt;p&gt;Llama.cpp server Load large models locally&lt;/p&gt;
&lt;p&gt;Enable 4GB&amp;nbsp; of ZRAM swap space to prevent hard OOM crashes during heavy context processing.&lt;/p&gt;
&lt;p&gt;Integrate with Open WebUI for a seamless interface&lt;/p&gt;
&lt;pre class="language-csharp"&gt;&lt;code&gt;#docker images
REPOSITORY                      TAG       IMAGE ID       CREATED         SIZE
ghcr.io/ggml-org/llama.cpp      server    bde659bfc300   8 days ago      1.21GB
ghcr.io/open-webui/open-webui   v0.11.0   72c0ba641ba7   2 weeks ago     7.15GB
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2 id="mcetoc_1k03canlam"&gt;How it work?&lt;/h2&gt;
&lt;p&gt;Architecture Overview&lt;/p&gt;
&lt;pre class="language-csharp"&gt;&lt;code&gt;Open WebUI Docker(port 3000)
    &amp;darr; OpenAI-compatible API
llama.cpp server (port 8080) &amp;larr; Gemma 4 E2B Q4
    &amp;darr; (tool calls via MCP)
ha-mcp (inside HA or add-on)
    &amp;darr;
Home Assistant Docker&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;pre class="language-csharp"&gt;&lt;code&gt;┌─────────────────┐       MCP       ┌─────────────────┐      REST/WS      ┌─────────────────┐
│ MCP Host Client │ ──────────────&amp;gt; │  HA-MCP Server  │ ────────────────&amp;gt; │ Home Assistant  │
│ (Open WebUI /   │                 │   (:9584)       │                   │   (:8123)       │
│  MCP Agent)     │                 └─────────────────┘                   └─────────────────┘
└────────┬────────┘
         │ OpenAI API
         ▼
┌─────────────────┐
│  llama.cpp      │ (Gemma 4 E2B)
│  (:8080)        │
└─────────────────┘&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Note&lt;/p&gt;
&lt;p&gt;1.llama.cpp acts as an inference server (provider)&lt;/p&gt;
&lt;p&gt;2.HA-MCP acts as an MCP tool provider&lt;/p&gt;
&lt;p&gt;3.Open WebUI&amp;nbsp;sends user prompts to llama.cpp server&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2 id="mcetoc_1k0e3osc9q"&gt;Install&lt;/h2&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 id="mcetoc_1k0e3qsm916"&gt;Step 1: Install Llama.cpp server with docker&lt;/h3&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Step 2: Download a Supported Model&lt;/p&gt;
&lt;p&gt;cd&amp;nbsp;/datadocker/llama-cpp&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;docker pull ghcr.io/ggml-org/llama.cpp:server-b10499&lt;/p&gt;
&lt;pre class="language-csharp"&gt;&lt;code&gt;docker run \
  --name llama \
  --restart=unless-stopped \
  -v /datadocker/llama-cpp/models:/models \
  -p 8091:8080 \
  ghcr.io/ggml-org/llama.cpp:server:server-b10499 \
  -m /models/google_gemma-4-E2B-it-Q4_0.gguf \
  --host 0.0.0.0 \
  --port 8080 \
  --threads 4 \
  --jinja \
  --reasoning-budget 0 \
  --chat-template-kwargs '{"enable_thinking": false}' \
  --ui-mcp-proxy &lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;you will get api:&lt;/p&gt;
&lt;p&gt;http://192.168.2.134:8091/v1&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 id="mcetoc_1k0e3qsm917"&gt;Step 2: Install Open WebUI with docker&lt;/h3&gt;
&lt;pre class="language-csharp"&gt;&lt;code&gt;docker pull ghcr.io/open-webui/open-webui:v0.11.0

cd /datadocker/open-webui/

docker run -d -p 3000:8080 --name open-webui \
 -v /datadocker/open-webui/data:/app/backend/data \
 ghcr.io/open-webui/open-webui:v0.11.0


web ui

http://192.168.2.125:3000/&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 id="mcetoc_1k0e3qsm917"&gt;Step 3: Install ha-mcp-integration(build-in ha-mcp server ) in home assistant&lt;/h3&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;first,Install&amp;nbsp;HA-MCP Custom Component&amp;nbsp;integration in ha&lt;/p&gt;
&lt;p&gt;then Add&amp;nbsp;HA-MCP Server in HA-MCP Custom Component integration.&lt;/p&gt;
&lt;p&gt;you will get api:&lt;/p&gt;
&lt;p&gt;http://192.168.2.125:9584/private_QQz2CLU3n8xR&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2 id="mcetoc_1k0e3m1opl"&gt;Connections&lt;/h2&gt;
&lt;h3 id="mcetoc_1k0e3m1opm"&gt;Step 4:&amp;nbsp;Connect &amp;nbsp;Llama.cpp server via Open WebUI&lt;/h3&gt;
&lt;p&gt;connect to a AI&amp;nbsp; Provider&lt;/p&gt;
&lt;p&gt;Add the API Connection in Open WebUI&lt;/p&gt;
&lt;p&gt;Connect Llama.cpp server to Open WebUI&lt;/p&gt;
&lt;p&gt;Open WebUI will begin using your local Llama.cpp server as a backend&lt;/p&gt;
&lt;p&gt;Open Open WebUI in your browser&lt;/p&gt;
&lt;p&gt;Go to ⚙️ Admin Settings &amp;rarr; Connections &amp;rarr; OpenAI.&lt;/p&gt;
&lt;p&gt;Click ➕ Add Connection.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;http://192.168.2.134:8091/v1&lt;/p&gt;
&lt;p&gt;add http://192.168.2.134:8091/v1,it is llama.cpp with gemma4 model&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 id="mcetoc_1k0e3m1opn"&gt;Step 5: Connect ha-mcp server via Open WebUI&lt;/h3&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;add ha mcp server&lt;/p&gt;
&lt;p&gt;Open Open WebUI in your browser&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Go to ⚙️ Admin Settings &amp;rarr; Tools &amp;rarr; Integrations.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Click ➕ Add External Tool Servers.&lt;/p&gt;
&lt;p&gt;http://192.168.2.125:9584/private_QQz2CLU3n8xR&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Note&lt;/p&gt;
&lt;p&gt;you can get Connect URL via&amp;nbsp;HA-MCP Custom Component integration in ha.&lt;/p&gt;
&lt;p&gt;http://192.168.2.125:8123/config/integrations/integration/ha_mcp_tools&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;debug step by step&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;pre class="language-markup"&gt;&lt;code&gt;http://192.168.2.134:8091/v1&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;cqrs&lt;/p&gt;
&lt;pre class="language-csharp"&gt;&lt;code&gt;0.00.013.586 W srv  llama_server: CORS is set to allow all origins ('*') and no API key is set
0.00.013.586 W srv  llama_server: this can be a security risk (cross-origin attacks)
0.00.013.587 W srv  llama_server: more info: https://github.com/ggml-org/llama.cpp/pull/25655
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;useful links&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;https://docs.openwebui.com/getting-started/quick-start/connect-a-provider/starting-with-llama-cpp/&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;add ha mcp server&lt;/p&gt;
&lt;p&gt;https://homeassistant-ai.github.io/ha-mcp/setup/?method=ha-component&amp;amp;client=open-webui&amp;amp;scope=local&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Docker HA + HA Custom Component (in-process server)+ Docker Open WebUI +&amp;nbsp;Local access&amp;nbsp; &amp;nbsp;on same host.&lt;/p&gt;
&lt;p&gt;https://homeassistant-ai.github.io/ha-mcp/setup/?method=ha-component&amp;amp;client=open-webui&amp;amp;scope=local&lt;/p&gt;
&lt;h2 id="mcetoc_1k0e3m1opo" class="section-header" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; --tw-rotate: 0; --tw-skew-x: 0; --tw-skew-y: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-ring-offset-width: 0px; --tw-ring-offset-color: #fff; --tw-ring-color: #3b82f680; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-shadow: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-shadow-colored: 0 0 #0000; box-sizing: border-box; border: 0px solid #e5e7eb; margin: 0px 0px 1rem; --tw-text-opacity: 1; flex-wrap: wrap; align-items: center; gap: 0.75rem; line-height: 1.75rem; display: flex;" tabindex="-1" data-astro-cid-oustkjpu=""&gt;&lt;span style="font-size: 14px;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</content>
  </entry>
  <entry>
    <id>http://blog.matterxiaomi.com/blog/raspberry-pi-part12/</id>
    <title>Part 12 - update Raspberry Pi OS Trixie (2025) and increase swap to 4 GB</title>
    <updated>2026-08-15T19:41:27Z</updated>
    <published>2026-08-08T06:42:20Z</published>
    <link href="http://blog.matterxiaomi.com/blog/raspberry-pi-part12/" />
    <author>
      <name>test@example.com</name>
      <email>blog.matterxiaomi.com</email>
    </author>
    <category term="raspberry pi" />
    <content type="html">&lt;p&gt;Raspberry Pi OS Trixie (2025)&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Because the RPi 5 shares system RAM between the CPU and AI workloads, careful configuration is required to prevent out-of-memory (OOM) crashes.&lt;/p&gt;
&lt;div class="mce-toc"&gt;
&lt;h2&gt;Table of Contents&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#mcetoc_1jvgopheda"&gt;System Requirements&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#mcetoc_1jvgophedb"&gt;Raspberry Pi OS Trixie (2025)&amp;nbsp; uses rpi-swap:&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#mcetoc_1jvg1urc71"&gt;Check Current Swap Configuration&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;p&gt;Expand Swap Using dphys-swapfile (Bookworm and Older).&lt;/p&gt;
&lt;p&gt;Expand Swap Using rpi-swap (Trixie and Newer).&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Raspberry Pi OS Trixie (2025) or newer, the system uses rpi-swap instead of dphys-swapfile.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;rpi-swap is a new package that replaces/deprecates dphys-swapfile for configuring swap on your Raspberry Pi.it is a standard swap management solution, providing better performance and reliability than the old dphys-swapfile approach.&lt;/p&gt;
&lt;p&gt;Supports: Compressed RAM swap (zram), file-based swap, or hybrid modes.&lt;/p&gt;
&lt;p&gt;Using zram avoids small/frequent writes to /var/swap so as to increase SD card longevity.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Raspberry OS Version&lt;/p&gt;
&lt;pre class="language-csharp"&gt;&lt;code&gt;cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 13 (trixie)"
NAME="Debian GNU/Linux"
VERSION_ID="13"
VERSION="13 (trixie)"
VERSION_CODENAME=trixie
DEBIAN_VERSION_FULL=13.4
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id="mcetoc_1jvgopheda"&gt;System Requirements&lt;/h2&gt;
&lt;p&gt;Raspberry Pi OS Trixie (2025) or newer&lt;/p&gt;
&lt;p&gt;rpi-swap is installed.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvgophedb"&gt;Raspberry Pi OS Trixie (2025)&amp;nbsp; uses rpi-swap:&lt;/h2&gt;
&lt;p&gt;Config Directory: /etc/rpi/swap.conf (drop-in configuration files).&lt;/p&gt;
&lt;p&gt;Default Swap Type: Compressed RAM swap (zram).&lt;/p&gt;
&lt;p&gt;Default Swap File: /dev/zram0.&lt;/p&gt;
&lt;p&gt;Default Size: Up to 2048MB, sized to match RAM (capped at 50% of disk space).&lt;/p&gt;
&lt;p&gt;Supports: Compressed RAM swap (zram), file-based swap, or hybrid modes.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;rpi-swap&lt;/p&gt;
&lt;p&gt;rpi-swap GitHub Repository (Official):https://github.com/raspberrypi/rpi-swap&lt;/p&gt;
&lt;p&gt;Modern swap management for Raspberry Pi systems, designed to replace dphys-swapfile with a more flexible and efficient approach.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2 id="mcetoc_1jvg1urc71"&gt;Check Current Swap Configuration&lt;/h2&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Check total swap size and usage:&lt;/p&gt;
&lt;p&gt;free -h&lt;/p&gt;
&lt;pre class="language-csharp"&gt;&lt;code&gt; free -h
               total        used        free      shared  buff/cache   available
Mem:           7.9Gi       5.7Gi       342Mi       2.7Mi       2.0Gi       2.2Gi
Swap:          2.0Gi       2.0Gi       656Ki
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Check swap details&lt;/p&gt;
&lt;pre class="language-markup"&gt;&lt;code&gt;cat /proc/meminfo | grep Swap&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;pre class="language-csharp"&gt;&lt;code&gt; cat /proc/meminfo | grep Swap
SwapCached:           48 kB
SwapTotal:       2097136 kB
SwapFree:          26944 kB
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;see where the swap file is located:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;swapon --show&lt;/p&gt;
&lt;pre class="language-csharp"&gt;&lt;code&gt; swapon --show
NAME       TYPE      SIZE USED PRIO
/dev/zram0 partition   2G   0B  100
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;rpi-swap uses systemd generators so 'rpi-zram-writeback' will not appear in the list of package files.&lt;/p&gt;
&lt;pre class="language-markup"&gt;&lt;code&gt;tree /run/systemd/generator/

 tree /run/systemd/generator/
/run/systemd/generator/
├── boot-firmware.mount
├── dev-zram0.swap
├── getty.target.wants
│   └── serial-getty@ttyAMA10.service -&amp;gt; /usr/lib/systemd/system/serial-getty@.service
├── local-fs.target.requires
│   ├── boot-firmware.mount -&amp;gt; ../boot-firmware.mount
│   └── -.mount -&amp;gt; ../-.mount
├── local-fs.target.wants
│   ├── systemd-fsck-root.service -&amp;gt; /usr/lib/systemd/system/systemd-fsck-root.service
│   └── systemd-remount-fs.service -&amp;gt; /usr/lib/systemd/system/systemd-remount-fs.service
├── -.mount
├── netplan.stamp
├── rpc_pipefs.target
├── rpi-setup-loop@var-swap.service.d
│   ├── fast-symlink.conf
│   ├── no-dependency-cycle.conf
│   └── resize-swap.conf
├── rpi-zram-writeback.timer
├── run-rpc_pipefs.mount
├── sockets.target.wants
│   └── sshd-unix-local.socket -&amp;gt; ../sshd-unix-local.socket
├── sshd-unix-local@.service -&amp;gt; /usr/lib/systemd/system/sshd@.service
├── sshd-unix-local.socket
├── swap.target.wants
│   └── dev-zram0.swap -&amp;gt; ../dev-zram0.swap
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;install/configure rpi-swap (Trixie only):&lt;/p&gt;
&lt;pre class="language-csharp"&gt;&lt;code&gt;sudo apt install rpi-swap
sudo reboot&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Configuration files are located at:&lt;/p&gt;
&lt;p&gt;/etc/rpi/swap.conf&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;detailed configuration options&lt;/p&gt;
&lt;pre class="language-markup"&gt;&lt;code&gt;man swap.conf&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;verify that swap has been configured properly:&lt;/p&gt;
&lt;p&gt;systemctl list-units --type swap&lt;/p&gt;
&lt;pre class="language-csharp"&gt;&lt;code&gt;systemctl list-units --type swap
  UNIT           LOAD   ACTIVE SUB    DESCRIPTION                             
  dev-zram0.swap loaded active active rpi-swap managed swap device (zram+file)

Legend: LOAD   &amp;rarr; Reflects whether the unit definition was properly loaded.
        ACTIVE &amp;rarr; The high-level unit activation state, i.e. generalization of SUB.
        SUB    &amp;rarr; The low-level unit activation state, values depend on unit type.

1 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;References&lt;/p&gt;
&lt;p&gt;rpi-swap GitHub Repository (Official):https://github.com/raspberrypi/rpi-swap&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</content>
  </entry>
  <entry>
    <id>http://blog.matterxiaomi.com/blog/run-local-llm-server-part6/</id>
    <title>run-local-llm-server-part6 debian vmware on windows 10</title>
    <updated>2026-08-23T11:26:51Z</updated>
    <published>2026-08-05T23:49:45Z</published>
    <link href="http://blog.matterxiaomi.com/blog/run-local-llm-server-part6/" />
    <author>
      <name>test@example.com</name>
      <email>blog.matterxiaomi.com</email>
    </author>
    <category term="ai" />
    <content type="html">&lt;p&gt;Llama.cpp is a high-performance inference engine written in C/C++ designed for running Llama and compatible models in the GGUF format.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;vmware on windows 10&lt;/p&gt;
&lt;p&gt;&lt;img src="/Posts/files/Vmware-llamacpp-Windows10-1_639229465986322537.JPG" alt="Vmware-llamacpp-Windows10-1.JPG" width="760" height="741" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;Overview&lt;/h2&gt;
&lt;p&gt;Set up your Llama.cpp server&lt;/p&gt;
&lt;p&gt;Load large models locally&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;pre class="language-csharp"&gt;&lt;code&gt;docker pull ghcr.io/ggml-org/llama.cpp:server-b10499
docker pull ghcr.io/open-webui/open-webui:v0.11.0&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Step 1: Download a model in GGUF format from Hugging Face.&lt;/p&gt;
&lt;pre class="language-csharp"&gt;&lt;code&gt;# llama.cpp only works with GGUF

# Create a dedicated folder for models:
mkdir -p /datadocker/llama-cpp

cd /datadocker/llama-cpp

mkdir models

cd /datadocker/llama-cpp/models


https://huggingface.co/unsloth/gemma-4-E2B-it-GGUF/tree/main

https://huggingface.co/bartowski/google_gemma-4-E2B-it-GGUF/tree/main

google_gemma-4-E2B-it-Q4_0.gguf

wget https://huggingface.co/bartowski/google_gemma-4-E2B-it-GGUF/resolve/main/google_gemma-4-E2B-it-Q4_0.gguf?download=true&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Step 2: Install Llama.cpp server with docker&lt;/p&gt;
&lt;p&gt;cd /datadocker/llama-cpp&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;pre class="language-csharp"&gt;&lt;code&gt;docker run \
  --name llama \
  --restart=unless-stopped \
  -v /datadocker/llama-cpp/models:/models \
  -p 8091:8080 \
  ghcr.io/ggml-org/llama.cpp:server \
  -m /models/google_gemma-4-E2B-it-Q4_0.gguf \
  --host 0.0.0.0 \
  --port 8080 \
  --threads 4 \
  --jinja \
  --reasoning-budget 0 \
  --chat-template-kwargs '{"enable_thinking": false}' \
  --webui-mcp-proxy 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Step 4: Connect Llama.cpp server&amp;nbsp; via WebUI&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</content>
  </entry>
  <entry>
    <id>http://blog.matterxiaomi.com/blog/ha-mcp-server-part2/</id>
    <title>Claude Code for Home Assistant(ha-mcp Server directly inside Home Assistant)</title>
    <updated>2026-08-20T17:31:46Z</updated>
    <published>2026-08-05T00:47:39Z</published>
    <link href="http://blog.matterxiaomi.com/blog/ha-mcp-server-part2/" />
    <author>
      <name>test@example.com</name>
      <email>blog.matterxiaomi.com</email>
    </author>
    <category term="ha claude code" />
    <category term="ai" />
    <content type="html">&lt;p&gt;Claude Code for Home Assistant&lt;/p&gt;
&lt;p&gt;Is there a guide to setup home assistant with MCP and integrate with Claude？&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I created an guide&amp;nbsp;that integrates Claude Code (Anthropic&amp;rsquo;s AI assistant) directly into Home Assistant. With it, you can create automations, debug configurations, and manage your smart home using natural language through a browser-based terminal.&lt;/p&gt;
&lt;div class="mce-toc"&gt;
&lt;h2&gt;Table of Contents&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#mcetoc_1jvr7j40ei"&gt;Install type&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#mcetoc_1jvr7j40ej"&gt;Usage examples&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#mcetoc_1jvr7j40ek"&gt;How does it work?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#mcetoc_1jvr7j40el"&gt;Requirements&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#mcetoc_1k0at69so4"&gt;Inside home assistant&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#mcetoc_1jvr7j40em"&gt;Installation&amp;nbsp;ha-mcp-integration&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#mcetoc_1jvr7l5sdq"&gt;Copy the connect URL for AI Client&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&lt;a href="#mcetoc_1k03bgota1"&gt;Verify the Target Server is Active:&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="/Posts/files/ha-mcp-integration-0-0_639215424540112818.JPG" alt="Run MCP Server directly inside Home Assistant" width="1102" height="405" /&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1jvr7j40ei"&gt;Install type&lt;/h2&gt;
&lt;p&gt;Run MCP Server directly inside Home Assistant.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Note&lt;/p&gt;
&lt;p&gt;Newly solutions&amp;nbsp; usually ran as an internal Python process inside Home Assistant.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;ha-mcp-integration is a native Home Assistant integration that embeds an MCP (Model Context Protocol) Server directly inside Home Assistant.&lt;/p&gt;
&lt;p&gt;offcial website:https://github.com/homeassistant-ai/ha-mcp-integration&lt;/p&gt;
&lt;p&gt;download:https://codeload.github.com/homeassistant-ai/ha-mcp-integration/zip/refs/tags/v1.3.0&lt;/p&gt;
&lt;h2 id="mcetoc_1jvr7j40ej"&gt;Usage examples&lt;/h2&gt;
&lt;p&gt;claude &amp;ldquo;Create an automation to turn off lights when I leave home&amp;rdquo;&lt;/p&gt;
&lt;p&gt;Create an automation that turns on the bedroom AC when the temperature exceeds 28&amp;deg;C.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvr7j40ek"&gt;How does it work?&lt;/h2&gt;
&lt;p&gt;The ha-mcp-integration&amp;nbsp;uses ha-mcp (Model Context Protocol) server which allows Claude to:&lt;/p&gt;
&lt;p&gt;Query entity states&lt;/p&gt;
&lt;p&gt;Control devices&lt;/p&gt;
&lt;p&gt;List available services&lt;/p&gt;
&lt;p&gt;Access the entire Home Assistant API&lt;/p&gt;
&lt;p&gt;Besides the built-in tools, the server can expose tools coming from MCP servers.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;ha-mcp-integration&lt;/p&gt;
&lt;p&gt;The integration starts an MCP Server inside Home Assistant..&lt;/p&gt;
&lt;p&gt;The integration registers MCP Tools&lt;/p&gt;
&lt;p&gt;AI Mcp client connects via MCP.&lt;/p&gt;
&lt;p&gt;Architecture&lt;/p&gt;
&lt;pre class="language-csharp"&gt;&lt;code&gt;                 AI Client
       (ChatGPT / Claude / Cursor)
                    │
          MCP Protocol (HTTP/SSE)
                    │
        ┌────────────────────────┐
        │ Home Assistant         │
        │ ha-mcp-integration     │
        │                        │
        │  MCP Server            │
        │  Tool Registry         │
        │  Authentication        │
        └──────────┬─────────────┘
                   │
          Home Assistant Core
                   │
      ┌────────────┴─────────────┐
      │ States                   │
      │ Services                 │
      │ Devices                  │
      │ Areas                    │
      │ Automations              │
      │ Scripts                  │
      │ History                  │
      └──────────────────────────┘&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;ha-mcp-integration:Full MCP Server running inside Home Assistant. AI clients connect directly to it.&lt;/p&gt;
&lt;p&gt;ha_mcp_tools:A library of MCP tools used by the MCP Server.&lt;/p&gt;
&lt;pre class="language-csharp"&gt;&lt;code&gt;ha-mcp-integration
        │
        ├── starts MCP Server
        │
        └── uses ha_mcp_tools
                 │
                 ├── call_service
                 ├── get_state
                 ├── list_entities
                 ├── search_devices
                 └── ...&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;ha-mcp-integration does not "think up" automations by itself. Instead, it exposes Home Assistant capabilities as MCP tools, allowing an AI (ChatGPT, Claude, Cursor, etc.) to inspect your Home Assistant configuration and then create or modify automations.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2 id="mcetoc_1jvr7j40el"&gt;Requirements&lt;/h2&gt;
&lt;p&gt;Home Assistant Docker&lt;/p&gt;
&lt;p&gt;Anthropic account&amp;nbsp;&lt;/p&gt;
&lt;h2 id="mcetoc_1k0at69so4"&gt;Inside home assistant&lt;/h2&gt;
&lt;h3 id="mcetoc_1jvr7j40em"&gt;Installation&amp;nbsp;ha-mcp-integration&lt;/h3&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;ha-mcp-integration=HA-MCP Custom Component&lt;/p&gt;
&lt;p&gt;Step 1: Download the HA-MCP Custom Component:&lt;/p&gt;
&lt;p&gt;https://github.com/homeassistant-ai/ha-mcp-integration/releases&lt;/p&gt;
&lt;pre class="language-markup"&gt;&lt;code&gt;wget https://github.com/homeassistant-ai/ha-mcp-integration/archive/refs/tags/v1.3.0.zip&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;copy custom_components/ha_mcp_tools/ into config/custom_components/&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Step 2: Restart home assistant:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Step 3: Install the HA-MCP Custom Component:&lt;/p&gt;
&lt;p&gt;&lt;img src="/Posts/files/ha-mcp-integration-2-4_639215692998923340.JPG" alt="ha-mcp-integration-2-4.JPG" width="582" height="625" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="/Posts/files/ha-mcp-integration-2-4_639215692999403388.JPG" alt="ha-mcp-integration-2-4.JPG" width="578" height="399" /&gt;&lt;/p&gt;
&lt;p&gt;Choose Add HA-MCP Server.it&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="/Posts/files/ha-mcp-integration-2-4_639215692999718012.JPG" alt="ha-mcp-integration-2-4.JPG" width="585" height="325" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="/Posts/files/ha-mcp-integration-2-4_639215692999958580.JPG" alt="ha-mcp-integration-2-4.JPG" width="585" height="370" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="/Posts/files/ha-mcp-integration-2-4_639215693000172012.JPG" alt="ha-mcp-integration-2-4.JPG" width="1683" height="819" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2 id="mcetoc_1jvr7l5sdq"&gt;Copy the connect URL for AI Client&lt;/h2&gt;
&lt;p&gt;http://192.168.2.125:8123/config/integrations/integration/ha_mcp_tools&lt;/p&gt;
&lt;p&gt;Copy the connect URL from the entry's Configure screen (Settings &amp;rarr; Devices &amp;amp; Services &amp;rarr; HA-MCP Custom Component &amp;rarr; HA-MCP Server &amp;rarr; Configure)&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="/Posts/files/ha-mcp-integration-2-4_639215693000582222.JPG" alt="ha-mcp-integration-2-4.JPG" width="573" height="837" /&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1jvr7j40en" style="font-variation-settings: normal; font-feature-settings: normal; font-family: Arial, sans-serif; margin: 2rem 0px 0.67rem; line-height: 1.2; font-size: 21.112px; color: #222222; font-variant-ligatures: none; background-color: #f9f9f9;"&gt;&amp;nbsp;&lt;/h2&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2 id="mcetoc_1k03bgota1"&gt;Verify the Target Server is Active:&lt;/h2&gt;
&lt;p&gt;http://192.168.2.125:9584/private_QQz2CLU3n8xRQ1&lt;/p&gt;
&lt;pre class="language-csharp"&gt;&lt;code&gt;HA-MCP server is up and running!

To connect, paste the full URL (including the /private_... key) into the
connector or MCP settings of your AI/LLM client. No username or password required.
Setup instructions: https://homeassistant-ai.github.io/ha-mcp/

--- Seeing this page? Your URL is set up correctly ---

If this page loads in your browser, the MCP server is reachable and the
URL is correct. If your AI client still cannot connect, the problem is
not on HA-MCP's side. Common causes:

- Geo / country blocking in your reverse proxy / CDN (Cloudflare, NGINX,
  Traefik, Zoraxy, etc.). Most AI/LLM services connect from US-based
  cloud infrastructure, so if you block US IP addresses (or only allow
  your own country), that is why your client cannot connect. Allow your
  provider's IP ranges (or your client's egress IPs). For example,
  Claude.ai connects from Anthropic's network, 160.79.104.0/21.
- WAF, bot-blocking, or rate-limiting rules on the proxy that drop or
  challenge the request.
- The AI client's network can sometimes be spotty -- you may just need
  to try connecting again.
- The AI client itself refusing certain domains or proxy providers on
  its end. This is rare and outside your control; try a different
  hostname or proxy if you suspect it.

Your proxy's access logs will show the blocked attempt -- look for the
request from your AI provider's IP (e.g. an Anthropic 160.79.x.x address).

--- Cloudflare Users ---

If your LLM cannot connect, Cloudflare's "Block AI training bots"
setting is the most common cause. To disable it:

1. Log in to Cloudflare (https://dash.cloudflare.com)
2. In the left sidebar, click Domains, then click Overview
3. Click on the domain you use for connecting to Home Assistant
4. On the right side, find "Control AI Crawlers"
5. Under "Block AI training bots", open the dropdown
6. Select "do not block (allow crawlers)"

Screenshot of the setting:
https://homeassistant-ai.github.io/ha-mcp/images/cloudflare-ai-crawlers-setting.jpg&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</content>
  </entry>
  <entry>
    <id>http://blog.matterxiaomi.com/blog/ha-mcp-server-part1/</id>
    <title>Using Claude Code to manage your Home Assistant config step by step(docker ha-mcp server))</title>
    <updated>2026-08-20T17:24:01Z</updated>
    <published>2026-08-03T16:59:35Z</published>
    <link href="http://blog.matterxiaomi.com/blog/ha-mcp-server-part1/" />
    <author>
      <name>test@example.com</name>
      <email>blog.matterxiaomi.com</email>
    </author>
    <category term="ai" />
    <category term="ha claude code" />
    <content type="html">&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;Install type&lt;/h2&gt;
&lt;p&gt;Run Standalone ha-mcp&amp;nbsp; MCP Server outside Home Assistant.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Note&lt;/p&gt;
&lt;p&gt;Earlier solutions (such as the standalone ha-mcp project) usually ran as an external Python process:&lt;/p&gt;
&lt;pre class="language-csharp"&gt;&lt;code&gt;Claude
      │
Standalone ha-mcp Server
      │
REST/WebSocket
      │
Home Assistant&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This project provides a seamless integration between Home Assistant and Claude AI via the Model Context Protocol (MCP), enabling using Claude Code to manage your Home Assistant config through natural language&amp;nbsp;&amp;nbsp;step by step.&lt;/p&gt;
&lt;div class="mce-toc"&gt;
&lt;h2&gt;Table of Contents&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#mcetoc_1jv49apuff"&gt;Prerequisites&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#mcetoc_1jv49apufg"&gt;Architecture&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#mcetoc_1jv49apufh"&gt;Installation&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#mcetoc_1jv4cr96ra"&gt;step 1.Start MCP server&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#mcetoc_1jv4cr96rb"&gt;step 2.Install HA-MCP Custom Component in Home Assistant&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#mcetoc_1jv4cr96rc"&gt;step 3.Create a long-lived access token in Home Assistant&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#mcetoc_1jv4cr96rd"&gt;step 4.Configure Claude&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#mcetoc_1jv49cfk7j"&gt;Usage Examples&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;h2 id="mcetoc_1jv49apuff"&gt;Prerequisites&lt;/h2&gt;
&lt;p&gt;Home Assistant ha-mcp MCP Server&lt;/p&gt;
&lt;p&gt;https://github.com/homeassistant-ai/ha-mcp&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Integration&lt;/p&gt;
&lt;p&gt;https://github.com/homeassistant-ai/ha-mcp-integration&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;AI client&lt;/p&gt;
&lt;p&gt;Claude Desktop&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2 id="mcetoc_1jv49apufg"&gt;Architecture&lt;/h2&gt;
&lt;pre class="language-csharp"&gt;&lt;code&gt;┌─────────────────┐
│   Claude AI     │
│  (Sonnet 4.5)   │
└────────┬────────┘
         │ MCP Protocol
         │
┌────────▼────────┐
│ Standalone  MCP Server    │
│  (WebSocket)    │
└────────┬────────┘
         │ REST API
         │
┌────────▼────────┐
│ Home Assistant  │
│   (v2026.7)    │
└─────────────────┘&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;MCP server connects to my HA instance through a Long-lived access token to&amp;nbsp; access the Home Assistant API, giving it the ability to search entities, read automation traces, reload configs, and query device states.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;ha-mcp is a standalone server built for configuring, building, and debugging your smart home&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2 id="mcetoc_1jv49apufh"&gt;Installation&lt;/h2&gt;
&lt;h3 id="mcetoc_1jv4cr96ra"&gt;step 1.Start MCP server&lt;/h3&gt;
&lt;p&gt;Runs the ha-mcp server.&lt;/p&gt;
&lt;pre class="language-csharp"&gt;&lt;code&gt;docker pull ghcr.io/homeassistant-ai/ha-mcp:latest


docker run -d \
  --name ha-mcp \
  --restart unless-stopped \
  -p 9000:9000 \
  -e HOMEASSISTANT_URL=http://192.168.1.100:8123 \
  -e HOMEASSISTANT_TOKEN=xxxxxxxxxxxxxxxx \
  -e MCP_PORT=9000 \
  ghcr.io/homeassistant-ai/ha-mcp:latest \
  ha-mcp-web&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Docker (HTTP server): run ghcr.io/homeassistant-ai/ha-mcp in HTTP mode, pointed at your Home Assistant URL and a long-lived token.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Start Docker Container&lt;/p&gt;
&lt;pre class="language-csharp"&gt;&lt;code&gt;docker run -d --name ha-mcp -p 8086:8086 -v ha-mcp-data:/home/mcpuser/.ha-mcp -e HOMEASSISTANT_URL={{HOMEASSISTANT_URL}} -e HOMEASSISTANT_TOKEN={{HOMEASSISTANT_TOKEN}} ghcr.io/homeassistant-ai/ha-mcp:latest ha-mcp-web&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Server will be at: http://YOUR_IP:8086/mcp&lt;/p&gt;
&lt;p&gt;detail:https://homeassistant-ai.github.io/ha-mcp/setup/?method=docker&amp;amp;client=claude-desktop&amp;amp;scope=local&amp;amp;platform=linux&lt;/p&gt;
&lt;h3 class="instruction-title" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; --tw-rotate: 0; --tw-skew-x: 0; --tw-skew-y: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-ring-offset-width: 0px; --tw-ring-offset-color: #fff; --tw-ring-color: #3b82f680; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-shadow: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-shadow-colored: 0 0 #0000; box-sizing: border-box; border: 0px solid #e5e7eb; margin: 0px; background-color: rgba(241, 245, 249, 0.3);"&gt;&amp;nbsp;&lt;/h3&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 id="mcetoc_1jv4cr96rb"&gt;step 2.Install HA-MCP Custom Component in Home Assistant&lt;/h3&gt;
&lt;p&gt;To add the Model Context Protocol Server service to your Home Assistant instance, use this Integration:&lt;/p&gt;
&lt;p&gt;https://github.com/homeassistant-ai/ha-mcp-integration&lt;/p&gt;
&lt;p&gt;source code:https://github.com/homeassistant-ai/ha-mcp/tree/master/custom_components/ha_mcp_tools&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 id="mcetoc_1jv4cr96rc"&gt;step 3.Create a long-lived access token in Home Assistant&lt;/h3&gt;
&lt;p&gt;You may create a Long-lived access token to allow the client to access the Home Assistant API.&lt;/p&gt;
&lt;p&gt;Go to User profile &amp;gt; Security tab,select Create token.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 id="mcetoc_1jv4cr96rd"&gt;step 4.Configure Claude&lt;/h3&gt;
&lt;p&gt;An LLM application acts as a client and can connect to multiple MCP servers to provide context.&lt;/p&gt;
&lt;pre class="language-csharp"&gt;&lt;code&gt;{
  "mcpServers": {
    "homeassistant": {
      "type": "http",
      "url": "http://localhost:9090",
      "headers": { "Authorization": "Bearer your-ha-access-token" }
    }
  }
}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2 id="mcetoc_1jv49cfk7j"&gt;Usage Examples&lt;/h2&gt;
&lt;p&gt;Automation Creation&lt;/p&gt;
&lt;pre class="language-csharp"&gt;&lt;code&gt;"Create an automation that turns off all lights when I leave home"
"Set up a morning routine at 7 AM with lights and coffee machine"
"Alert me when the washing machine finishes"&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;useful links&lt;/p&gt;
&lt;p&gt;https://homeassistant-ai.github.io/ha-mcp&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;download&amp;nbsp;stable release&amp;nbsp;from the latest release&lt;/p&gt;
&lt;p&gt;https://github.com/homeassistant-ai/ha-mcp/releases&lt;/p&gt;
&lt;p&gt;https://github.com/homeassistant-ai/ha-mcp/releases/tag/v8.0.0&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Home Assistant MCP Server Add-on doc&lt;/p&gt;
&lt;p&gt;https://github.com/homeassistant-ai/ha-mcp/blob/master/homeassistant-addon/README.md&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Runs the full ha-mcp server inside Home Assistant.&lt;/p&gt;
&lt;p&gt;Home Assistant MCP Setup：https://homeassistant-ai.github.io/ha-mcp/setup/?method=ha-component&amp;amp;client=open-webui&amp;amp;scope=local&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;LM Studio +ollama+unofficial HA-MCP Server+ Claude Code&lt;/p&gt;
&lt;p&gt;https://www.xda-developers.com/i-connected-my-local-llm-to-home-assistant-through-mcp/&lt;/p&gt;</content>
  </entry>
  <entry>
    <id>http://blog.matterxiaomi.com/blog/ha-template-part1/</id>
    <title>Ha Template</title>
    <updated>2026-07-17T18:55:21Z</updated>
    <published>2026-07-11T11:26:39Z</published>
    <link href="http://blog.matterxiaomi.com/blog/ha-template-part1/" />
    <author>
      <name>test@example.com</name>
      <email>blog.matterxiaomi.com</email>
    </author>
    <content type="html">&lt;p&gt;The Template integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] allows creating entities which derive their values from other data.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Legacy template entities (alarm_control_panel, binary_sensor, cover, fan, light, lock, sensor, switch, vacuum, weather) have been removed in 2026.6. You have to migrate to modern template entity syntax.&lt;/p&gt;
&lt;div class="mce-toc"&gt;
&lt;h2&gt;Table of Contents&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#mcetoc_1jt8f4dn36"&gt;ha 2026.5&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#mcetoc_1jt8f4dn37"&gt;ha 2026.6&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;h2 id="mcetoc_1jt8f4dn36"&gt;ha 2026.5&lt;/h2&gt;
&lt;p&gt;Old Syntax&lt;/p&gt;
&lt;pre class="language-csharp"&gt;&lt;code&gt;#
# ---------------------------------- vacuum Template -----------------------------------
#
# https://www.home-assistant.io/integrations/vacuum.template/  old
# https://www.home-assistant.io/integrations/template/#state-based-vacuum---custom-attributes  new
vacuum:
  - platform: template
    vacuums:
      virtual_hallway_room_vacuum:
      #  unique_id:  virtual_hallway_room_vacuum

        start:
            action: script.vacuum_start
        pause:
            action: script.vacuum_pause
        stop:
            action: script.vacuum_stop
        return_to_base:
            action: script.vacuum_return_to_dock
        clean_spot:
            action: script.vacuum_clean_spot
        locate:
            action: script.vacuum_locate_vacuum
        set_fan_speed:
            action: script.vacuum_set_fan_speed
            data:
              speed: "{{ fan_speed }}"
        fan_speeds:
            - Low
            - Medium
            - High
        value_template: "{{ states('sensor.deebotx5pro') }}"
        # battery_level_template: "{{ states('sensor.deebotx5pro_battery')|int }}"
        fan_speed_template: "{{ states('sensor.vacuum_fan_speed') }}"
        attribute_templates:
          status: &amp;gt;-
            {% if (states('sensor.robot_vacuum_robot_cleaner_movement') == "after" and states('sensor.robot_vacuum_robot_cleaner_cleaning_mode') == "stop")  %}
              Charging to Resume
            {% elif states('sensor.vacuum.deebotx5pro') == "auto" %}
              Cleaning
            {% else %}
              Charging
            {% endif %}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Legacy (removed in 2026.6)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Unsupported YAML configuration for the command_line&amp;nbsp;&lt;/p&gt;
&lt;pre class="language-csharp"&gt;&lt;code&gt;Configuring the template integration by adding platform: template under the vacuum: key is not supported. The template integration must be configured under its own template: key instead.

To resolve this:

Remove the following from your YAML configuration file:
vacuum:
  - platform: template
Move the configuration under the template: key instead.

Restart Home Assistant.&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2 id="mcetoc_1jt8f4dn37"&gt;ha 2026.6&lt;/h2&gt;
&lt;p&gt;New Syntax&lt;/p&gt;
&lt;pre class="language-csharp"&gt;&lt;code&gt;#
# ---------------------------------- Template -----------------------------------
#
# https://www.home-assistant.io/integrations/template
# https://community.home-assistant.io/t/how-to-define-area-in-configuration-yaml/240296/13
template:
  # https://www.home-assistant.io/integrations/template/#vacuum   new template 20260711
  - vacuum:
      - name: Living Room Vacuum
        clean_segments:
          action: script.vacuum_start
          data:
            segment_ids: "{{ segment_ids }}"
        segments: &amp;gt;-
          {{ [
            {'id': '1', 'name': 'Kitchen'},
            {'id': '2', 'name': 'Living room', 'group': 'Upstairs'},
          ] }}
        start:
          action: script.vacuum_start
        unique_id: living_room_vacuum&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;useful links&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;https://smarthomeassistant.co.uk/articles/home-automation/home-assistant-2026-6-template-migration&lt;/p&gt;</content>
  </entry>
  <entry>
    <id>http://blog.matterxiaomi.com/blog/ecovacs-part10/</id>
    <title>Ecovacs in Home Assistant Part10 - extend ecovacs build-in integration for the Ecovacs X5 Pro( )</title>
    <updated>2026-07-06T21:45:49Z</updated>
    <published>2026-07-04T20:04:42Z</published>
    <link href="http://blog.matterxiaomi.com/blog/ecovacs-part10/" />
    <author>
      <name>test@example.com</name>
      <email>blog.matterxiaomi.com</email>
    </author>
    <category term="vacuum" />
    <content type="html">&lt;p&gt;Ecovacs in Home Assistant Part10 - extend ecovacs build-in integration for the Ecovacs X5 Pro(mxse7w.py )&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;DEEBOT X5 PRO (China Version - MXSE7W)&lt;/h2&gt;
&lt;p&gt;This article specifically targets the Chinese Mainland version of the ECOVACS DEEBOT X5 PRO.&lt;/p&gt;
&lt;p&gt;Unlike the global models, the Chinese version has several hardware and software differences that are important when integrating it with Home Assistant.&lt;/p&gt;
&lt;p&gt;By extending the device capability definition, Home Assistant can access several additional OMNI station features that are already supported by the robot firmware.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The model covered in this article is:&lt;/p&gt;
&lt;pre class="language-csharp"&gt;&lt;code&gt;Product: DEEBOT X5 PRO
Model: MXSE7W
Region: China &lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The capability definition for the Chinese version is located in:&lt;/p&gt;
&lt;p&gt;https://github.com/DeebotUniverse/client.py/blob/dev/deebot_client/hardware/mxse7w.py&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This file acts as the capability map between Home Assistant and the robot.&lt;/p&gt;
&lt;p&gt;It tells Home Assistant:&lt;/p&gt;
&lt;p&gt;which commands the robot supports&lt;/p&gt;
&lt;p&gt;which settings can be modified&lt;/p&gt;
&lt;p&gt;which events should be monitored&lt;/p&gt;
&lt;p&gt;which sensors should be exposed&lt;/p&gt;
&lt;p&gt;how the OMNI station can be controlled&lt;/p&gt;
&lt;pre class="language-csharp"&gt;&lt;code&gt;"""Deebot DEEBOT X5 PRO OMNI Capabilities."""

from __future__ import annotations

# Import various "Capability" base classes and device type definitions from the deebot_client library
from deebot_client.capabilities import (
    Capabilities,
    CapabilityClean,
    CapabilityCleanAction,
    CapabilityCustomCommand,
    CapabilityEvent,
    CapabilityExecute,
    CapabilityExecuteTypes,
    CapabilityLifeSpan,
    CapabilityMap,
    CapabilitySet,
    CapabilitySetEnable,
    CapabilitySettings,
    CapabilitySetTypes,
    CapabilityStation,
    CapabilityStats,
    CapabilityWater,
    DeviceType,
)
# Import relevant commands for controlling station actions and JSON serialization
from deebot_client.commands import StationAction
from deebot_client.commands.json import station_action
from deebot_client.commands.json.advanced_mode import GetAdvancedMode, SetAdvancedMode
from deebot_client.commands.json.auto_empty import GetAutoEmpty, SetAutoEmpty
from deebot_client.commands.json.battery import GetBattery
from deebot_client.commands.json.carpet import (
    GetCarpetAutoFanBoost,
    SetCarpetAutoFanBoost,
)
from deebot_client.commands.json.charge import Charge
from deebot_client.commands.json.charge_state import GetChargeState
from deebot_client.commands.json.child_lock import GetChildLock, SetChildLock
from deebot_client.commands.json.clean import CleanAreaV2, CleanV2
from deebot_client.commands.json.clean_count import GetCleanCount, SetCleanCount
from deebot_client.commands.json.clean_logs import GetCleanLogs
from deebot_client.commands.json.clean_preference import (
    GetCleanPreference,
    SetCleanPreference,
)
from deebot_client.commands.json.continuous_cleaning import (
    GetContinuousCleaning,
    SetContinuousCleaning,
)
from deebot_client.commands.json.custom import CustomCommand
from deebot_client.commands.json.efficiency import GetEfficiencyMode, SetEfficiencyMode
from deebot_client.commands.json.error import GetError
from deebot_client.commands.json.fan_speed import GetFanSpeed, SetFanSpeed
from deebot_client.commands.json.life_span import GetLifeSpan, ResetLifeSpan
from deebot_client.commands.json.map import (
    GetCachedMapInfo,
    GetMajorMap,
    GetMapInfoV2,
    GetMapSetV2,
    GetMapTrace,
    GetMinorMap,
    SetMajorMap,
)
from deebot_client.commands.json.multimap_state import (
    GetMultimapState,
    SetMultimapState,
)
from deebot_client.commands.json.network import GetNetInfo
from deebot_client.commands.json.ota import GetOta, SetOta
from deebot_client.commands.json.play_sound import PlaySound
from deebot_client.commands.json.pos import GetPos
from deebot_client.commands.json.relocation import SetRelocationState
from deebot_client.commands.json.stats import GetStats, GetTotalStats
from deebot_client.commands.json.sweep_mode import GetSweepMode, SetSweepMode
from deebot_client.commands.json.true_detect import GetTrueDetect, SetTrueDetect
from deebot_client.commands.json.voice_assistant_state import (
    GetVoiceAssistantState,
    SetVoiceAssistantState,
)
from deebot_client.commands.json.volume import GetVolume, SetVolume
from deebot_client.commands.json.water_info import GetWaterInfo, SetWaterInfo
from deebot_client.commands.json.work_mode import GetWorkMode, SetWorkMode
from deebot_client.commands.json.work_state import GetWorkState
from deebot_client.const import DataType

# Import "Event" and enum definitions used to notify the client when the vacuum state changes
from deebot_client.events import (
    AdvancedModeEvent,
    AvailabilityEvent,
    BatteryEvent,
    CachedMapInfoEvent,
    CarpetAutoFanBoostEvent,
    ChildLockEvent,
    CleanCountEvent,
    CleanLogEvent,
    CleanPreferenceEvent,
    ContinuousCleaningEvent,
    CustomCommandEvent,
    EfficiencyModeEvent,
    ErrorEvent,
    FanSpeedEvent,
    FanSpeedLevel,
    LifeSpan,
    LifeSpanEvent,
    MajorMapEvent,
    MapChangedEvent,
    MapTraceEvent,
    MultimapStateEvent,
    NetworkInfoEvent,
    OtaEvent,
    PositionsEvent,
    ReportStatsEvent,
    RoomsEvent,
    StateEvent,
    StationEvent,
    StatsEvent,
    SweepModeEvent,
    TotalStatsEvent,
    TrueDetectEvent,
    VoiceAssistantStateEvent,
    VolumeEvent,
    WorkMode,
    WorkModeEvent,
    auto_empty,
    water_info,
)
from deebot_client.events.auto_empty import AutoEmptyEvent
from deebot_client.events.efficiency_mode import EfficiencyMode
from deebot_client.models import StaticDeviceInfo


def get_device_info() -&amp;gt; StaticDeviceInfo:
    """Get all static device information and capability mappings supported by the DEEBOT X5 PRO OMNI model."""
    return StaticDeviceInfo(
        DataType.JSON,  # This model uses JSON data format for communication
        Capabilities(
            device_type=DeviceType.VACUUM,  # Device type: Robotic Vacuum Cleaner
            
            # --- Basic Status Capabilities ---
            availability=CapabilityEvent(
                AvailabilityEvent, [GetBattery(is_available_check=True)]
            ),  # Availability status (determines if the device is online by checking the battery status)
            battery=CapabilityEvent(BatteryEvent, [GetBattery()]),  # Battery level status
            charge=CapabilityExecute(Charge),  # Charging control command (return to dock)
            
            # --- Cleaning Control Capabilities ---
            clean=CapabilityClean(
                action=CapabilityCleanAction(command=CleanV2, area=CleanAreaV2),  # Global cleaning and area cleaning
                continuous=CapabilitySetEnable(
                    ContinuousCleaningEvent,
                    [GetContinuousCleaning()],
                    SetContinuousCleaning,
                ),  # Continuous cleaning / Resume cleaning (Get/Set/Event)
                count=CapabilitySet(CleanCountEvent, [GetCleanCount()], SetCleanCount),  # Cleaning cycle count (e.g., clean 1 or 2 times)
                log=CapabilityEvent(CleanLogEvent, [GetCleanLogs()]),  # Cleaning logs / historical records
                preference=CapabilitySetEnable(
                    CleanPreferenceEvent, [GetCleanPreference()], SetCleanPreference
                ),  # Cleaning preference settings
                work_mode=CapabilitySetTypes(
                    event=WorkModeEvent,
                    get=[GetWorkMode()],
                    set=SetWorkMode,
                    types=(
                        WorkMode.MOP,               # Mop only
                        WorkMode.MOP_AFTER_VACUUM,  # Mop after vacuum
                        WorkMode.VACUUM,            # Vacuum only
                        WorkMode.VACUUM_AND_MOP,    # Vacuum and mop simultaneously
                    ),
                ),  # Working mode switching
            ),
            
            # --- Custom Commands &amp;amp; Error Handling ---
            custom=CapabilityCustomCommand(
                event=CustomCommandEvent, get=[], set=CustomCommand
            ),  # Passthrough / custom low-level command capability
            error=CapabilityEvent(ErrorEvent, [GetError()]),  # Malfunction and error events
            
            # --- Fan Speed Settings ---
            fan_speed=CapabilitySetTypes(
                event=FanSpeedEvent,
                get=[GetFanSpeed()],
                set=SetFanSpeed,
                types=(
                    FanSpeedLevel.QUIET,     # Quiet
                    FanSpeedLevel.NORMAL,    # Normal
                    FanSpeedLevel.MAX,       # Max
                    FanSpeedLevel.MAX_PLUS,  # Max Plus
                ),
            ),
            
            # --- Consumables &amp;amp; Maintenance Lifecycle ---
            life_span=CapabilityLifeSpan(
                types=(
                    LifeSpan.BRUSH,              # Main brush
                    LifeSpan.FILTER,             # Dustbin filter
                    LifeSpan.HAND_FILTER,        # Handheld / fine filter
                    LifeSpan.SIDE_BRUSH,         # Side brush
                    LifeSpan.UNIT_CARE,          # Unit maintenance
                    LifeSpan.CLEANING_SOLUTION,  # Cleaning solution
                    LifeSpan.SEWAGE_BOX,         # Wastewater tank maintenance
                ),
                event=LifeSpanEvent,
                get=[
                    GetLifeSpan(
                        [
                            LifeSpan.BRUSH,
                            LifeSpan.FILTER,
                            LifeSpan.HAND_FILTER,
                            LifeSpan.SIDE_BRUSH,
                            LifeSpan.CLEANING_SOLUTION,
                            LifeSpan.SEWAGE_BOX,
                        ]
                    )
                ],
                reset=ResetLifeSpan,  # Reset consumable lifecycle timer command
            ),
            
            # --- Map Capabilities ---
            map=CapabilityMap(
                cached_info=CapabilityEvent(CachedMapInfoEvent, [GetCachedMapInfo()]),  # Cached map information
                changed=CapabilityEvent(MapChangedEvent, []),  # Map update / change events
                info=CapabilityExecute(GetMapInfoV2),  # Get basic map details
                major=CapabilitySet(MajorMapEvent, [GetMajorMap()], SetMajorMap),  # Main map management
                minor=CapabilityExecute(GetMinorMap),  # Secondary / multi-floor map management
                multi_state=CapabilitySetEnable(
                    MultimapStateEvent, [GetMultimapState()], SetMultimapState
                ),  # Multi-map management switch state
                position=CapabilityEvent(PositionsEvent, [GetPos()]),  # Real-time vacuum coordinates on the map
                relocation=CapabilityExecute(SetRelocationState),  # Relocation command
                rooms=CapabilityEvent(RoomsEvent, [GetCachedMapInfo()]),  # Room / zone information on the map
                set=CapabilityExecute(GetMapSetV2),  # Map configurations and settings
                trace=CapabilityEvent(MapTraceEvent, [GetMapTrace()]),  # Cleaning path / movement trace
            ),
            
            # --- Network &amp;amp; Audio ---
            network=CapabilityEvent(NetworkInfoEvent, [GetNetInfo()]),  # Wi-Fi and network status information
            play_sound=CapabilityExecute(PlaySound),  # Find my robot / play prompt tone
            
            # --- Advanced Settings ---
            settings=CapabilitySettings(
                advanced_mode=CapabilitySetEnable(
                    AdvancedModeEvent, [GetAdvancedMode()], SetAdvancedMode
                ),  # Advanced mode switch
                carpet_auto_fan_boost=CapabilitySetEnable(
                    CarpetAutoFanBoostEvent,
                    [GetCarpetAutoFanBoost()],
                    SetCarpetAutoFanBoost,
                ),  # Auto-boost suction on carpets switch
                child_lock=CapabilitySetEnable(
                    ChildLockEvent, [GetChildLock()], SetChildLock
                ),  # Child lock switch
                efficiency_mode=CapabilitySetTypes(
                    event=EfficiencyModeEvent,
                    get=[GetEfficiencyMode()],
                    set=SetEfficiencyMode,
                    types=(
                        EfficiencyMode.ENERGY_EFFICIENT_MODE, # Energy-saving mode
                        EfficiencyMode.STANDARD_MODE,         # Standard mode
                    ),
                ),  # Cleaning efficiency / power consumption mode
                ota=CapabilitySetEnable(OtaEvent, [GetOta()], SetOta),  # Firmware OTA update status and settings
                sweep_mode=CapabilitySetEnable(
                    SweepModeEvent, [GetSweepMode()], SetSweepMode
                ),  # Sweeping mode settings
                true_detect=CapabilitySetEnable(
                    TrueDetectEvent, [GetTrueDetect()], SetTrueDetect
                ),  # TrueDetect 3D structured light obstacle avoidance switch
                voice_assistant=CapabilitySetEnable(
                    VoiceAssistantStateEvent,
                    [GetVoiceAssistantState()],
                    SetVoiceAssistantState,
                ),  # YIKO voice assistant status and switch
                volume=CapabilitySet(VolumeEvent, [GetVolume()], SetVolume),  # Voice broadcast volume settings
            ),
            
            # --- Operation &amp;amp; Station Status Monitoring ---
            state=CapabilityEvent(StateEvent, [GetChargeState(), GetWorkState()]),  # Vacuum main state (Charging/Working)
            station=CapabilityStation(
                action=CapabilityExecuteTypes(
                    station_action.StationAction, types=(StationAction.EMPTY_DUSTBIN,)
                ),  # Control station actions (e.g., manually trigger dust collection)
                auto_empty=CapabilitySetTypes(
                    event=AutoEmptyEvent,
                    get=[GetAutoEmpty()],
                    set=SetAutoEmpty,
                    types=(
                        auto_empty.Frequency.AUTO,  # Automatic dust collection
                        auto_empty.Frequency.SMART, # Smart dust collection
                    ),
                ),  # Auto-empty frequency settings
                state=CapabilityEvent(StationEvent, [GetWorkState()]),  # OMNI station's own working state
            ),
            
            # --- Cleaning Statistics Data ---
            stats=CapabilityStats(
                clean=CapabilityEvent(StatsEvent, [GetStats()]),  # Current / single cleaning session stats (area, time)
                report=CapabilityEvent(ReportStatsEvent, []),  # Data reporting events
                total=CapabilityEvent(TotalStatsEvent, [GetTotalStats()]),  # Lifetime cumulative cleaning statistics
            ),
            
            # --- Water Tank &amp;amp; Mop Module Control ---
            water=CapabilityWater(
                amount=CapabilitySetTypes(
                    event=water_info.WaterAmountEvent,
                    get=[GetWaterInfo()],
                    set=SetWaterInfo,
                    types=(
                        water_info.WaterAmount.LOW,    # Low water level
                        water_info.WaterAmount.MEDIUM, # Medium water level
                        water_info.WaterAmount.HIGH,   # High water level
                    ),
                ),  # Mopping water flow adjustment
                mop_attached=CapabilityEvent(
                    water_info.MopAttachedEvent, [GetWaterInfo()]
                ),  # Detect whether the mopping pad/bracket is installed
            ),
        ),
    )&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Overall Structure&lt;/p&gt;
&lt;p&gt;The file follows a simple three-level hierarchy:&lt;/p&gt;
&lt;pre class="language-csharp"&gt;&lt;code&gt;StaticDeviceInfo
        │
        └── Capabilities
                │
                ├── clean
                ├── map
                ├── station
                ├── water
                ├── settings
                ├── battery
                ├── stats
                └── ...&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;1.Root Node &amp;mdash;&amp;mdash; StaticDeviceInfo&lt;/p&gt;
&lt;p&gt;StaticDeviceInfo is the root object.&lt;/p&gt;
&lt;p&gt;It defines the robot's communication protocol (JSON) and registers every capability supported by the device.&lt;/p&gt;
&lt;p&gt;&lt;img src="/Posts/files/x5--pro-mqtt-1_639187923425632462.JPG" alt="x5--pro-mqtt-1.JPG" width="380" height="155" /&gt;&lt;/p&gt;
&lt;p&gt;2.Branch Nodes&lt;/p&gt;
&lt;p&gt;Branch Nodes &amp;mdash; Capabilities&lt;/p&gt;
&lt;p&gt;Each branch groups together a specific category of functionality.&lt;/p&gt;
&lt;p&gt;Each branch contains one or more commands, events, and configuration options.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="/Posts/files/x5--pro-mqtt-2_639187923425779206.JPG" alt="x5--pro-mqtt-2.JPG" width="941" height="511" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;3.Leaf Nodes&lt;/p&gt;
&lt;p&gt;Leaf Nodes &amp;mdash; Individual Commands&lt;/p&gt;
&lt;p&gt;The leaf nodes are the actual commands and events exchanged with the robot.&lt;/p&gt;
&lt;p&gt;These commands correspond to the JSON requests sent through the official ECOVACS Open Platform API.&lt;/p&gt;
&lt;p&gt;When Home Assistant calls one of these commands, the robot executes the requested action and returns the corresponding status or result.&lt;/p&gt;
&lt;p&gt;&lt;img src="/Posts/files/x5--pro-mqtt-3_639187923661096353.JPG" alt="x5--pro-mqtt-3.JPG" width="950" height="667" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;Extend the Built-in Home Assistant Ecovacs Integration for the DEEBOT X5 PRO (MXSE7W, China Version)&lt;/h2&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;step 1.Copy the original hardware definition from the Home Assistant container.&lt;/p&gt;
&lt;pre class="language-csharp"&gt;&lt;code&gt;cd /data/homeassistant202405

docker cp  ha:/usr/local/lib/python3.14/site-packages/deebot_client/hardware/mxse7w.py .
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This creates a local copy that can be edited safely.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;step 2.Add new station actions for StationAction.CLEAN_BASE functionality&lt;/p&gt;
&lt;p&gt;Locate the following section:&lt;/p&gt;
&lt;pre class="language-csharp"&gt;&lt;code&gt;station=CapabilityStation(
    action=CapabilityExecuteTypes(
        station_action.StationAction,
        types=(
            StationAction.EMPTY_DUSTBIN,
        ),
    ),
)&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Replace it with:&lt;/p&gt;
&lt;pre class="language-csharp"&gt;&lt;code&gt;            station=CapabilityStation(
                action=CapabilityExecuteTypes(
                    station_action.StationAction, 
                    types=(
                           StationAction.EMPTY_DUSTBIN,
                           StationAction.DRY_MOP,
                           StationAction.WASH_MOP,
                           StationAction.CLEAN_BASE,
                     ) # add StationAction.WASH_MOP, 20260715
                ),&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;step 3.Replace the Original File&lt;/p&gt;
&lt;p&gt;Copy the modified file back into the container.&lt;/p&gt;
&lt;pre class="language-csharp"&gt;&lt;code&gt;docker cp mxse7w.py ha:/usr/local/lib/python3.14/site-packages/deebot_client/hardware/

docker restart ha&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;step 4.Verify in Home Assistant&lt;/p&gt;
&lt;p&gt;The newly added station services should now appear in Home Assistant.&lt;/p&gt;
&lt;p&gt;output&lt;/p&gt;
&lt;p&gt;&lt;img src="/Posts/files/x5--pro-mqtt-ui4_639187927267047434.JPG" alt="x5--pro-mqtt-ui4.JPG" width="327" height="344" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="/Posts/files/x5--pro-mqtt-ui5_639187927267148976.JPG" alt="x5--pro-mqtt-ui5.JPG" width="347" height="380" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This approach extends the existing integration without modifying Home Assistant's core logic, making it a simple and maintainable customization for the Chinese Mainland MXSE7W model.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</content>
  </entry>
  <entry>
    <id>http://blog.matterxiaomi.com/blog/yeelight-pro-part1/</id>
    <title>Yeelight pro devices to Home Assistant</title>
    <updated>2026-06-29T21:06:12Z</updated>
    <published>2026-06-27T23:47:51Z</published>
    <link href="http://blog.matterxiaomi.com/blog/yeelight-pro-part1/" />
    <author>
      <name>test@example.com</name>
      <email>blog.matterxiaomi.com</email>
    </author>
    <category term="yeelight pro" />
    <content type="html">&lt;p&gt;Yeelight pro gateway and sub devices to Home Assistant.&lt;/p&gt;
&lt;p&gt;&lt;img src="/Posts/files/Yeelight-pro-ha-1_639182034009153804.JPG" alt="Yeelight pro devices to Home Assistant" width="1036" height="568" /&gt;&lt;/p&gt;
&lt;p&gt;Yeelight Pro Gateway and sub devices can be integrated into Home Assistant (HA) natively via&amp;nbsp; a custom local integration.you can use a custom integration dedicated to the Yeelight Pro Local API.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;https://en.yeelight.com/product/yeelight-pro-s20-gateway-ble-mesh/&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To successfully integrate the Yeelight Pro S20 Gateway (Enhanced Edition) into Home Assistant, you need to complete the following steps:&lt;/p&gt;
&lt;p&gt;step 1.Download the Yeelight Pro app.&lt;/p&gt;
&lt;p&gt;step 2.Add the gateway and its sub-devices within the Yeelight Pro app.&lt;/p&gt;
&lt;p&gt;step 3.Enable the local area network (LAN) control settings for the gateway inside the Yeelight Pro app.&lt;/p&gt;
&lt;p&gt;step 4.Integrate the gateway into Home Assistant using the https://github.com/hasscc/yeelight-pro custom integration.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Enabe LAN mode:&lt;/strong&gt;You must enabe LAN mode for the yeelight&amp;nbsp; pro gateway via the yeelight pro app.&lt;/p&gt;
&lt;p&gt;Connect call&amp;nbsp; ('192.168.2.126', 65443)&lt;/p&gt;
&lt;p&gt;Integration is attempting to establish a local network connection using specific parameters.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;Integration&lt;/h2&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Yeelight Pro Integration for Home Assistant&lt;/p&gt;
&lt;p&gt;https://github.com/hasscc/yeelight-pro&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</content>
  </entry>
  <entry>
    <id>http://blog.matterxiaomi.com/blog/shell-part1/</id>
    <title>Truncate the home-assistant.log file Using a Shell Command</title>
    <updated>2026-06-21T20:07:18Z</updated>
    <published>2026-06-21T00:49:06Z</published>
    <link href="http://blog.matterxiaomi.com/blog/shell-part1/" />
    <author>
      <name>test@example.com</name>
      <email>blog.matterxiaomi.com</email>
    </author>
    <category term="automation" />
    <content type="html">&lt;article class="my-4 md:my-8"&gt;&lt;header&gt;
&lt;div&gt;When my &lt;a href="https://joshmccarty.com/tag/home-assistant/"&gt;Home Assistant instance&lt;/a&gt; goes a couple weeks between restarts, the home-assistant.log file can grow to nearly a gigabyte in size if there are any integrations that are throwing error messages regularly. Even on an &lt;a href="https://amzn.to/3x9UwrL" rel="nofollow sponsored noopener"&gt;Intel NUC&lt;/a&gt; with a 128GB SSD this was making my snapshots/backups too large in size and using up all of my hard drive space (I run &lt;a href="https://www.home-assistant.io/installation/"&gt;Home Assistant OS&lt;/a&gt;). I needed to find a way to automatically reduce the size of this file when it grew too large. I used the following approach.&lt;/div&gt;
&lt;/header&gt;
&lt;div&gt;
&lt;ol&gt;
&lt;li&gt;A command_line sensor to monitor the home-assistant.log file size&lt;/li&gt;
&lt;li&gt;A shell_command to truncate the log file to 100MB&lt;/li&gt;
&lt;li&gt;An automation to execute the shell command when the file grows to 200MB&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;File Size Sensor&lt;/h2&gt;
&lt;p&gt;Creating a sensor to monitor the size of the log file is pretty straightforward. Although there is a &lt;a href="https://www.home-assistant.io/integrations/filesize/"&gt;file_size sensor&lt;/a&gt; I went with a &lt;a href="https://www.home-assistant.io/integrations/command_line/"&gt;command_line sensor&lt;/a&gt; because it was easier to test and debug using the Reload Command Line Entities button in the &lt;a href="https://my.home-assistant.io/redirect/server_controls/"&gt;Server Controls panel&lt;/a&gt;. This is the YAML code I used to get the file size in megabytes in my configuration.yaml file:&lt;/p&gt;
&lt;pre class="language-csharp" tabindex="0"&gt;&lt;code&gt;# https://joshmccarty.com/truncate-the-home-assistant-log-file-using-a-shell-command/
# change to as flow
# https://www.home-assistant.io/integrations/command_line/
command_line:
  - sensor:
      name: "Ha Log File Size"
      command: "du -m home-assistant.log | cut -f1"
      unit_of_measurement: MB
      value_template: "{{ value|int(0) }}"
      scan_interval: 3600&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Shell Command&lt;/h2&gt;
&lt;p&gt;The &lt;a href="https://www.home-assistant.io/integrations/shell_command/"&gt;shell_command&lt;/a&gt; to truncate the log file size took a some trial and error. Ultimately I created a bash script file that the shell_command executed so I could make changes to the script without restarting Home Assistant every time I wanted to try a different shell command to get things working right.&lt;/p&gt;
&lt;p&gt;I created the shell script file using the &lt;a href="https://community.home-assistant.io/t/home-assistant-community-add-on-visual-studio-code/107863"&gt;Visual Studio Code Add-on&lt;/a&gt;, but you could do this however you edit YAML files in your current Home Assistant instance. I named it truncate_log.sh and saved it in the config folder for Home Assistant. The file contains the following script:&lt;/p&gt;
&lt;pre class="language-csharp" tabindex="0"&gt;&lt;code&gt;#!/usr/bin/env sh

truncate -s 100MB /config/home-assistant.log&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Once the shell script file is created, you have to make it executable using the following command in the config directory: chmod +x truncate_log.sh. I did this via the &lt;a href="https://github.com/hassio-addons/addon-ssh/blob/main/README.md"&gt;Terminal/SSH Add-on&lt;/a&gt;. Then you can create the shell_command to call the bash script file in your configuration.yaml file:&lt;/p&gt;
&lt;pre class="wp-block-code  language-yaml" tabindex="0"&gt;&lt;code&gt;shell_command:
  truncate_log: /config/truncate_log.sh&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Automating Things&lt;/h2&gt;
&lt;p&gt;Finally, I created an &lt;a href="https://www.home-assistant.io/docs/automation/"&gt;automation&lt;/a&gt; that uses a numeric_state trigger to run the shell_command when the log file gets over 200MB in size. I did this via the UI, but the following YAML will work:&lt;/p&gt;
&lt;pre class="language-csharp" tabindex="0"&gt;&lt;code&gt;alias: 'Truncate Log File'
description: &amp;gt;-
  This truncates the home-assistant.log file to 100MB when it grows past 200MB
  to prevent it from ballooning in size between restarts.
trigger:
  - platform: numeric_state
    entity_id: sensor.log_file_size
    above: '200'
    for:
      hours: 0
      minutes: 10
      seconds: 0
      milliseconds: 0
action:
  - service: shell_command.truncate_log
mode: single&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;aside&gt;&lt;/aside&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;
&lt;footer&gt;&lt;/footer&gt;&lt;/article&gt;</content>
  </entry>
  <entry>
    <id>http://blog.matterxiaomi.com/blog/raspberry-pi-part11/</id>
    <title>Part 11 - How to Free Disk Space on Raspberry Pi OS</title>
    <updated>2026-06-13T08:03:19Z</updated>
    <published>2026-06-01T18:07:32Z</published>
    <link href="http://blog.matterxiaomi.com/blog/raspberry-pi-part11/" />
    <author>
      <name>test@example.com</name>
      <email>blog.matterxiaomi.com</email>
    </author>
    <category term="docker" />
    <category term="raspberry pi os lite (64-bit)" />
    <category term="raspberry pi" />
    <content type="html">&lt;p&gt;If you are on Home Assistant Docker,the possible sources of large disk space usage:&lt;/p&gt;
&lt;h2&gt;Inside Home Assistant&lt;/h2&gt;
&lt;p&gt;Auto Backups&lt;/p&gt;
&lt;p&gt;Home Assistant Database&lt;/p&gt;
&lt;p&gt;home-assistant.log too large&lt;/p&gt;
&lt;p&gt;Media or share (if not network attached storage)&lt;/p&gt;
&lt;p&gt;tts&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;core file too large&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;Outside Home Assistant&lt;/h2&gt;
&lt;p&gt;.git&lt;/p&gt;
&lt;p&gt;docker images&lt;/p&gt;
&lt;p&gt;docker logs&lt;/p&gt;
&lt;p&gt;Addons data cache (eg. ESPHome Addon)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;os system log&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you&amp;nbsp; have access to a shell(eg. using the Terminal&amp;amp;SSH Addon), make sure to run&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;login&lt;/p&gt;
&lt;p&gt;To get full access.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can first try&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;du -h -d 1 /&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can play with variations of this, for example&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;du -ah -d4 / | sort -hr | head -n 20&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Useful links&lt;/p&gt;
&lt;p&gt;How to&amp;nbsp;Truncate the home-assistant.log file Using a Shell Command in home assistant&lt;/p&gt;
&lt;p&gt;https://joshmccarty.com/truncate-the-home-assistant-log-file-using-a-shell-command/&lt;/p&gt;</content>
  </entry></feed>