Back to Tasmota

Matter 1.4/1.4.1 Gap Analysis for Tasmota Implementation

lib/libesp32/berry_matter/MATTER_1.4_GAP_ANALYSIS.md

15.4.013.3 KB
Original Source

Matter 1.4/1.4.1 Gap Analysis for Tasmota Implementation

Executive Summary

This document analyzes the gaps between Tasmota's current Matter implementation and the Matter 1.4/1.4.1 specification. The current implementation appears to target Matter 1.0/1.1 with some 1.2 features.

Current Implementation Status

Version Indicators

  • DataModelRevision: Returns 17 (Matter 1.2 - Basic Information cluster attribute 0x0000)
  • InteractionModelRevision: Returns 11 (Matter 1.2+ - in IM messages)
  • Cluster Revisions: Various, ranging from 1-7 depending on cluster

Supported Device Types

Device TypeStatusNotes
Root Node (0x0016)✅ Supported
Aggregator (0xFF00)✅ SupportedBridge mode
On/Off Light (0x0100)✅ Supported
Dimmable Light (0x0101)✅ Supported
Color Temperature Light (0x010C)✅ Supported
Extended Color Light (0x010D)✅ Supported
On/Off Plug-in Unit (0x010A)✅ Supported
Temperature Sensor (0x0302)✅ Supported
Humidity Sensor (0x0307)✅ Supported
Pressure Sensor (0x0305)✅ Supported
Illuminance Sensor (0x0106)✅ Supported
Occupancy Sensor (0x0107)✅ Supported
Contact Sensor (0x0015)✅ Supported
Flow Sensor (0x0306)✅ Supported
Window Covering (0x0202)✅ SupportedShutter/Tilt
Fan (0x002B)✅ Supported
Generic Switch (0x000F)✅ SupportedButton
Air Quality Sensor✅ Supported
Rain Sensor✅ Supported
Water Leak Detector✅ Supported

Supported Clusters

ClusterIDStatusNotes
Descriptor0x001D
Access Control0x001F
Basic Information0x0028
OTA Software Update Requestor0x002A⚠️ PartialStub implementation
Localization Configuration0x002B
Time Format Localization0x002C
General Commissioning0x0030
Network Commissioning0x0031⚠️ PartialLimited attributes
Diagnostic Logs0x0032⚠️ StubNo attributes
General Diagnostics0x0033
Software Diagnostics0x0034⚠️ StubNo attributes
Time Synchronization0x0038⚠️ PartialBasic time only
Administrator Commissioning0x003C
Node Operational Credentials0x003E
Group Key Management0x003F⚠️ StubTODO
On/Off0x0006
Level Control0x0008
Color Control0x0300
Window Covering0x0102
Fan Control0x0202
Temperature Measurement0x0402
Pressure Measurement0x0403
Flow Measurement0x0404
Humidity Measurement0x0405
Occupancy Sensing0x0406
Illuminance Measurement0x0400
Boolean State0x0045
Generic Switch0x003B

Matter 1.4 New Features - Gap Analysis

1. New Device Types (Matter 1.4)

Device TypeCluster IDStatusPriority
Battery Storage-❌ Not ImplementedMedium
Solar Power-❌ Not ImplementedMedium
Home Router-❌ Not ImplementedLow
Water Heater0x0094❌ Not ImplementedMedium
Heat Pump-❌ Not ImplementedMedium
Enhanced EV Charger0x0099❌ Not ImplementedLow

2. New Clusters (Matter 1.4)

ClusterIDStatusDescription
Electrical Power Measurement0x0090❌ Not ImplementedReal-time power monitoring
Electrical Energy Measurement0x0091❌ Not ImplementedEnergy consumption tracking
Device Energy Management0x0098❌ Not ImplementedEnergy optimization
Device Energy Management Mode0x009F❌ Not ImplementedEnergy modes
Power Topology0x009C❌ Not ImplementedPower distribution
Water Heater Management0x0094❌ Not ImplementedWater heater control
Water Heater Mode0x009E❌ Not ImplementedWater heater modes

3. Protocol Enhancements (Matter 1.4/1.4.1)

