{
  "$schema": "https://raw.githubusercontent.com/nobrega8/mbmap-library/main/schema/mbmap-2.schema.json",
  "mbmap": 2,
  "vendor": "Midea",
  "model": "M-Thermal (wired controller)",
  "vendor_website": "midea.com",
  "description": "Midea / Systemair M-Thermal split heat pumps, through the wired controller Modbus port",
  "revision": 1,
  "revised": "2026-10-14",
  "source": "Warm Energy Labs Heat Pump Modbus Database (MIT licence), based on the Systemair M-Thermal operation manual; not tested",
  "sources": [
    {
      "title": "Heat Pump Modbus Database (Warm Energy Labs)",
      "url": "https://github.com/Warm-Energy/Heat-Pump-Modbus-Database",
      "note": "src/midea/modbus_registers.json, MIT licence, Copyright (c) 2025 Warm Energy Labs Ltd"
    }
  ],
  "notes": [
    "The Modbus address is set with DIP switch S3 on the hydraulic module: 0 gives address 16, 1-15 give addresses 1-15.",
    "The source lists 100-140 as input registers; check the function code on your controller.",
    "DC bus voltage is sent in units of 10 V, water flow in 0.01 m³/h and capacity in 0.01 kW (the source writes these as divisors).",
    "Writing to a heat pump can damage it: check before you write."
  ],
  "unit_id": 16,
  "x_status": "unofficial",
  "x_origin": "warm-energy",
  "protocol": "rtu",
  "baudrate": 9600,
  "parity": "N",
  "stopbits": 1,
  "byte_order": "big",
  "word_order": "big",
  "address_base": 0,
  "registers": [
    {"name": "Compressor Frequency", "area": "input", "address": 100, "type": "uint16", "unit": "Hz", "description": "Compressor operating frequency"},
    {"name": "Actual Operating Mode", "area": "input", "address": 101, "type": "uint16", "enum": {"0": "Off", "2": "Cooling", "3": "Heating"}, "description": "Actual operating mode"},
    {"name": "Fan Speed", "area": "input", "address": 102, "type": "uint16", "unit": "rpm", "description": "Fan speed"},
    {"name": "PMV Openness", "area": "input", "address": 103, "type": "uint16", "unit": "P", "description": "Electronic expansion valve openness"},
    {"name": "Water Inlet Temperature", "area": "input", "address": 104, "type": "int16", "unit": "°C", "description": "Water inlet temperature TW_in"},
    {"name": "Water Outlet Temperature", "area": "input", "address": 105, "type": "int16", "unit": "°C", "description": "Water outlet temperature TW_out"},
    {"name": "T3 Temperature", "area": "input", "address": 106, "type": "int16", "unit": "°C", "description": "Condenser temperature T3"},
    {"name": "Outdoor Temperature", "area": "input", "address": 107, "type": "int16", "unit": "°C", "description": "Outdoor ambient temperature T4"},
    {"name": "Discharge Temperature", "area": "input", "address": 108, "type": "int16", "unit": "°C", "description": "Compressor discharge temperature Tp"},
    {"name": "Return Air Temperature", "area": "input", "address": 109, "type": "int16", "unit": "°C", "description": "Compressor return air temperature"},
    {"name": "Total Water Outlet Temperature", "area": "input", "address": 110, "type": "int16", "unit": "°C", "description": "Total water outlet temperature T1"},
    {"name": "Water Outlet After Heater", "area": "input", "address": 111, "type": "int16", "unit": "°C", "description": "Water outlet temperature after auxiliary heater T1B"},
    {"name": "Refrigerant Liquid Temperature", "area": "input", "address": 112, "type": "int16", "unit": "°C", "description": "Refrigerant liquid side temperature T2"},
    {"name": "Refrigerant Gas Temperature", "area": "input", "address": 113, "type": "int16", "unit": "°C", "description": "Refrigerant gas side temperature T2B"},
    {"name": "Room Temperature", "area": "input", "address": 114, "type": "int16", "unit": "°C", "description": "Room temperature Ta"},
    {"name": "DHW Tank Temperature", "area": "input", "address": 115, "type": "int16", "unit": "°C", "description": "Water tank temperature T5"},
    {"name": "High Pressure", "area": "input", "address": 116, "type": "uint16", "unit": "kPa", "description": "High pressure value"},
    {"name": "Low Pressure", "area": "input", "address": 117, "type": "uint16", "unit": "kPa", "description": "Low pressure value"},
    {"name": "Outdoor Unit Current", "area": "input", "address": 118, "type": "uint16", "unit": "A", "description": "Outdoor unit operating current"},
    {"name": "Outdoor Unit Voltage", "area": "input", "address": 119, "type": "uint16", "unit": "V", "description": "Outdoor unit voltage"},
    {"name": "Compressor Operating Time", "area": "input", "address": 122, "type": "uint16", "unit": "h", "description": "Compressor operating time"},
    {"name": "Current Fault", "area": "input", "address": 124, "type": "uint16", "description": "Current fault code"},
    {"name": "Status Bit 1", "area": "input", "address": 128, "type": "uint16", "description": "Status bits"},
    {"name": "Status Bit 1: Reserved", "area": "input", "address": 128, "type": "bool", "bit": 0},
    {"name": "Status Bit 1: Defrosting", "area": "input", "address": 128, "type": "bool", "bit": 1, "description": "Defrost mode active"},
    {"name": "Status Bit 1: Anti-freezing", "area": "input", "address": 128, "type": "bool", "bit": 2, "description": "Anti-freeze protection active"},
    {"name": "Status Bit 1: Oil return", "area": "input", "address": 128, "type": "bool", "bit": 3},
    {"name": "Status Bit 1: Remote On/Off", "area": "input", "address": 128, "type": "bool", "bit": 4},
    {"name": "Status Bit 1: Outdoor unit test mode", "area": "input", "address": 128, "type": "bool", "bit": 5},
    {"name": "Status Bit 1: Room thermostat heating", "area": "input", "address": 128, "type": "bool", "bit": 6},
    {"name": "Status Bit 1: Room thermostat cooling", "area": "input", "address": 128, "type": "bool", "bit": 7},
    {"name": "Status Bit 1: Solar energy signal input", "area": "input", "address": 128, "type": "bool", "bit": 8},
    {"name": "Status Bit 1: SG normal electricity", "area": "input", "address": 128, "type": "bool", "bit": 10},
    {"name": "Status Bit 1: EUV free electricity", "area": "input", "address": 128, "type": "bool", "bit": 11},
    {"name": "Load Output", "area": "input", "address": 129, "type": "uint16", "description": "Load output status"},
    {"name": "Load Output: Electric heater IBH1", "area": "input", "address": 129, "type": "bool", "bit": 0},
    {"name": "Load Output: Reserved", "area": "input", "address": 129, "type": "bool", "bit": 1},
    {"name": "Load Output: Electric heater TBH", "area": "input", "address": 129, "type": "bool", "bit": 2},
    {"name": "Load Output: Water pump PUMP_I", "area": "input", "address": 129, "type": "bool", "bit": 3},
    {"name": "Load Output: SV1", "area": "input", "address": 129, "type": "bool", "bit": 4},
    {"name": "Load Output: External water pump P_o", "area": "input", "address": 129, "type": "bool", "bit": 6},
    {"name": "Load Output: Water return pump P_d", "area": "input", "address": 129, "type": "bool", "bit": 7},
    {"name": "Load Output: Mixed water pump P_c", "area": "input", "address": 129, "type": "bool", "bit": 8},
    {"name": "Load Output: SV2", "area": "input", "address": 129, "type": "bool", "bit": 9},
    {"name": "Load Output: HEAT4", "area": "input", "address": 129, "type": "bool", "bit": 10},
    {"name": "Load Output: Solar water pump", "area": "input", "address": 129, "type": "bool", "bit": 11},
    {"name": "Load Output: ALARM", "area": "input", "address": 129, "type": "bool", "bit": 12},
    {"name": "Load Output: RUN", "area": "input", "address": 129, "type": "bool", "bit": 13},
    {"name": "Load Output: External heater", "area": "input", "address": 129, "type": "bool", "bit": 14},
    {"name": "Load Output: DEFROST", "area": "input", "address": 129, "type": "bool", "bit": 15},
    {"name": "DC Bus Current", "area": "input", "address": 133, "type": "uint16", "unit": "A", "description": "DC bus current"},
    {"name": "DC Bus Voltage", "area": "input", "address": 134, "type": "uint16", "scale": 10, "unit": "V", "description": "DC bus voltage"},
    {"name": "Water Flow Rate", "area": "input", "address": 138, "type": "uint16", "scale": 0.01, "unit": "m³/h", "description": "Water flow rate"},
    {"name": "Heat Pump Capacity", "area": "input", "address": 140, "type": "uint16", "scale": 0.01, "unit": "kW", "description": "Heat pump capacity"},
    {"name": "Power Control", "area": "holding", "address": 0, "type": "uint16", "description": "Power on/off control", "access": "RW"},
    {"name": "Power Control: Floor heating power (0=off, 1=on)", "area": "holding", "address": 0, "type": "bool", "bit": 0, "access": "RW", "description": "Floor heating on/off"},
    {"name": "Power Control: Zone 1 power (0=off, 1=on)", "area": "holding", "address": 0, "type": "bool", "bit": 1, "access": "RW", "description": "Zone 1 heating/cooling on/off"},
    {"name": "Power Control: DHW power (0=off, 1=on)", "area": "holding", "address": 0, "type": "bool", "bit": 2, "access": "RW", "description": "Domestic hot water on/off"},
    {"name": "Power Control: Zone 2 power (0=off, 1=on)", "area": "holding", "address": 0, "type": "bool", "bit": 3, "access": "RW", "description": "Zone 2 heating/cooling on/off"},
    {"name": "Operating Mode", "area": "holding", "address": 1, "type": "uint16", "enum": {"1": "Auto", "2": "Cool", "3": "Heat"}, "description": "Operating mode setting", "access": "RW"},
    {"name": "Water Temperature Setpoint", "area": "holding", "address": 2, "type": "int16", "unit": "°C", "description": "Water temperature setpoint T1s", "access": "RW", "write_min": 5, "write_max": 60},
    {"name": "Room Temperature Setpoint", "area": "holding", "address": 3, "type": "int16", "unit": "°C", "description": "Room temperature setpoint Ts", "access": "RW", "write_min": 17, "write_max": 30},
    {"name": "DHW Temperature Setpoint", "area": "holding", "address": 4, "type": "int16", "unit": "°C", "description": "DHW tank temperature setpoint T5s", "access": "RW", "write_min": 40, "write_max": 60},
    {"name": "Function Settings", "area": "holding", "address": 5, "type": "uint16", "description": "Function settings", "access": "RW"},
    {"name": "Function Settings: Disinfect", "area": "holding", "address": 5, "type": "bool", "bit": 4, "access": "RW", "description": "Disinfection mode on/off"},
    {"name": "Function Settings: Holiday away", "area": "holding", "address": 5, "type": "bool", "bit": 5, "access": "RW", "description": "Holiday away mode"},
    {"name": "Function Settings: Silent mode", "area": "holding", "address": 5, "type": "bool", "bit": 6, "access": "RW", "description": "Silent mode on/off"},
    {"name": "Function Settings: Silent mode level (0=level1, 1=level2)", "area": "holding", "address": 5, "type": "bool", "bit": 7, "access": "RW"},
    {"name": "Function Settings: Holiday home", "area": "holding", "address": 5, "type": "bool", "bit": 8, "access": "RW"},
    {"name": "Function Settings: ECO mode", "area": "holding", "address": 5, "type": "bool", "bit": 10, "access": "RW", "description": "ECO mode on/off"},
    {"name": "Function Settings: DHW pump constant temp recycling", "area": "holding", "address": 5, "type": "bool", "bit": 11, "access": "RW"},
    {"name": "Function Settings: Curve setting enabled", "area": "holding", "address": 5, "type": "bool", "bit": 12, "access": "RW"},
    {"name": "Curve Selection", "area": "holding", "address": 6, "type": "uint16", "description": "Weather compensation curve selection", "access": "RW", "write_min": 1, "write_max": 8},
    {"name": "Water Flow Climate temperature", "area": "holding", "address": 105, "type": "int16", "unit": "°C"},
    {"name": "Zone1 Climate temperature", "area": "holding", "address": 114, "type": "int16", "unit": "°C"},
    {"name": "DHW Climate temperature", "area": "holding", "address": 115, "type": "int16", "unit": "°C"}
  ]
}
