Back to Tasmota

Matter 1.4.1 Detailed Gap Analysis for Tasmota Implementation

lib/libesp32/berry_matter/MATTER_1.4.1_DETAILED_GAP_ANALYSIS.md

15.4.020.9 KB
Original Source

Matter 1.4.1 Detailed Gap Analysis for Tasmota Implementation

Document Information

  • Analysis Date: January 2026
  • Matter Spec Version: 1.4.1 (March 17, 2025)
  • Tasmota Implementation: Berry Matter module
  • Purpose: Identify gaps between Matter 1.4.1 specification and current Tasmota implementation

Executive Summary

The Tasmota Matter implementation is well-architected and provides solid support for Matter 1.0/1.1/1.2 device types. The current DataModelRevision returns 17 (Matter 1.2). This analysis identifies gaps against Matter 1.4.1 specification, prioritized by implementation value for Tasmota users.

Key Findings:

  1. HIGH PRIORITY: Energy measurement clusters (0x0090, 0x0091) - Tasmota has extensive energy monitoring but not exposed via Matter
  2. HIGH PRIORITY: Thermostat cluster (0x0201) - Referenced in code but no plugin exists
  3. MEDIUM PRIORITY: Power Source cluster (0x002F) - Important for battery devices
  4. MEDIUM PRIORITY: Door Lock cluster (0x0101) - Common device type not implemented
  5. LOW PRIORITY: Various Matter 1.4 new device types (Water Heater, EV Charger, etc.)

Part 1: Device Type Comparison

1.1 Currently Implemented Device Types

Device TypeIDPlugin FileStatusNotes
Root Node0x0016Matter_Plugin_1_Root.be✅ CompleteAll infrastructure clusters
Aggregator0xFF00Matter_Plugin_1_Aggregator.be✅ CompleteBridge mode support
On/Off Light0x0100Matter_Plugin_2_Light0.be✅ Complete
Dimmable Light0x0101Matter_Plugin_3_Light1.be✅ Complete
Color Temperature Light0x010CMatter_Plugin_4_Light2.be✅ Complete
Extended Color Light0x010DMatter_Plugin_4_Light3.be✅ Complete
On/Off Plug-in Unit0x010AMatter_Plugin_3_OnOff.be✅ Complete
Fan0x002BMatter_Plugin_2_Fan.be✅ Complete
Window Covering0x0202Matter_Plugin_2_Shutter.be✅ CompleteLift + Tilt
Temperature Sensor0x0302Matter_Plugin_3_Sensor_Temp.be✅ Complete
Humidity Sensor0x0307Matter_Plugin_3_Sensor_Humidity.be✅ Complete
Pressure Sensor0x0305Matter_Plugin_3_Sensor_Pressure.be✅ Complete
Illuminance Sensor0x0106Matter_Plugin_3_Sensor_Illuminance.be✅ Complete
Occupancy Sensor0x0107Matter_Plugin_3_Sensor_Occupancy.be✅ Complete
Contact Sensor0x0015Matter_Plugin_3_Sensor_Contact.be✅ Complete
Flow Sensor0x0306Matter_Plugin_3_Sensor_Flow.be✅ Complete
Generic Switch0x000FMatter_Plugin_2_Sensor_GenericSwitch_Btn.be✅ CompleteButton
Air Quality Sensor0x002CMatter_Plugin_2_Sensor_Air_Quality.be✅ Complete
Rain Sensor0x0044Matter_Plugin_3_Sensor_Rain.be✅ Complete
Water Leak Detector0x0043Matter_Plugin_3_Sensor_Waterleak.be✅ Complete

1.2 Device Types NOT Implemented (Matter 1.4.1 Spec)

HIGH PRIORITY (High value for Tasmota users)

Device TypeIDPriorityReason
Thermostat0x0301🔴 HIGHTasmota has thermostat support, cluster 0x0201 referenced in code
Electrical Sensor0x0510🔴 HIGHNew in Matter 1.4, Tasmota has extensive energy monitoring
Door Lock0x000A🔴 HIGHCommon device type, cluster 0x0101 revision defined
Dimmable Plug-In Unit0x010B🟡 MEDIUMExtension of existing OnOff plugin
Pump0x0303🟡 MEDIUMTasmota supports pump control

MEDIUM PRIORITY (Matter 1.4 new features)

Device TypeIDPriorityReason
Water Heater0x050F🟡 MEDIUMMatter 1.4 device type
Air Purifier0x002D🟡 MEDIUMFan + filter monitoring
Smoke CO Alarm0x0076🟡 MEDIUMSafety device
Water Freeze Detector0x0041🟡 MEDIUMBoolean state device
Water Valve0x0042🟡 MEDIUMValve control