FeatureStatusImpact
Thread 1.3.1 Support❌ Not ImplementedThread border router improvements
NFC Onboarding (1.4.1)❌ Not ImplementedSimplified commissioning
Multi-device Setup (1.4.1)❌ Not ImplementedBatch commissioning
Enhanced CASE Resumption✅ ImplementedSession resumption works
ICD (Intermittently Connected Device)✅ ImplementedSIT mode supported, LIT partial

4. Security Updates

FeatureStatusNotes
PASE (SPAKE2+)✅ CompliantUses CHIP context prefix
CASE (Sigma)✅ CompliantFull implementation
Session Resumption✅ CompliantWorking
Message Counter Validation✅ CompliantWindow size 32
AES-CCM Encryption✅ Compliant16-byte tag

Detailed Gap Analysis

HIGH PRIORITY Gaps

1. Energy Measurement Clusters Missing

Tasmota has extensive energy monitoring capabilities (via PZEM, HLW8012, etc.) but these are not exposed via Matter. This is a significant gap since Matter 1.4 specifically adds energy clusters.

Missing Clusters:

  • Electrical Power Measurement (0x0090)
  • Electrical Energy Measurement (0x0091)

Recommendation: Create new plugin types:

  • Matter_Plugin_Sensor_Power.be
  • Matter_Plugin_Sensor_Energy.be

2. Thermostat Cluster Not Implemented

The cluster revision table references Thermostat (0x0201) but no plugin implements it.

Impact: Cannot expose Tasmota thermostat functionality to Matter controllers.

MEDIUM PRIORITY Gaps

3. ICD (Intermittently Connected Device) Support

Status: ✅ IMPLEMENTED (Base SIT mode per Matter 1.4.1 spec)

The ICD Management Cluster (0x0046) is always enabled with base SIT (Short Idle Time) mode, appropriate for mains-powered WiFi devices.

Implemented Attributes (per spec section 9.17.6):

  • IdleModeDuration (0x0000) - 1 second (minimum per spec)
  • ActiveModeDuration (0x0001) - 300ms (spec default)
  • ActiveModeThreshold (0x0002) - 300ms (spec default)

Not Implemented (require optional features):

  • ICDCounter, ClientsSupportedPerFabric, RegisteredClients - require CIP feature
  • OperatingMode - requires LITS feature
  • UserActiveModeTriggerHint/Instruction - require UAT feature

Cluster Configuration:

  • Revision: 3 (Matter 1.4.1)
  • Feature Map: 0x00 (no optional features)

mDNS Advertisement:

  • SII=500ms, SAI=300ms (spec defaults)
  • ICD key not advertised (per spec: only for LITS-capable devices)

Impact: Controllers know the device is always reachable with standard MRP timing.

4. Power Source Cluster Missing

No implementation of Power Source cluster (0x002F) which is important for:

  • Battery level reporting
  • Power source type indication
  • Wired/battery status

5. OTA Update Cluster Incomplete

Current implementation is a stub:

berry
# Returns empty list and claims update not possible
return TLV.Matter_TLV_array()   # empty list for now TODO
return tlv_solo.set(TLV.BOOL, 0)  # we claim that update is not possible

LOW PRIORITY Gaps

6. Group Key Management Incomplete

Marked as TODO in the code:

berry
elif cluster == 0x003F              # ========== Group Key Management Cluster 11.2 p.572 ==========
  # TODO

7. Diagnostic Logs Cluster Empty

No attributes implemented:

berry
elif cluster == 0x0032              # ========== Diagnostic Logs Cluster 11.10 p.637 ==========
  # no attributes

8. Software Diagnostics Cluster Empty

berry
elif cluster == 0x0034              # ========== Software Diagnostics Cluster 11.12 p.654 ==========
  # no mandatory attributes - to be added later (maybe)

Session/Security Analysis

PASE Implementation

Compliant - Full SPAKE2+ implementation with correct CHIP context prefix.

CASE Implementation

Compliant - Full Sigma1/Sigma2/Sigma3 protocol with:

  • Proper certificate chain validation
  • ECDH key exchange
  • Session key derivation via HKDF
  • Session resumption support

Known Deviations (Acceptable)

  1. Context Prefix: Uses "CHIP PAKE V1 Commissioning" instead of spec's "Matter PAKE V1 Commissioning" - this is correct for interoperability
  2. PBKDF2 Iterations: Uses minimum 1000 - compliant but minimal security

