<?xml version="1.0" encoding="utf-8" standalone="yes"?><?xml-stylesheet href="/feed_style.xsl" type="text/xsl"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="https://www.rssboard.org/media-rss"><channel><title>Esp32 on MR70</title><link>https://www.mr70.eu/tags/esp32/</link><description>Recent content in Esp32 on MR70</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><copyright>MR70 - [Creative Commons Attribution 4.0 International License](https://creativecommons.org/licenses/by/4.0/).</copyright><lastBuildDate>Sat, 05 Dec 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://www.mr70.eu/tags/esp32/index.xml" rel="self" type="application/rss+xml"/><icon>https://www.mr70.eu/logo.svg</icon><item><title>Home Assistant &amp; Matter over Thread devices using Raspberry PI and ESP32</title><link>https://www.mr70.eu/posts/home-assistant-matter-thread-raspberry-pi-esp32/</link><pubDate>Sat, 05 Dec 2026 00:00:00 +0000</pubDate><guid>https://www.mr70.eu/posts/home-assistant-matter-thread-raspberry-pi-esp32/</guid><description><![CDATA[<p>I wanted to control some Matter over Thread devices with Home Assistant (HA), using hardware I already had: a Raspberry Pi 2 and an ESP32-C6.</p>
<p>The Raspberry Pi 2 is a 32-bit board, so neither Home Assistant nor Matter are officially supported on it. It works anyway, if you skip the official images and install everything by hand.</p>
<h2 id="home-assistant">Home Assistant</h2>
<p>I created a dedicated Linux user, <code>homeassistant</code>, and a Python project with <a href="https://docs.astral.sh/uv/">uv</a>:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>sudo adduser --system --group --home /home/homeassistant homeassistant
</span></span><span style="display:flex;"><span>sudo -iu homeassistant
</span></span><span style="display:flex;"><span>uv init ha
</span></span><span style="display:flex;"><span><span style="color:#8be9fd;font-style:italic">cd</span> ha
</span></span><span style="display:flex;"><span>uv add homeassistant
</span></span></code></pre></div><p>Home Assistant listens on port <strong>8123</strong>.</p>
<h2 id="matter-server">Matter server</h2>
<p>For the Matter controller I used <a href="https://github.com/matter-js/matterjs-server">matterjs-server</a>, installed with npm in the home directory of the same <code>homeassistant</code> user (it needs Node.js 22.13 or newer):</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>npm install matter-server
</span></span></code></pre></div><p>It listens on port <strong>5580</strong>, and HA connects to it through the Matter integration.</p>
<h2 id="start-at-boot-with-systemd">Start at boot with systemd</h2>
<p>Both services are started at boot by systemd. This is the unit for Home Assistant:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-ini" data-lang="ini"><span style="display:flex;"><span><span style="color:#6272a4"># /etc/systemd/system/homeassistant.service</span>
</span></span><span style="display:flex;"><span><span style="color:#ff79c6">[Unit]</span>
</span></span><span style="display:flex;"><span><span style="color:#50fa7b">Description</span><span style="color:#ff79c6">=</span><span style="color:#f1fa8c">Home Assistant</span>
</span></span><span style="display:flex;"><span><span style="color:#50fa7b">After</span><span style="color:#ff79c6">=</span><span style="color:#f1fa8c">network-online.target</span>
</span></span><span style="display:flex;"><span><span style="color:#50fa7b">Wants</span><span style="color:#ff79c6">=</span><span style="color:#f1fa8c">network-online.target</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#ff79c6">[Service]</span>
</span></span><span style="display:flex;"><span><span style="color:#50fa7b">Type</span><span style="color:#ff79c6">=</span><span style="color:#f1fa8c">simple</span>
</span></span><span style="display:flex;"><span><span style="color:#50fa7b">User</span><span style="color:#ff79c6">=</span><span style="color:#f1fa8c">homeassistant</span>
</span></span><span style="display:flex;"><span><span style="color:#50fa7b">Group</span><span style="color:#ff79c6">=</span><span style="color:#f1fa8c">bluetooth</span>
</span></span><span style="display:flex;"><span><span style="color:#50fa7b">WorkingDirectory</span><span style="color:#ff79c6">=</span><span style="color:#f1fa8c">/home/homeassistant/.homeassistant</span>
</span></span><span style="display:flex;"><span><span style="color:#50fa7b">ExecStart</span><span style="color:#ff79c6">=</span><span style="color:#f1fa8c">/home/homeassistant/ha/.venv/bin/hass -c /home/homeassistant/.homeassistant</span>
</span></span><span style="display:flex;"><span><span style="color:#50fa7b">AmbientCapabilities</span><span style="color:#ff79c6">=</span><span style="color:#f1fa8c">CAP_NET_RAW CAP_NET_ADMIN</span>
</span></span><span style="display:flex;"><span><span style="color:#50fa7b">CapabilityBoundingSet</span><span style="color:#ff79c6">=</span><span style="color:#f1fa8c">CAP_NET_RAW CAP_NET_ADMIN</span>
</span></span><span style="display:flex;"><span><span style="color:#50fa7b">SupplementaryGroups</span><span style="color:#ff79c6">=</span><span style="color:#f1fa8c">bluetooth</span>
</span></span><span style="display:flex;"><span><span style="color:#50fa7b">Restart</span><span style="color:#ff79c6">=</span><span style="color:#f1fa8c">on-failure</span>
</span></span><span style="display:flex;"><span><span style="color:#50fa7b">RestartForceExitStatus</span><span style="color:#ff79c6">=</span><span style="color:#f1fa8c">100</span>
</span></span><span style="display:flex;"><span><span style="color:#50fa7b">Environment</span><span style="color:#ff79c6">=</span><span style="color:#f1fa8c">PATH=/usr/local/bin:/usr/bin:/bin</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#ff79c6">[Install]</span>
</span></span><span style="display:flex;"><span><span style="color:#50fa7b">WantedBy</span><span style="color:#ff79c6">=</span><span style="color:#f1fa8c">multi-user.target</span>
</span></span></code></pre></div><p>And this is the unit for the Matter server. Before each start it removes a stale <code>matter.lock</code> file, which can be left behind after a crash:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-ini" data-lang="ini"><span style="display:flex;"><span><span style="color:#6272a4"># /etc/systemd/system/matter-server.service</span>
</span></span><span style="display:flex;"><span><span style="color:#ff79c6">[Unit]</span>
</span></span><span style="display:flex;"><span><span style="color:#50fa7b">Description</span><span style="color:#ff79c6">=</span><span style="color:#f1fa8c">Matter Server</span>
</span></span><span style="display:flex;"><span><span style="color:#50fa7b">After</span><span style="color:#ff79c6">=</span><span style="color:#f1fa8c">network-online.target</span>
</span></span><span style="display:flex;"><span><span style="color:#50fa7b">Wants</span><span style="color:#ff79c6">=</span><span style="color:#f1fa8c">network-online.target</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#ff79c6">[Service]</span>
</span></span><span style="display:flex;"><span><span style="color:#50fa7b">Type</span><span style="color:#ff79c6">=</span><span style="color:#f1fa8c">simple</span>
</span></span><span style="display:flex;"><span><span style="color:#50fa7b">User</span><span style="color:#ff79c6">=</span><span style="color:#f1fa8c">homeassistant</span>
</span></span><span style="display:flex;"><span><span style="color:#50fa7b">Group</span><span style="color:#ff79c6">=</span><span style="color:#f1fa8c">homeassistant</span>
</span></span><span style="display:flex;"><span><span style="color:#50fa7b">WorkingDirectory</span><span style="color:#ff79c6">=</span><span style="color:#f1fa8c">/home/homeassistant</span>
</span></span><span style="display:flex;"><span><span style="color:#50fa7b">Environment</span><span style="color:#ff79c6">=</span><span style="color:#f1fa8c">HOME=/home/homeassistant</span>
</span></span><span style="display:flex;"><span><span style="color:#50fa7b">ExecStartPre</span><span style="color:#ff79c6">=</span><span style="color:#f1fa8c">-/usr/bin/find /home/homeassistant/.matter_server -name &#34;matter.lock&#34; -delete</span>
</span></span><span style="display:flex;"><span><span style="color:#50fa7b">ExecStart</span><span style="color:#ff79c6">=</span><span style="color:#f1fa8c">/home/homeassistant/node_modules/.bin/matter-server</span>
</span></span><span style="display:flex;"><span><span style="color:#50fa7b">Restart</span><span style="color:#ff79c6">=</span><span style="color:#f1fa8c">always</span>
</span></span><span style="display:flex;"><span><span style="color:#50fa7b">RestartSec</span><span style="color:#ff79c6">=</span><span style="color:#f1fa8c">5</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#ff79c6">[Install]</span>
</span></span><span style="display:flex;"><span><span style="color:#50fa7b">WantedBy</span><span style="color:#ff79c6">=</span><span style="color:#f1fa8c">multi-user.target</span>
</span></span></code></pre></div><p>Enable both:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>sudo systemctl daemon-reload
</span></span><span style="display:flex;"><span>sudo systemctl <span style="color:#8be9fd;font-style:italic">enable</span> --now homeassistant matter-server
</span></span></code></pre></div><h2 id="thread-border-router-on-esp32-c6">Thread border router on ESP32-C6</h2>
<p>Thread devices need a border router to reach the IP network. I flashed an ESP32-C6 with <a href="https://github.com/simon/esp32c6-border-router">esp32c6-border-router</a>. It has a small web interface on port <strong>80</strong>:</p>
<p><img src="/img/thread-border-router.png" alt="Thread border router web interface"></p>
<h2 id="matter-server-status">Matter server status</h2>
<p>The Matter server is up and connected to Home Assistant:</p>
<p><img src="/img/matter.png" alt="Matter server"></p>
<h2 id="adding-the-devices">Adding the devices</h2>
<p>I bought two <a href="https://www.ikea.com/it/it/p/grillplats-spina-smart-60604238/">IKEA GRILLPLATS smart plugs</a>, plugged them in, and scanned the QR code from the Home Assistant app on my phone. Both were added as Matter over Thread devices, and they now show up in HA like any other switch.</p>
<h2 id="conclusion">Conclusion</h2>
<p>An old Raspberry Pi 2 and a cheap ESP32-C6 are enough for a working Matter over Thread setup. The only cost is that it is unsupported, so updates and fixes are up to you.</p>
]]></description><media:thumbnail url="https://www.mr70.eu/img/homeassistant.png"/></item></channel></rss>