LOW PRIORITY (Specialized/Complex)

Device TypeIDPriorityReason
EV Charger (EVSE)0x050C🟢 LOWComplex, specialized hardware
Battery Storage-🟢 LOWMatter 1.4, specialized
Solar Power-🟢 LOWMatter 1.4, specialized
Heat Pump-🟢 LOWMatter 1.4, complex HVAC
Video Player0x0023/0x0028🟢 LOWMedia devices, complex
Speaker0x0022🟢 LOWMedia device
Robotic Vacuum0x0074🟢 LOWComplex operational states

Part 2: Cluster Comparison

2.1 Currently Implemented Clusters

Infrastructure Clusters (Root Node)

ClusterIDStatusRevisionNotes
Descriptor0x001D2
Access Control0x001F1
Basic Information0x00282DataModelRevision=17
General Commissioning0x00301
Network Commissioning0x0031⚠️ Partial1Limited attributes
Diagnostic Logs0x0032⚠️ Stub1No attributes
General Diagnostics0x00331
Software Diagnostics0x0034⚠️ Stub1No attributes
Time Synchronization0x0038⚠️ Partial2Basic time only
Administrator Commissioning0x003C1
Node Operational Credentials0x003E1
Group Key Management0x003F⚠️ Stub2TODO in code
ICD Management0x00463SIT mode, no CIP/LITS
Localization Configuration0x002B1
Time Format Localization0x002C1
OTA Software Update Requestor0x002A⚠️ Stub1Returns empty/false

Application Clusters

ClusterIDStatusRevisionNotes
Identify0x00034
Groups0x00044
Scenes Management0x0005/0x00625
On/Off0x00065Dead Front behavior
Level Control0x00085On/Off + Lighting features
Color Control0x03006
Window Covering0x01025Lift + PA_LF features
Fan Control0x02024Auto feature
Boolean State0x00451
Switch0x003B1
Temperature Measurement0x04024
Pressure Measurement0x04033
Flow Measurement0x04043
Relative Humidity Measurement0x04053
Occupancy Sensing0x04063
Illuminance Measurement0x04003
Air Quality0x005B1

2.2 Clusters NOT Implemented (Gap Analysis)

HIGH PRIORITY - Energy Clusters (Matter 1.4)

ClusterIDPriorityDescriptionImplementation Notes
Electrical Power Measurement0x0090🔴 HIGHReal-time power (W, V, A)Map to Tasmota energy drivers
Electrical Energy Measurement0x0091🔴 HIGHCumulative energy (kWh)Map to Tasmota energy drivers

Tasmota Energy Sources:

  • PZEM-004T, PZEM-016 (Modbus energy meters)
  • HLW8012, BL0937, BL0940 (Power monitoring chips)
  • ADE7953 (Shelly devices)
  • CSE7766 (Sonoff POW)
  • SDM120, SDM630 (Modbus meters)

HIGH PRIORITY - HVAC Clusters

ClusterIDPriorityDescriptionImplementation Notes
Thermostat0x0201🔴 HIGHHVAC controlRevision 6 defined in code
Thermostat UI Configuration0x0204🟡 MEDIUMDisplay settingsRevision 2 defined
Pump Configuration0x0200🟡 MEDIUMPump controlRevision 4 defined

HIGH PRIORITY - Closure Clusters

ClusterIDPriorityDescriptionImplementation Notes
Door Lock0x0101🔴 HIGHLock/unlock controlRevision 7 defined in code

MEDIUM PRIORITY - Utility Clusters

ClusterIDPriorityDescriptionImplementation Notes
Power Source0x002F🟡 MEDIUMBattery/wired statusImportant for portable devices
Boolean State Configuration0x0080🟡 MEDIUMSensor configurationFor water/freeze detectors
Valve Configuration0x0081🟡 MEDIUMValve controlFor water valve device

MEDIUM PRIORITY - Matter 1.4 Energy Management

ClusterIDPriorityDescriptionImplementation Notes
Device Energy Management0x0098🟡 MEDIUMEnergy optimizationMatter 1.4
Device Energy Management Mode0x009F🟡 MEDIUMEnergy modesMatter 1.4
Power Topology0x009C🟡 MEDIUMPower distributionMatter 1.4
Energy Preference0x009B🟡 MEDIUMUser preferencesMatter 1.4

