Introduction
You’ve been running Home Assistant smoothly for months — maybe even years. Your template sensors are working perfectly, updating in real time, and feeding your dashboards with accurate data. Then, you decide to enable the Matter integration because you want to future-proof your smart home setup. And suddenly, something breaks.
Your template sensors freeze. They stop updating. Some show stale values from hours ago, and others just sit there displaying “unavailable.” You check your YAML, and everything looks correct. You restart Home Assistant, and things work for a few minutes — then freeze again.
If this sounds familiar, you’re not alone. I’ve been there myself, and I’ve spent more time than I’d like to admit digging through logs, GitHub issues, and community forums trying to figure out what went wrong. In this article, I’m going to walk you through exactly why this happens, what’s going on under the hood, and — most importantly — how to fix it without ripping your entire setup apart.
[📷 Image Placeholder: A screenshot showing a Home Assistant dashboard with template sensors displaying “unavailable” or stale data after Matter integration is enabled.]
Alt Text: “Home Assistant dashboard showing template sensors stuck and not updating after enabling Matter integration”
Understanding Template Sensors in Home Assistant
What Are Template Sensors?
Template sensors in Home Assistant are custom sensors you create using Jinja2 templates. They pull data from other entities and transform it into something useful. For example, you might create a template sensor that calculates your total energy consumption by adding values from multiple smart plugs.
Here’s a simple example:
YAMLtemplate:
- sensor:
- name: "Average Indoor Temperature"
unit_of_measurement: "°C"
state: >
{{ ((states('sensor.living_room_temp') | float) +
(states('sensor.bedroom_temp') | float)) / 2 | round(1) }}
How Template Sensors Update
Template sensors rely on state change events. When any entity referenced in the template changes its state, Home Assistant triggers a re-evaluation of the template. This is handled by the event loop — the core engine that processes everything in Home Assistant.
This is a critical detail, because if anything disrupts the event loop or overwhelms it, your template sensors will stop updating.
[📷 Image Placeholder: A diagram showing how Home Assistant’s event loop processes state changes and triggers template sensor updates.]
Alt Text: “Diagram explaining Home Assistant event loop and how template sensors get updated through state change events”
What Is Matter Integration and Why Does It Cause Issues?
A Quick Overview of Matter
Matter is the new smart home standard developed by the Connectivity Standards Alliance (CSA), backed by Apple, Google, Amazon, and Samsung. It promises to unify smart home devices under one protocol, making them work across different ecosystems.
Home Assistant added Matter support through the Matter Server integration, which runs a separate Matter controller (usually via the matter-server add-on or a Python-based Matter SDK).
Why Matter Integration Affects Template Sensors
Here’s where things get technical — and where the real problem lives.
When you enable the Matter integration in Home Assistant, several things happen simultaneously:
- A Matter Server process starts running alongside Home Assistant, consuming additional CPU and memory resources.
- The Matter integration subscribes to the event bus heavily, processing device commissioning, attribute updates, and fabric management.
- Thread network operations (if you use Thread-based Matter devices) introduce additional network overhead and latency.
- The Python event loop gets congested. Home Assistant runs on an asyncio event loop, and the Matter integration adds significant asynchronous tasks to this loop.
The result? Your template sensors — which depend on the event loop to detect state changes and re-evaluate — get starved. They’re waiting in line behind Matter-related tasks, and in some cases, they simply time out and stop updating.
[📷 Image Placeholder: A visual comparison of the Home Assistant event loop before and after enabling Matter integration, showing increased task load.]
Alt Text: “Visual comparison of Home Assistant event loop load before and after enabling Matter integration”
Real-World Scenario: My Personal Experience
Let me share what happened in my own setup. I was running Home Assistant on a Raspberry Pi 4 (4GB) with about 85 entities. Everything was working perfectly. I had 12 template sensors tracking things like:
- Average home temperature
- Total power consumption
- Occupancy status based on multiple motion sensors
- Custom weather alerts
When I enabled the Matter integration to connect a new Eve Door & Window sensor (Thread-based), things went downhill within 24 hours:
- My “Average Indoor Temperature” sensor froze at 22.3°C and never updated again.
- My power consumption sensor showed yesterday’s values.
- My occupancy sensor was stuck on “Home” even when everyone had left.
The Home Assistant logs showed entries like:
textWARNING: Template sensor 'Average Indoor Temperature' has not been updated for 3600 seconds
WARNING: Waited too long for event loop task to complete
After two days of troubleshooting, I identified the root cause and fixed it. Here’s exactly what I did.
Step-by-Step Troubleshooting Guide
Step 1: Check Your System Resources
The first thing you need to do is verify that your Home Assistant host isn’t running out of CPU or memory.
How to check:
- Go to Settings → System → Hardware
- Look at CPU and memory usage
- If CPU is consistently above 80% or memory is above 85%, you have a resource problem
What to look for:
- The
matter-serverprocess consuming excessive CPU - Memory leaks from the Matter integration (known issue in earlier versions)
Bash# If you have SSH access, run:
top -o %CPU
# Look for processes named 'matter-server' or 'python3'
[📷 Image Placeholder: A screenshot of the Home Assistant System Hardware page showing CPU and memory usage with Matter integration running.]
Alt Text: “Home Assistant system hardware page showing high CPU and memory usage caused by Matter server process”
Step 2: Update Home Assistant and Matter Server to the Latest Version
This is crucial. Many of the template sensor freezing issues related to Matter were addressed in updates throughout 2023 and 2024. The Matter integration was still considered beta in many early releases, and event loop blocking bugs were common.
Action items:
- Update Home Assistant Core to the latest stable version
- Update the Matter Server add-on to the latest version
- Update the Silicon Labs Multiprotocol add-on if you’re using it for Thread
Go to Settings → System → Updates and install all available updates.
Important: Back up your system before updating. Go to Settings → System → Backups → Create Backup.
Step 3: Review Your Template Sensor Configuration
Sometimes, the issue isn’t entirely about Matter — it just exposes existing weaknesses in your template sensor configuration. Poorly optimized templates can become problematic when the event loop is under load.
Common template issues:
Avoid Using states() Without a Domain Filter
YAML# ❌ BAD - This listens to ALL state changes
state: "{{ states | selectattr('state', 'eq', 'on') | list | count }}"
# ✅ GOOD - This only listens to light state changes
state: "{{ states.light | selectattr('state', 'eq', 'on') | list | count }}"
Add availability Templates
YAMLtemplate:
- sensor:
- name: "Average Indoor Temperature"
unit_of_measurement: "°C"
availability: >
{{ states('sensor.living_room_temp') not in ['unavailable', 'unknown'] and
states('sensor.bedroom_temp') not in ['unavailable', 'unknown'] }}
state: >
{{ ((states('sensor.living_room_temp') | float(0)) +
(states('sensor.bedroom_temp') | float(0))) / 2 | round(1) }}
Use Default Values in Filters
Always add default values to float() and int() filters to prevent template errors:
YAML# ❌ Without default
{{ states('sensor.power') | float }}
# ✅ With default
{{ states('sensor.power') | float(0) }}
[📷 Image Placeholder: A side-by-side code comparison showing optimized vs. unoptimized template sensor YAML configuration.]
Alt Text: “YAML code comparison showing optimized template sensor configuration with availability checks and default values”
Step 4: Separate Matter Server to a Different Host
This is the most effective solution I’ve found, especially if you’re running Home Assistant on a Raspberry Pi or other resource-constrained hardware.
Instead of running the Matter Server on the same device as Home Assistant, you can run it on a separate machine — even another Raspberry Pi or a small mini PC.
How to do it:
- Install the Matter Server as a standalone Docker container on a separate machine:
Bashdocker run -d \
--name matter-server \
--restart=unless-stopped \
--network=host \
-v /opt/matter-server:/data \
ghcr.io/home-assistant-libs/python-matter-server:stable \
--storage-path /data \
--paa-root-cert-dir /data/credentials
- In Home Assistant, configure the Matter integration to connect to the remote Matter Server:
- Go to Settings → Devices & Services → Matter
- Enter the IP address and port of the remote Matter Server (default port: 5580)
- Remove the local Matter Server add-on
This frees up your Home Assistant’s event loop to focus on what it does best — managing automations, template sensors, and your dashboard.
[📷 Image Placeholder: A network diagram showing Home Assistant connected to a separate Matter Server running on a different device.]
Alt Text: “Network architecture diagram showing Home Assistant connected to a remote Matter server on a separate device for better performance”
Step 5: Adjust the Matter Integration Polling Interval
If separating the Matter Server isn’t practical for you, you can reduce the load by adjusting how often the Matter integration polls for device updates.
Add this to your configuration.yaml:
YAMLmatter:
adapter: ws
You can also try limiting the number of Matter devices that report simultaneously by configuring subscription intervals in the Matter Server settings.
Step 6: Use trigger-Based Template Sensors Instead
If your template sensors don’t need to update on every state change, consider using trigger-based template sensors. These only update when a specific trigger fires, which is much more efficient.
YAMLtemplate:
- trigger:
- platform: time_pattern
minutes: "/5" # Update every 5 minutes
sensor:
- name: "Average Indoor Temperature"
unit_of_measurement: "°C"
state: >
{{ ((states('sensor.living_room_temp') | float(0)) +
(states('sensor.bedroom_temp') | float(0))) / 2 | round(1) }}
Or trigger on specific state changes:
YAMLtemplate:
- trigger:
- platform: state
entity_id:
- sensor.living_room_temp
- sensor.bedroom_temp
sensor:
- name: "Average Indoor Temperature"
unit_of_measurement: "°C"
state: >
{{ ((states('sensor.living_room_temp') | float(0)) +
(states('sensor.bedroom_temp') | float(0))) / 2 | round(1) }}
This approach dramatically reduces the load on the event loop because the template isn’t constantly listening for every possible state change.
[📷 Image Placeholder: A screenshot showing the configuration of a trigger-based template sensor in Home Assistant YAML editor.]
Alt Text: “YAML configuration example of a trigger-based template sensor in Home Assistant that updates every 5 minutes”
Step 7: Monitor the Event Loop with Developer Tools
Home Assistant has built-in tools to help you monitor what’s happening with the event loop.
- Go to Developer Tools → Statistics
- Look for “event loop blocked” warnings
- Go to Developer Tools → Events and listen for
state_changedevents to see if they’re firing normally
You can also enable debug logging for the Matter integration:
YAMLlogger:
default: warning
logs:
matter_server: debug
homeassistant.components.matter: debug
homeassistant.helpers.template: debug
Check the logs at Settings → System → Logs for any errors or warnings related to template evaluation or Matter communication.
Known Issues and GitHub References
This is a well-documented issue in the Home Assistant community. Here are some relevant GitHub issues and discussions you should check:
- GitHub Issue #96834: Reports of template sensors becoming unresponsive after Matter integration is enabled
- Matter Server Repository: Check open issues for performance-related bugs
- Home Assistant Community Forum – Matter Discussion: Active community discussion about Matter-related performance issues
Hardware Recommendations for Running Matter
If you’re committed to using Matter in your smart home, here are my hardware recommendations based on real-world testing:
| Hardware | Matter Performance | Template Sensor Impact |
|---|---|---|
| Raspberry Pi 3 | ❌ Not recommended | Severe freezing issues |
| Raspberry Pi 4 (2GB) | ⚠️ Marginal | Occasional stalling |
| Raspberry Pi 4 (4GB+) | ✅ Acceptable | Minor delays possible |
| Intel NUC / Mini PC | ✅ Excellent | No noticeable impact |
| Home Assistant Yellow | ✅ Very Good | Minimal impact |
| Home Assistant Green | ⚠️ Marginal | May need optimization |
[📷 Image Placeholder: A comparison table or infographic showing different hardware options and their performance with Matter integration.]
Alt Text: “Hardware comparison chart showing performance of different devices running Home Assistant with Matter integration”
Prevention Tips: Keeping Everything Running Smoothly
Based on my experience and the experiences of many community members, here are the best practices to prevent template sensors from breaking when using Matter:
1. Keep Your Setup Lean
Don’t add Matter devices you don’t need. Each Matter device adds load to the event loop.
2. Use Trigger-Based Templates
As discussed in Step 6, trigger-based templates are more efficient and resilient.
3. Monitor System Resources Regularly
Set up a system monitor integration to track CPU, memory, and disk usage:
YAMLsensor:
- platform: systemmonitor
resources:
- type: processor_use
- type: memory_use_percent
- type: disk_use_percent
4. Separate Concerns
If possible, run the Matter Server on a separate device. This is the single most impactful optimization.
5. Keep Everything Updated
The Matter integration improves with every release. Stay on the latest stable version.
Frequently Asked Questions (FAQ)
Q1: Will disabling the Matter integration immediately fix my template sensors?
Yes, in most cases. If you disable the Matter integration (Settings → Devices & Services → Matter → Delete), your template sensors should resume normal operation within a few minutes. However, this means you lose access to your Matter devices.
Q2: Can I run Matter and template sensors on a Raspberry Pi 4 without issues?
It depends on how many entities and template sensors you have. With fewer than 50 entities and fewer than 10 template sensors, a Raspberry Pi 4 with 4GB RAM should handle it. Beyond that, consider upgrading to a mini PC or separating the Matter Server.
Q3: Are trigger-based template sensors as reliable as regular template sensors?
Yes, and in many ways, they’re more reliable because they only update when specific conditions are met, reducing the chance of missed updates during high event loop load.
Q4: Does this issue affect all types of Matter devices or only Thread-based ones?
Thread-based Matter devices tend to cause more load because they require a Thread Border Router (often running on the same device). Wi-Fi-based Matter devices are generally less resource-intensive but still contribute to event loop congestion.
Q5: Is this a bug or expected behavior?
It’s a combination of both. Some aspects are genuine bugs that have been or are being fixed. Others are expected behavior when system resources are insufficient to handle both Matter operations and template evaluations simultaneously.
Q6: Will Home Assistant eventually fix this issue completely?
The Home Assistant development team is actively working on improving Matter integration performance. Each release brings optimizations to the event loop handling and Matter Server communication. The long-term goal is for Matter to work seamlessly alongside all other integrations.
Q7: Can I use MQTT instead of Matter to avoid this problem?
Yes, if your devices support it. MQTT is extremely lightweight and well-optimized in Home Assistant. Many devices that support Matter also support alternative protocols like Zigbee (via ZHA or Zigbee2MQTT) or MQTT directly, which are far less resource-intensive.
Final Thoughts
Dealing with template sensors that stop updating after enabling Matter integration is frustrating, but it’s a solvable problem. The key takeaway is this: Matter is still a maturing technology, and running it on resource-constrained hardware alongside complex template configurations will push your system to its limits.
The best approach is a combination of:
- Optimizing your templates (use trigger-based sensors, add defaults, limit scope)
- Upgrading or separating hardware (run Matter Server externally if needed)
- Staying updated (every Home Assistant release improves Matter performance)
Your smart home should work for you, not against you. Take the time to implement these fixes, and you’ll have a system where Matter devices and template sensors coexist without any issues.
If you have questions or want to share your own experience with this issue, I’d love to hear from you in the comments below.