Recommendations

Immediate (High Value)

  1. Add Energy Measurement Plugins

    • Leverage existing Tasmota energy drivers
    • Implement clusters 0x0090 and 0x0091
    • High value for smart home energy monitoring
  2. Add Thermostat Plugin

    • Implement cluster 0x0201
    • Map to Tasmota thermostat commands

Short-term

  1. Enable ICD Support

    • Uncomment and test ICD cluster
    • Important for battery devices
  2. Add Power Source Cluster

    • Report battery/wired status
    • Important for portable devices

Long-term

  1. Complete OTA Cluster

    • Enable Matter-based firmware updates
  2. Add Water Heater Support (Matter 1.4)

    • New device type for water heater control

Compatibility Notes

The current implementation is fully compatible with Matter 1.0/1.1 controllers and should work with Matter 1.4 controllers for supported device types. The gaps primarily affect:

  1. New Matter 1.4 device types (not supported)
  2. Energy monitoring features (not exposed via Matter)
  3. Advanced diagnostics (minimal implementation)

Controllers like Apple Home, Google Home, and Amazon Alexa will work with the current implementation for all supported device types.


Additional Technical Details

Commissioning Implementation

The commissioning implementation (Matter_z_Commissioning.be) is well-structured:

FeatureStatusNotes
PASE Window Management10-minute default timeout
QR Code GenerationFull MT: format support
Manual Pairing Code11-digit with Verhoeff checksum
mDNS PASE Announce_matterc._udp with subtypes
mDNS Operational_matter._tcp per fabric
OpenCommissioningWindowEnhanced commissioning
OpenBasicCommissioningWindowBasic commissioning
RevokeCommissioningClose window

Fabric Management

The fabric implementation (Matter_Fabric.be) supports:

FeatureStatusNotes
Max CASE Sessions5Per fabric limit
Group Key DerivationIPK group key
Fabric CompressionCompressed fabric ID
Multi-fabricMultiple controllers
Fabric LabelUser-defined labels
Fabric Parent TrackingNested provisioning

Interaction Model

The IM implementation (Matter_IM.be) supports:

OpcodeNameStatus
0x01Status Response
0x02Read Request✅ (optimized)
0x03Subscribe Request
0x04Subscribe Response❌ (device mode)
0x05Report Data❌ (device mode)
0x06Write Request
0x07Write Response❌ (device mode)
0x08Invoke Request✅ (optimized)
0x09Invoke Response❌ (device mode)
0x0ATimed Request

Note: Opcodes marked "device mode" are for controller-side operations, not needed for a Matter device.

mDNS Service Records

Commissioning (_matterc._udp):

  • VP (Vendor+Product)
  • D (Discriminator)
  • CM (Commissioning Mode)
  • T (TCP support = 0)
  • SII/SAI (Sleep intervals)
  • Subtypes: _L<discriminator>, _S<short>, _V<vendor>, _CM1

Operational (_matter._tcp):

  • Instance: <compressed_fabric>-<device_id>
  • Subtype: _I<compressed_fabric>

Matter 1.4.1 Specific Features

Matter 1.4.1 (May 2025) added:

FeatureStatusNotes
NFC OnboardingRequires NFC hardware
Multi-device SetupBatch commissioning
Enhanced Thread Support⚠️Depends on ESP-IDF

These features are primarily controller-side or require specific hardware support.


Implementation Quality Assessment

Strengths

  1. Clean Architecture - Well-separated concerns (Session, Fabric, Commissioning, IM)
  2. Optimized Paths - Fast-track processing for common operations
  3. Robust Persistence - JSON-based fabric/session storage
  4. Good Logging - Comprehensive debug output
  5. Bridge Support - Remote device aggregation

Areas for Improvement

  1. Energy Clusters - High-value gap for Tasmota's energy monitoring
  2. Thermostat - Missing despite Tasmota having thermostat support
  3. ICD - Code exists but disabled
  4. Diagnostics - Minimal implementation

Analysis Date: January 2026 Based on Tasmota Matter Berry implementation Compared against Matter 1.4.1 Core Specification