LOW PRIORITY - Safety/Alarm Clusters

ClusterIDPriorityDescription
Smoke CO Alarm0x005C🟢 LOWSmoke/CO detection
Carbon Monoxide Concentration0x040C🟢 LOWCO measurement
Carbon Dioxide Concentration0x040D🟢 LOWCO2 measurement

LOW PRIORITY - Media Clusters

ClusterIDPriorityDescription
Media Playback0x0506🟢 LOWPlay/pause/etc
Keypad Input0x0509🟢 LOWRemote control
Content Launcher0x050A🟢 LOWLaunch content
Audio Output0x050B🟢 LOWAudio routing
Channel0x0504🟢 LOWTV channels

Part 3: Detailed Implementation Requirements

3.1 Electrical Power Measurement Cluster (0x0090) - HIGH PRIORITY

Spec Reference: Matter 1.4.1 Application Cluster Spec, Section 2.13

Required Attributes:

AttributeIDTypeConformanceTasmota Mapping
PowerMode0x0000enum8MAC for most devices
NumberOfMeasurementTypes0x0001uint8MCount of supported measurements
Accuracy0x0002list[MeasurementAccuracyStruct]MFrom driver specs
ActivePower0x0008int64 (mW)OEnergy.Power * 1000
ReactivePower0x000Cint64 (mVAR)OEnergy.ReactivePower * 1000
ApparentPower0x0010int64 (mVA)OEnergy.ApparentPower * 1000
Voltage0x0004int64 (mV)OEnergy.Voltage * 1000
Current0x0005int64 (mA)OEnergy.Current * 1000
Frequency0x0006int64 (mHz)OEnergy.Frequency * 1000
PowerFactor0x0014int64 (1/100)OEnergy.Factor * 100

Features (FeatureMap 0xFFFC):

  • DIRC (0x01): Directional measurement
  • HARM (0x02): Harmonics measurement
  • PWRQ (0x04): Power quality
  • POLY (0x08): Polyphase measurement

Recommended Implementation:

berry
# New file: Matter_Plugin_Sensor_Power.be
class Matter_Plugin_Sensor_Power : Matter_Plugin_Sensor
  static var TYPE = "power"
  static var DISPLAY_NAME = "Power Sensor"
  static var TYPES = { 0x0510: 1 }  # Electrical Sensor device type
  static var CLUSTERS = matter.consolidate_clusters(_class, {
    0x0090: [0,1,2,4,5,8,0x14],  # Electrical Power Measurement
  })
  # ... implementation
end

3.2 Electrical Energy Measurement Cluster (0x0091) - HIGH PRIORITY

Spec Reference: Matter 1.4.1 Application Cluster Spec, Section 2.12

Required Attributes:

AttributeIDTypeConformanceTasmota Mapping
Accuracy0x0000MeasurementAccuracyStructMFrom driver specs
CumulativeEnergyImported0x0001EnergyMeasurementStructOEnergy.Total
CumulativeEnergyExported0x0002EnergyMeasurementStructOEnergy.ExportActive
PeriodicEnergyImported0x0003EnergyMeasurementStructOEnergy.Today
PeriodicEnergyExported0x0004EnergyMeasurementStructOCalculated
CumulativeEnergyReset0x0005CumulativeEnergyResetStructOReset timestamp

EnergyMeasurementStruct:

{
  Energy: int64 (mWh),
  StartTimestamp: epoch_s (optional),
  EndTimestamp: epoch_s (optional),
  StartSystime: uint64 (optional),
  EndSystime: uint64 (optional)
}

Features:

  • IMPE (0x01): Import energy measurement
  • EXPE (0x02): Export energy measurement
  • CUME (0x04): Cumulative energy
  • PERE (0x08): Periodic energy

Recommended Implementation:

berry
# New file: Matter_Plugin_Sensor_Energy.be
class Matter_Plugin_Sensor_Energy : Matter_Plugin_Sensor
  static var TYPE = "energy"
  static var DISPLAY_NAME = "Energy Sensor"
  static var TYPES = { 0x0510: 1 }  # Electrical Sensor device type
  static var CLUSTERS = matter.consolidate_clusters(_class, {
    0x0091: [0,1,3],  # Electrical Energy Measurement
  })
  # ... implementation
end

3.3 Thermostat Cluster (0x0201) - HIGH PRIORITY

Spec Reference: Matter 1.4.1 Application Cluster Spec, Section 4.3

Required Attributes:

AttributeIDTypeConformanceTasmota Mapping
LocalTemperature0x0000int16 (0.01°C)MCurrent temp sensor
OccupiedCoolingSetpoint0x0011int16COOLCooling setpoint
OccupiedHeatingSetpoint0x0012int16HEATHeating setpoint
SystemMode0x001Cenum8MOff/Auto/Cool/Heat
ThermostatRunningState0x0029bitmap16OCurrent HVAC state
ControlSequenceOfOperation0x001Benum8MCooling/Heating/Both

Features:

  • HEAT (0x01): Heating capability
  • COOL (0x02): Cooling capability
  • OCC (0x04): Occupancy support
  • SCH (0x08): Schedule support (deprecated in Matter 1.4)
  • SB (0x10): Setback support
  • AUTO (0x20): Auto mode
  • LTNE (0x40): Local temperature not exposed

Commands:

CommandIDDescription
SetpointRaiseLower0x00Adjust setpoint

Recommended Implementation:

berry
# New file: Matter_Plugin_Thermostat.be
class Matter_Plugin_Thermostat : Matter_Plugin_Device
  static var TYPE = "thermostat"
  static var DISPLAY_NAME = "Thermostat"
  static var TYPES = { 0x0301: 4 }  # Thermostat device type rev 4
  static var CLUSTERS = matter.consolidate_clusters(_class, {
    0x0003: [0,1],           # Identify
    0x0201: [0,0x11,0x12,0x1B,0x1C,0x29],  # Thermostat
  })
  static var FEATURE_MAPS = {
    0x0201: 0x23,  # HEAT + COOL + AUTO
  }
  # ... implementation
end

3.4 Door Lock Cluster (0x0101) - HIGH PRIORITY

Spec Reference: Matter 1.4.1 Application Cluster Spec, Section 5.2

Required Attributes:

AttributeIDTypeConformanceDescription
LockState0x0000enum8MNotFullyLocked/Locked/Unlocked/Unlatched
LockType0x0001enum8MDeadBolt/Magnetic/etc
ActuatorEnabled0x0002boolMCan actuate
OperatingMode0x0025enum8MNormal/Vacation/Privacy/etc
SupportedOperatingModes0x0026bitmap16MSupported modes

Commands:

CommandIDDescription
LockDoor0x00Lock the door
UnlockDoor0x01Unlock the door
UnlockWithTimeout0x03Unlock with auto-relock

Features:

  • PIN (0x01): PIN credential
  • RID (0x02): RFID credential
  • FPG (0x04): Fingerprint
  • LOG (0x08): Logging
  • WDSCH (0x10): Week day schedules
  • DPS (0x20): Door position sensor
  • FACE (0x40): Face recognition
  • COTA (0x80): Credential over-the-air
  • USR (0x100): User management
  • NOT (0x200): Notification
  • YDSCH (0x400): Year day schedules
  • HDSCH (0x800): Holiday schedules
  • UBOLT (0x1000): Unbolt feature

3.5 Power Source Cluster (0x002F) - MEDIUM PRIORITY

Spec Reference: Matter Core Spec, Section 11.7

Required Attributes:

AttributeIDTypeConformanceDescription
Status0x0000enum8MUnspecified/Active/Standby/Unavailable
Order0x0001uint8MPriority order
Description0x0002stringMHuman readable
BatChargeLevel0x000Eenum8BATOK/Warning/Critical
BatPercentRemaining0x000Cuint8BAT0-200 (0.5% steps)
BatVoltage0x000Buint32BATmV

Features:

  • WIRED (0x01): Wired power source
  • BAT (0x02): Battery power source
  • RECHG (0x04): Rechargeable battery
  • REPLC (0x08): Replaceable battery

Part 4: Implementation Roadmap

Phase 1: High Priority (Immediate Value)

  1. Energy Measurement Plugins (2-3 weeks)

    • Create Matter_Plugin_Sensor_Power.be
    • Create Matter_Plugin_Sensor_Energy.be
    • Map to existing Tasmota energy drivers
    • Test with PZEM, HLW8012, ADE7953
  2. Thermostat Plugin (1-2 weeks)

    • Create Matter_Plugin_Thermostat.be
    • Map to Tasmota thermostat commands
    • Support heating/cooling modes
  3. Door Lock Plugin (1 week)

    • Create Matter_Plugin_Lock.be
    • Basic lock/unlock functionality
    • Map to Tasmota relay or GPIO

Phase 2: Medium Priority (Enhanced Features)

  1. Power Source Cluster (1 week)

    • Add to Root node for battery devices
    • Support wired and battery modes
  2. Complete OTA Cluster (2 weeks)

    • Enable Matter-based firmware updates
    • Integrate with Tasmota OTA system
  3. Water Valve Device (1 week)

    • Create Matter_Plugin_Valve.be
    • Map to Tasmota relay

Phase 3: Low Priority (Future)

  1. Matter 1.4 Energy Management

    • Device Energy Management cluster
    • Energy optimization features
  2. Media Device Types

    • Video player support
    • Speaker support

Part 5: Code Changes Summary

New Files Required

FilePurposePriority
Matter_Plugin_Sensor_Power.beElectrical Power MeasurementHIGH
Matter_Plugin_Sensor_Energy.beElectrical Energy MeasurementHIGH
Matter_Plugin_Thermostat.beThermostat deviceHIGH
Matter_Plugin_Lock.beDoor Lock deviceHIGH
Matter_Plugin_Valve.beWater Valve deviceMEDIUM

Modifications to Existing Files

FileChangePriority
Matter_Plugin_0.beAdd cluster revisions for new clustersHIGH
Matter_Plugin_1_Root.beAdd Power Source cluster (optional)MEDIUM
Matter_Plugin_z_All.beRegister new plugin classesHIGH
Matter_z_Autoconf.beAuto-detect energy devicesHIGH

Cluster Revision Updates

Add to CLUSTER_REVISIONS in Matter_Plugin_0.be:

berry
0x002F: 2,  # Power Source
0x0090: 1,  # Electrical Power Measurement
0x0091: 1,  # Electrical Energy Measurement
0x0080: 1,  # Boolean State Configuration
0x0081: 1,  # Valve Configuration and Control

Feature Map Updates

Add to FEATURE_MAPS in Matter_Plugin_0.be:

berry
0x0090: 0x00,  # Electrical Power Measurement (base features)
0x0091: 0x05,  # Electrical Energy Measurement (IMPE + CUME)
0x0201: 0x23,  # Thermostat (HEAT + COOL + AUTO)
0x0101: 0x00,  # Door Lock (base features)
0x002F: 0x01,  # Power Source (WIRED)

Part 6: DataModel Revision Update

Current implementation returns DataModelRevision = 17 (Matter 1.2).

To claim Matter 1.4.1 compliance, update to DataModelRevision = 18 after implementing:

  • All mandatory cluster revisions
  • Required attribute updates
  • New cluster support

Location: Matter_Plugin_1_Root.be, line ~230:

berry
# Current:
return tlv_solo.set(TLV.U2, 17)     # 17 = Matter 1.2

# After full 1.4.1 compliance:
return tlv_solo.set(TLV.U2, 18)     # 18 = Matter 1.4

Appendix A: Tasmota Energy Driver Mapping

Tasmota DriverSupported MeasurementsMatter Cluster Mapping
PZEM-004TV, A, W, Wh, Hz, PF0x0090 + 0x0091
HLW8012V, A, W, Wh0x0090 + 0x0091
BL0937V, A, W, Wh0x0090 + 0x0091
BL0940V, A, W, Wh0x0090 + 0x0091
ADE7953V, A, W, Wh, VAR, VA, PF0x0090 + 0x0091
CSE7766V, A, W, Wh0x0090 + 0x0091
SDM120V, A, W, Wh, Hz, PF, VA, VAR0x0090 + 0x0091
SDM6303-phase V, A, W, Wh, Hz, PF0x0090 + 0x0091 (POLY)

Tasmota Energy JSON Structure:

json
{
  "Energy": {
    "TotalStartTime": "2023-01-01T00:00:00",
    "Total": 123.456,
    "Yesterday": 1.234,
    "Today": 0.567,
    "Power": 150,
    "ApparentPower": 160,
    "ReactivePower": 50,
    "Factor": 0.94,
    "Voltage": 230,
    "Current": 0.65,
    "Frequency": 50.0
  }
}

Appendix B: Testing Recommendations

Test Controllers

  • Apple Home (iOS 16+)
  • Google Home
  • Amazon Alexa
  • Samsung SmartThings
  • Home Assistant (Matter integration)

Test Scenarios

  1. Energy Measurement

    • Verify power readings update in real-time
    • Check energy accumulation over time
    • Test with multiple energy drivers
  2. Thermostat

    • Test heating/cooling mode switching
    • Verify setpoint changes
    • Check temperature reporting
  3. Door Lock

    • Test lock/unlock commands
    • Verify state reporting
    • Test with physical button override

Document Version: 1.0 Last Updated: January 2026