"""Define mapping for MQTT messages field conversions depending on Anker Solix model."""

from typing import Final

from .apitypes import DeviceHexDataTypes
from .mqttcmdmap import (
    BYTES,
    CMD_AC_CHARGE_LIMIT,
    CMD_AC_DC_MODE,
    CMD_AC_FAST_CHARGE_SWITCH,
    CMD_AC_OUTPUT_MODE,
    CMD_AC_OUTPUT_SWITCH,
    CMD_AC_PORT_SWITCH,
    CMD_BATTERY_CHARGE_LIMITS,
    CMD_COMMON_V2,
    CMD_DC_12V_OUTPUT_MODE,
    CMD_DC_OUTPUT_SWITCH,
    CMD_DC_OUTPUT_TIMEOUT_SEC,
    # CMD_DEVICE_MAX_LOAD,
    CMD_DEVICE_POWER_MODE,
    CMD_DEVICE_SWITCH,
    CMD_DEVICE_TIMEOUT_MIN,
    CMD_DISPLAY_MODE,
    CMD_DISPLAY_SWITCH,
    CMD_DISPLAY_TIMEOUT_SEC,
    CMD_EV_AUTO_CHARGE_RESTART_SWITCH,
    CMD_EV_AUTO_START_SWITCH,
    CMD_EV_CHARGE_RANDOM_DELAY_SWITCH,
    CMD_EV_CHARGER_MODE,
    CMD_EV_CHARGER_SCHEDULE_SETTINGS,
    CMD_EV_CHARGER_SCHEDULE_TIMES,
    CMD_EV_LIGHT_BRIGHTNESS,
    CMD_EV_LIGHT_OFF_SCHEDULE,
    CMD_EV_LOAD_BALANCING,
    CMD_EV_MAX_CHARGE_CURRENT,
    CMD_EV_SOLAR_CHARGING,
    CMD_LIGHT_MODE,
    CMD_MAIN_BREAKER_LIMIT,
    CMD_MODBUS_SWITCH,
    CMD_PLUG_DELAYED_TOGGLE,
    CMD_PLUG_LOCK_SWITCH,
    CMD_PLUG_SCHEDULE,
    CMD_PORT_MEMORY_SWITCH,
    CMD_REALTIME_TRIGGER,
    CMD_SB_3RD_PARTY_PV_SWITCH,
    CMD_SB_AC_INPUT_LIMIT,
    CMD_SB_AC_SOCKET_SWITCH,
    CMD_SB_DEVICE_TIMEOUT,
    CMD_SB_DISABLE_GRID_EXPORT_SWITCH,
    CMD_SB_EV_CHARGER_SWITCH,
    CMD_SB_INVERTER_TYPE,
    CMD_SB_LIGHT_MODE,
    CMD_SB_LIGHT_SWITCH,
    CMD_SB_MAX_LOAD,
    CMD_SB_MIN_SOC,
    CMD_SB_POWER_CUTOFF,
    CMD_SB_PV_LIMIT,
    CMD_SB_STATUS_CHECK,
    CMD_SB_USAGE_MODE,
    CMD_SMART_TOUCH_MODE,
    CMD_SOC_LIMITS_V2,
    CMD_STATUS_REQUEST,
    CMD_SWIPE_DOWN_MODE,
    CMD_SWIPE_UP_MODE,
    CMD_TEMP_UNIT,
    CMD_TEMP_UNIT_V2,
    CMD_TIMER_REQUEST,
    CMD_USB_PORT_SWITCH,
    COMMAND_LIST,
    COMMAND_NAME,
    EMBEDDED,
    FACTOR,
    LENGTH,
    MASK,
    NAME,
    OFFSET,
    SIGNED,
    STATE_CONVERTER,
    STATE_NAME,
    # TIMESTAMP_FE_NOTYPE,
    TOPIC,
    TYPE,
    VALUE_DEFAULT,
    VALUE_FOLLOWS,
    VALUE_MAX,
    VALUE_MAX_STATE,
    VALUE_MIN,
    VALUE_OPTIONS,
    VALUE_OPTIONS_STATE,
    VALUE_STATE,
    VALUE_STEP,
    SolixMqttCommands,
)

# SOLIXMQTTMAP descriptions:
# It is a nested structure to describe value extraction from Solix MQTT messages per model.messagetype.fieldname.attributes
# Field format 0x00 is variable number of bytes, string value (Base type), no special mapping attributes
# Field format 0x01 is 1 byte fix, unsigned int (Base type), FACTOR can be specified optionally for value conversion
# Field format 0x02 is 2 bytes fix, signed int LE (Base type), FACTOR can be specified optionally for value conversion
# Field format 0x03 is always 4 bytes, but could be 1-4 * int, 1-2 * signed int LE or 4 Bytes signed int LE
#   The mapping must specify "values" to indicate number of values in bytes from beginning. Default is 0 for 1 value in 4 bytes
#   FACTOR can be specified optionally for value conversion (applies to all values)
# Field format 0x04 is a bit mask pattern, byte number [00..len-1] reflects position, mask reflects the bit relevant for the value/toggle
#   The mapping must specify start byte string ("00"-"len-1") for fields, field description is a list, since single field can be used for various named settings
#   Each named setting must describe a MASK integer to indicate which bit(s) are relevant for the named setting, e.g. mask 0x64 => 0100 0000
# Field format 0x05 is 4 bytes, signed float LE (Base type), FACTOR can be specified optionally for value conversion
# Field format 0x06 can be many bytes, mix of Str and Byte values
#   The mapping must specify start byte string ("00"-"len-1") for fields, field description needs TYPE,
#   with a DeviceHexDataTypes base type for value conversion (ui=1, sile=2, sfle=4 bytes).
#   The optional LENGTH with int for byte count can be specified (default is 0 if no base type used),
#   where Length of 0 indicates that first byte contains variable field length, e.g. for str type
#   FACTOR can be specified optionally for value conversion
# FACTOR usage example: e.g. int field value -123456 with factor -0.001 will convert the value to float 123.456 (maintaining factor's precision)
# Timestamp values should contain "timestamp" in name to allow decoder methods to convert value to human readable format
# Version declaration bytes should contain "sw_" or "version" in name to convert the value(s) into version string
# Names with ? are hints for fields still to be validated. Names without ? should really be validated for correctness in various situations of the device
# Duplicate names for different fields must be avoided for same device types across its various message types. If same values show up in different message types
# the field name should be the same, so they can be merged once extracting the values from the messages into a consolidated dictionary for the device.

# To simplify the defined map, smaller and re-usable mappings should be defined independently and just re-used in the overall SOLIXMQTTMAP for
# the model types that use same field mapping structure. For example various models of the same family most likely share complete or subset of message maps

_PPS_VERSIONS_0830 = {
    # Various PPS device version param info
    TOPIC: "param_info",
    "a1": {
        NAME: "hw_version",
        TYPE: DeviceHexDataTypes.str.value,
    },
    "a2": {
        NAME: "sw_version",
        TYPE: DeviceHexDataTypes.str.value,
    },
}

_A1722_0405 = {
    # C300 AC param info
    TOPIC: "param_info",
    "a4": {NAME: "remaining_time_hours", FACTOR: 0.1, SIGNED: False},
    "a7": {NAME: "usbc_1_power"},  # USB-C port 1 output power
    "a8": {NAME: "usbc_2_power"},  # USB-C port 2 output power
    "a9": {NAME: "usbc_3_power"},  # USB-C port 3 output power
    "aa": {NAME: "usba_1_power"},  # USB-A port 1 output power
    "ac": {NAME: "dc_input_power_total"},  # DC input power (solar/car charging)
    "ad": {NAME: "ac_input_power_total"},  # Total AC Input in W (int)
    "ae": {NAME: "ac_output_power_total"},  # Total AC Output in W (int)
    "b7": {
        NAME: "ac_output_power_switch"
    },  # AC output switch: Disabled (0) or Enabled (1)
    "b8": {NAME: "dc_charging_status"},  # None (0), Charging (1)
    "b9": {NAME: "temperature", SIGNED: True},  # In Celsius
    "ba": {NAME: "charging_status"},  # None (0), Discharging (1), Charging (2) ???
    "bb": {NAME: "battery_soc"},  # Battery SOC
    "bc": {NAME: "battery_soh"},  # Battery Health
    "c1": {
        NAME: "dc_output_power_switch"
    },  # DC output switch: Disabled (0) or Enabled (1)
    "c5": {NAME: "device_sn"},  # Device serial number
    "c6": {NAME: "ac_input_limit"},  # Recharge limit
    "cf": {
        NAME: "display_mode"
    },  # Display brightness: Off (0), Low (1), Medium (2), High (3)
    "fe": {NAME: "msg_timestamp"},  # Message timestamp
}

_A1725_0401 = {
    # C200 DC param info (A1725/A1727/A1729) - settings
    TOPIC: "param_info",
    "a1": {NAME: "device_pn"},  # Device PN identifier
    "a4": {NAME: "display_switch"},  # Off (0) or On (1)
}

_A1725_0405 = {
    # C200 DC param info (A1725/A1727)
    TOPIC: "param_info",
    "a1": {NAME: "device_pn"},  # Device PN identifier
    "a3": {
        NAME: "remaining_time_hours",
        FACTOR: 0.1,
        SIGNED: False,
    },  # Remaining runtime
    "a4": {NAME: "usbc_1_power"},  # USB-C top output power
    "a5": {NAME: "usbc_2_power"},  # USB-C middle output power
    "a6": {NAME: "usbc_3_power"},  # USB-C bottom input/output power
    "a8": {NAME: "usba_1_power"},  # USB-A top output power
    "a9": {NAME: "usba_2_power"},  # USB-A bottom output power
    "ab": {NAME: "photovoltaic_power"},  # Solar input power (W)
    "ac": {
        NAME: "dc_input_power_total"
    },  # Total input power (solar + C3 input when charging)
    "ad": {NAME: "dc_output_power_total"},  # Total USB output power
    "af": {NAME: "battery_soc_ah", FACTOR: 0.001},  # Battery SOC (Ah)
    "b5": {NAME: "temperature", SIGNED: True},  # In Celsius
    "b6": {NAME: "charging_status"},  # Power state: 0=idle, 1=discharge, 2=charge
    "b7": {NAME: "battery_soc"},  # Battery state of charge (%)
    "b8": {NAME: "battery_soh"},  # Battery health
    "b9": {NAME: "usbc_1_status"},  # USB-C1 top status: Inactive (0), Discharging (1)
    "ba": {
        NAME: "usbc_2_status"
    },  # USB-C2 middle status: Inactive (0), Discharging (1)
    "bb": {
        NAME: "usbc_3_status"
    },  # USB-C3 bottom status: Inactive (0), Discharging (1), Charging (2)
    "bd": {NAME: "usba_1_status"},  # USB-A1 top status: Inactive (0), Discharging (1)
    "be": {
        NAME: "usba_2_status"
    },  # USB-A2 bottom status: Inactive (0), Discharging (1)
    "c3": {NAME: "device_sn"},
    "c4": {
        NAME: "device_timeout_minutes"
    },  # Device timeout: never, 30, 60, 120, 240, 360, 720, 1440 minutes
    "c5": {
        NAME: "display_timeout_seconds"
    },  # Display timeout: 20, 30, 60, 300, 1800 seconds
    "c7": {NAME: "display_mode"},  # Brightness: Low (1), Medium (2), High (3)
    "c9": {
        NAME: "temp_unit_fahrenheit"
    },  # Temperature unit: Celsius (0), Fahrenheit (1)
    "ca": {NAME: "display_switch"},  # Off (0) or On (1)
    "cd": {NAME: "charging_status"},  # Inactive (0), Solar (1)
    "fe": {NAME: "msg_timestamp"},  # Message timestamp
}

_A1728_0401 = {
    # C300(X) DC param info
    TOPIC: "param_info",
    "a2": {NAME: "dc_12v_1_status"},  # DC 12V status: Inactive (0), Discharging (1)
    "a3": {
        NAME: "light_mode"
    },  # LED light mode: Off (0), Low (1), Medium (2), High (3)
    "a4": {NAME: "display_switch"},  # Off (0) or On (1)
}

_A1728_0404 = {
    # C300(X) DC param info
    TOPIC: "param_info",
    "a2": {NAME: "dc_output_timeout_seconds"},  # Timeout seconds, custom range: 0-86100
}

_A1728_0405 = {
    # C300(X) DC param info
    TOPIC: "param_info",
    "a2": {NAME: "dc_output_timeout_seconds"},  # Timeout seconds, custom range: 0-86100
    "a3": {NAME: "remaining_time_hours", FACTOR: 0.1, SIGNED: False},
    "a4": {NAME: "usbc_1_power"},  # USB-C left output power
    "a5": {NAME: "usbc_2_power"},  # USB-C center input/output power
    "a6": {NAME: "usbc_3_power"},  # USB-C right input/output power
    "a7": {NAME: "usbc_4_power"},  # USB-C top output power
    "a8": {NAME: "usba_1_power"},  # USB-A left output power
    "a9": {NAME: "usba_2_power"},  # USB-A right output power
    "aa": {NAME: "dc_12v_1_power"},  # 12V car charger port output power
    "ab": {NAME: "photovoltaic_power"},  # Solar input power
    "ac": {NAME: "dc_input_power_total"},  # DC input power total (solar + USB-C input)
    "ad": {NAME: "dc_output_power_total"},  # Total DC output power for all ports
    "af": {NAME: "battery_soc_ah", FACTOR: 0.001},  # Battery SOC (Ah)
    "b0": {NAME: "sw_version", "values": 1},  # Main firmware version
    # "b1": {NAME: "version1?", "values": 1},  # Version?
    # "b2": {NAME: "version2?", "values": 1},  # Version?
    # "b3": {NAME: "version3?", "values": 1},  # Same as main firmware version
    # "b4": {NAME: "version4?", "values": 1},  # Same as main firmware version
    "b5": {NAME: "temperature", SIGNED: True},  # In Celsius
    "b6": {
        NAME: "charging_status",  # Total status: Inactive (0), Discharging (1), Charging (2)
    },
    "b7": {NAME: "battery_soc"},  # Battery SOC
    "b8": {NAME: "battery_soh"},  # Battery health
    "b9": {NAME: "usbc_1_status"},  # USB-C left status: Inactive (0), Discharging (1)
    "ba": {
        NAME: "usbc_2_status"
    },  # USB-C center status: Inactive (0), Discharging (1), Charging (2)
    "bb": {NAME: "usbc_3_status"},  # USB-C right status: Inactive (0), Discharging (1)
    "bc": {NAME: "usbc_4_status"},  # USB-C top status: Inactive (0), Discharging (1)
    "bd": {NAME: "usba_1_status"},  # USB-A left status: Inactive (0), Discharging (1)
    "be": {NAME: "usba_2_status"},  # USB-A right status: Inactive (0), Discharging (1)
    "bf": {
        NAME: "dc_12v_1_status"
    },  # DC 12V status: Inactive (0), Discharging (1), Charging (2)
    "c1": {
        NAME: "overload_event"
    },  # Overload event for port: None (0), USB-C1 (8), USB-C2 (9), USB-C3 (10), ...?
    "c3": {NAME: "device_sn"},
    "c4": {
        NAME: "device_timeout_minutes"
    },  # Device timeout: never, 30, 60, 120, 240, 360, 720, 1440 minutes
    "c5": {
        NAME: "display_timeout_seconds"
    },  # Display timeout: 20, 30, 60, 300, 1800 seconds
    "c7": {NAME: "display_mode"},  # Brightness: Low (1), Medium (2), High (3)
    "c8": {
        NAME: "light_mode"
    },  # LED light mode: Off (0), Low (1), Medium (2), High (3)
    "c9": {NAME: "temp_unit_fahrenheit"},  # Celsius (0) or Fahrenheit (1)
    "ca": {NAME: "display_switch"},  # Off (0) or On (1)
    "cb": {
        NAME: "light_timeout_minutes"
    },  # Light timeout: never, 30, 60, 120, 240, 360, 720, 1440 minutes
    "cd": {NAME: "charging_status"},  # Inactive (0), Solar (1)
    "f7": {
        NAME: "dc_12v_auto_on"
    },  # Off (0), Last state (1) - as soon as the battery is charged to 10% again
    "f8": {
        BYTES: {
            "00": {
                NAME: "dc_12v_output_mode",  # Normal (1), Smart (2) - auto-off below 3W
                TYPE: DeviceHexDataTypes.ui.value,
            },
        }
    },
    "fe": {NAME: "msg_timestamp"},  # Message timestamp
}

_A1729_0405 = _A1725_0405 | {
    # C200X DC param info (A1729)
    # A1729 matches the C200 DC telemetry layout, but cd is only the solar input
    # status. Keep b6 as the overall charging_status because C3 charging reports
    # b6=2 while cd remains 0.
    "cd": {NAME: "solar_input_status"},  # Inactive (0), Solar (1)
}

_A1761_0405 = {
    # PPS C1000(X) parm info
    TOPIC: "param_info",
    "a4": {
        NAME: "remaining_time_hours",
        FACTOR: 0.1,
        SIGNED: False,
    },  # In hours (value * factor)
    "a5": {NAME: "ac_input_power"},  # AC charging power to battery
    "a6": {NAME: "ac_output_power"},  # Individual AC outlet power
    "a7": {NAME: "usbc_1_power"},  # USB-C port 1 output power
    "a8": {NAME: "usbc_2_power"},  # USB-C port 2 output power
    "a9": {NAME: "usba_1_power"},  # USB-A port 1 output power
    "aa": {NAME: "usba_2_power"},  # USB-A port 2 output power
    "ae": {NAME: "dc_input_power"},  # DC input power (solar/car charging)
    "af": {NAME: "photovoltaic_power"},  # Solar input
    "b0": {NAME: "output_power_total"},  # Combined AC DC output power
    "b3": {NAME: "sw_version", "values": 1},  # Main firmware version
    "b9": {NAME: "sw_expansion", "values": 1},  # Expansion firmware version
    "ba": {NAME: "sw_controller", "values": 1},  # Controller firmware version
    "bb": {NAME: "ac_output_power_switch"},  # Disabled (0) or Enabled (1)
    "bd": {NAME: "temperature", SIGNED: True},  # Main device temperature (°C)
    "be": {
        NAME: "exp_1_temperature",
        SIGNED: True,
    },  # Expansion battery 1 temperature (°C)
    "c1": {NAME: "main_battery_soc"},  # Main battery state of charge (%)
    "c2": {NAME: "exp_1_soc"},  # Expansion battery 1 state of charge (%)
    "c3": {NAME: "battery_soh"},  # Main battery state of health (%)
    "c4": {NAME: "exp_1_soh"},  # Expansion battery 1 state of health (%)
    "c5": {NAME: "expansion_packs"},  # number of expansion batteries
    "d0": {NAME: "device_sn"},  # Device serial number
    "d1": {NAME: "ac_input_limit"},  # Max AC charge setting (W)
    "d2": {
        NAME: "device_timeout_minutes"
    },  # Device auto-off timeout (minutes): 0 (Never), 30, 60, 120, 240, 360, 720, 1440
    "d3": {NAME: "display_timeout_seconds"},  # Options: 20, 30, 60, 300, 1800 seconds
    "d8": {NAME: "dc_output_power_switch"},  # Disabled (0) or Enabled (1)
    "d9": {NAME: "display_mode"},  # Brightness: Off (0), Low (1), Medium (2), High (3)
    "da": {NAME: "ac_frequency"},  # 60 / 50 Hz
    "dc": {
        NAME: "light_mode"
    },  # LED light mode: Off (0), Low (1), Medium (2), High (3), Blinking (4)
    "dd": {NAME: "temp_unit_fahrenheit"},  # Celsius (0) or Fahrenheit (1)
    "de": {NAME: "display_switch"},  # Off (0) or On (1)
    "e5": {NAME: "backup_charge_switch"},  # Off (0) or On (1)
    "f8": {
        BYTES: {
            "00": {
                NAME: "dc_12v_output_mode",  # Normal (1), Smart (2) - auto-off below 3W
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "01": {
                NAME: "ac_output_mode",  # Normal (1), Smart (2) - auto-off when not charging and low power
                TYPE: DeviceHexDataTypes.ui.value,
            },
        }
    },
    "fd": {NAME: "exp_1_type"},  # Expansion battery type identifier
    "fe": {NAME: "msg_timestamp"},  # Message timestamp
}

_A1763_0421 = {
    "a2": {
        BYTES: {
            "01": {
                NAME: "device_sn",
                TYPE: DeviceHexDataTypes.str.value,
            },
            "20": {
                NAME: "device_pn",
                TYPE: DeviceHexDataTypes.str.value,
            },
        }
    },
    "a3": {
        BYTES: {
            "04": {
                NAME: "ac_input_limit_max",  # Max supported charge limit, seems fix
                TYPE: DeviceHexDataTypes.sile.value,
            },
        }
    },
    "a4": {
        BYTES: {
            "00": {
                NAME: "ac_output_timeout_seconds",  # disable (0), min:0, max: 86400, step 300
                TYPE: DeviceHexDataTypes.var.value,
                LENGTH: 4,
            },
            "04": {
                NAME: "ac_input_limit",  # AC charge limit: 100-1200 W, step: 100
                TYPE: DeviceHexDataTypes.sile.value,
            },
            "06": {
                NAME: "ac_frequency",  # 60 / 50 Hz
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "07": {
                NAME: "ac_output_mode",  # Normal (0), Smart (1) - auto-off below 14W
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "08": {
                NAME: "dc_output_timeout_seconds",  # disable (0), min:0, max: 86400, step 300
                TYPE: DeviceHexDataTypes.var.value,
                LENGTH: 4,
            },
            "12": {
                NAME: "dc_12v_output_mode",  # Normal (0), Smart (1) - auto-off below 3W
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "13": {
                NAME: "device_timeout_minutes",  # 0 (Never), 30, 60, 120, 240, 360, 720, 1440
                TYPE: DeviceHexDataTypes.sile.value,
            },
            "15": {
                NAME: "display_timeout_seconds",  # 0 (Never), 10, 30, 60, 300, 1800
                TYPE: DeviceHexDataTypes.sile.value,
            },
            "17": {
                NAME: "display_mode",  # Low (1), Medium (2), High (3)
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "19": {
                NAME: "temp_unit_fahrenheit",  # Celsius (0) or Fahrenheit (1)
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "20": {
                NAME: "ac_fast_charge_switch",  # Ultrafast Charge switch: Disabled (0) or Enabled (1)
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "21": {
                NAME: "display_switch",  # Off (0), On (1)
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "22": {
                NAME: "port_memory_switch",  # Output Port Memory switch: Disabled (0) or Enabled (1)
                TYPE: DeviceHexDataTypes.ui.value,
            },
        }
    },
    "a5": {
        BYTES: {
            "00": {
                NAME: "temperature",
                SIGNED: True,
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "02": {
                NAME: "battery_soc",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "03": {
                NAME: "battery_soh",
                TYPE: DeviceHexDataTypes.ui.value,
            },
        }
    },
    "a6": {
        BYTES: {
            "00": {
                NAME: "output_power_total",  # Output power total (AC + DC)
                TYPE: DeviceHexDataTypes.sile.value,
            },
            "02": {
                NAME: "ac_input_power",  # Input power total charge
                TYPE: DeviceHexDataTypes.sile.value,
            },
        },
    },
    "a7": {
        BYTES: {
            "00": {
                NAME: "ac_output_power_switch",  # Off (0), On (1)
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "01": {
                NAME: "ac_output_power",  # AC Output power
                TYPE: DeviceHexDataTypes.sile.value,
            },
            "04": {
                NAME: "ac_input_power_a7",  # Duplicate of a6
                TYPE: DeviceHexDataTypes.sile.value,
            },
        }
    },
    "a8": {
        BYTES: {
            "00": {
                NAME: "dc_input_power_switch",  # Off (0), On (1)
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "01": {
                NAME: "dc_input_power_total",  # DC input power (solar + car charging)
                TYPE: DeviceHexDataTypes.sile.value,
            },
        }
    },
    "aa": {
        BYTES: {
            "00": {
                NAME: "usbc_1_status",  # USB-C 1 status: Inactive (0), Discharging (1), Charging (2)
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "01": {
                NAME: "usbc_1_power",
                TYPE: DeviceHexDataTypes.sile.value,
            },
        }
    },
    "ab": {
        BYTES: {
            "00": {
                NAME: "usbc_2_status",  # USB-C 2 status: Inactive (0), Discharging (1), Charging (2)
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "01": {
                NAME: "usbc_2_power",
                TYPE: DeviceHexDataTypes.sile.value,
            },
        }
    },
    "ac": {
        BYTES: {
            "00": {
                NAME: "usbc_3_status",  # USB-C 3 status: Inactive (0), Discharging (1), Charging (2)
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "01": {
                NAME: "usbc_3_power",
                TYPE: DeviceHexDataTypes.sile.value,
            },
        }
    },
    "ae": {
        BYTES: {
            "00": {
                NAME: "usba_1_status",  # USB-A 1 status: Inactive (0), Discharging (1), Charging (2)
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "01": {
                NAME: "usba_1_power",
                TYPE: DeviceHexDataTypes.sile.value,
            },
        }
    },
    "b2": {
        BYTES: {
            "00": {
                NAME: "dc_output_power_switch",  # Off (0), On (1)
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "01": {
                NAME: "dc_output_power_total",  # Total Watt DC
                TYPE: DeviceHexDataTypes.sile.value,
            },
        }
    },
    "c0": {
        BYTES: [
            # Field has flexible byte offsets, depending on SN length
            {
                NAME: "exp_1_sn",
                TYPE: DeviceHexDataTypes.str.value,
            },
            {
                NAME: "exp_1_temperature",
                TYPE: DeviceHexDataTypes.ui.value,
                SIGNED: True,
                OFFSET: 5,
            },
            {
                NAME: "exp_1_soc",
                TYPE: DeviceHexDataTypes.ui.value,
                OFFSET: 1,
            },
            {
                NAME: "exp_1_type",
                TYPE: DeviceHexDataTypes.str.value,
                OFFSET: 6,
            },
        ]
    },
    "d9": {
        BYTES: {
            "03": {
                NAME: "max_soc",  # max_soc: 80, 85, 90, 95, 100 %
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "04": {
                NAME: "min_soc",  # min_soc: 1, 5, 10, 15, 20 %
                TYPE: DeviceHexDataTypes.ui.value,
            },
        }
    },
    "da": {
        BYTES: {
            "12": {
                NAME: "unknown_2",
                TYPE: DeviceHexDataTypes.sile.value,
            },
            "14": {
                NAME: "unknown_3",
                TYPE: DeviceHexDataTypes.sile.value,
            },
        }
    },
    "fd": {NAME: "utc_timestamp"},
    "fe": {NAME: "msg_timestamp"},
}

_A1783_0421 = {
    "a2": {
        BYTES: {
            "01": {
                NAME: "device_sn",
                TYPE: DeviceHexDataTypes.str.value,
            },
            "20": {
                NAME: "device_pn",
                TYPE: DeviceHexDataTypes.str.value,
            },
        }
    },
    "a3": {
        BYTES: {
            "00": {
                NAME: "charging_status_a3_0?",  # (0-3): Inactive (0), Solar (1), AC Input (2), Both (3)?
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "04": {
                NAME: "ac_input_limit_max",  # Max supported charge limit, seems fix
                TYPE: DeviceHexDataTypes.sile.value,
            },
        }
    },
    "a4": {
        BYTES: {
            "00": {
                NAME: "ac_output_timeout_seconds",  # disable (0), min:0, max: 86400, step 300
                TYPE: DeviceHexDataTypes.var.value,
                LENGTH: 4,
            },
            "04": {
                NAME: "ac_input_limit",  # AC charge limit: 100-2400 W, step: 100
                TYPE: DeviceHexDataTypes.sile.value,
            },
            "06": {
                NAME: "ac_frequency",  # 60 / 50 Hz
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "07": {
                NAME: "ac_output_mode",  # Normal (0), Smart (1) - auto-off below 14W
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "08": {
                NAME: "dc_output_timeout_seconds",  # disable (0), min:0, max: 86400, step 300
                TYPE: DeviceHexDataTypes.var.value,
                LENGTH: 4,
            },
            "12": {
                NAME: "dc_12v_output_mode",  # Normal (0), Smart (1) - auto-off below 3W
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "13": {
                NAME: "device_timeout_minutes",  # 0 (Never), 30, 60, 120, 240, 360, 720, 1440
                TYPE: DeviceHexDataTypes.sile.value,
            },
            "15": {
                NAME: "display_timeout_seconds",  # 0 (Never), 10, 30, 60, 300, 1800
                TYPE: DeviceHexDataTypes.sile.value,
            },
            "17": {
                NAME: "display_mode",  # Low (1), Medium (2), High (3)
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "19": {
                NAME: "temp_unit_fahrenheit",  # Celsius (0) or Fahrenheit (1)
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "20": {
                NAME: "ac_fast_charge_switch",  # Ultrafast Charge switch: Disabled (0) or Enabled (1)
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "21": {
                NAME: "display_switch",  # Off (0), On (1)
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "22": {
                NAME: "port_memory_switch",  # Output Port Memory switch: Disabled (0) or Enabled (1)
                TYPE: DeviceHexDataTypes.ui.value,
            },
        }
    },
    "a5": {
        BYTES: {
            "00": {
                NAME: "temperature",
                SIGNED: True,
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "01": {
                NAME: "charging_status_a5_1?",  # (0-3): Inactive (0), Solar (1), AC Input (2), Both (3)
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "02": {
                NAME: "battery_soc",
                TYPE: DeviceHexDataTypes.ui.value,
            },
        }
    },
    "a6": {
        BYTES: {
            "00": {
                NAME: "output_power_total",  # Output power total (AC + DC)
                TYPE: DeviceHexDataTypes.sile.value,
            },
            "02": {
                NAME: "ac_input_power",  # Input power total charge
                TYPE: DeviceHexDataTypes.sile.value,
            },
            "04": {
                NAME: "dc_input_power_total",  # # DC input power (solar + car charging)
                TYPE: DeviceHexDataTypes.sile.value,
            },
            "06": {
                NAME: "unknown_a6_06?",  # tbd
                TYPE: DeviceHexDataTypes.sile.value,
            },
            "08": {
                NAME: "unknown_a6_08?",  # tbd
                TYPE: DeviceHexDataTypes.ui.value,
            },
        },
    },
    "a7": {
        BYTES: {
            "00": {
                NAME: "ac_output_power_switch",  # Off (0), On (1)
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "01": {
                NAME: "ac_output_power",  # AC Output power
                TYPE: DeviceHexDataTypes.sile.value,
            },
            "03": {
                NAME: "unknown_power_switch_a7?",  # Off (0), On (1)
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "04": {
                NAME: "unknown_power_a7?",
                TYPE: DeviceHexDataTypes.sile.value,
            },
        }
    },
    "aa": {
        BYTES: {
            "00": {
                NAME: "usbc_1_status",  # USB-C 1 status: Inactive (0), Discharging (1), Charging (2)
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "01": {
                NAME: "usbc_1_power",
                TYPE: DeviceHexDataTypes.sile.value,
            },
        }
    },
    "ab": {
        BYTES: {
            "00": {
                NAME: "usbc_2_status",  # USB-C 2 status: Inactive (0), Discharging (1), Charging (2)
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "01": {
                NAME: "usbc_2_power",
                TYPE: DeviceHexDataTypes.sile.value,
            },
        }
    },
    "ac": {
        BYTES: {
            "00": {
                NAME: "usbc_3_status",  # USB-C 3 status: Inactive (0), Discharging (1), Charging (2)
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "01": {
                NAME: "usbc_3_power",
                TYPE: DeviceHexDataTypes.sile.value,
            },
        }
    },
    "ae": {
        BYTES: {
            "00": {
                NAME: "usba_1_status",  # USB-A 1 status: Inactive (0), Discharging (1), Charging (2)
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "01": {
                NAME: "usba_1_power",
                TYPE: DeviceHexDataTypes.sile.value,
            },
        }
    },
    "b2": {
        BYTES: {
            "00": {
                NAME: "dc_output_power_switch",  # Off (0), On (1)
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "01": {
                NAME: "dc_output_power_total",  # Total Watt DC
                TYPE: DeviceHexDataTypes.sile.value,
            },
        }
    },
    "c0": {
        BYTES: [
            # Field has flexible byte offsets, depending on SN length
            {
                NAME: "exp_1_sn",
                TYPE: DeviceHexDataTypes.str.value,
            },
            {
                NAME: "exp_1_temperature",
                TYPE: DeviceHexDataTypes.ui.value,
                SIGNED: True,
                OFFSET: 5,
            },
            {
                NAME: "exp_1_soc",
                TYPE: DeviceHexDataTypes.ui.value,
                OFFSET: 1,
            },
            {
                NAME: "exp_1_type",
                TYPE: DeviceHexDataTypes.str.value,
                OFFSET: 6,
            },
        ]
    },
    "d9": {
        BYTES: {
            "03": {
                NAME: "max_soc",  # max_soc: 80, 85, 90, 95, 100 %
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "04": {
                NAME: "min_soc",  # min_soc: 1, 5, 10, 15, 20 %
                TYPE: DeviceHexDataTypes.ui.value,
            },
        }
    },
    "da": {
        BYTES: {
            "12": {
                NAME: "unknown_da_12?",
                TYPE: DeviceHexDataTypes.sile.value,
            },
            "14": {
                NAME: "unknown_da_14?",
                TYPE: DeviceHexDataTypes.sile.value,
            },
        }
    },
    "fd": {NAME: "utc_timestamp"},
    "fe": {NAME: "msg_timestamp"},
}

_A1780_0405 = {
    # F2000(P) param info
    TOPIC: "param_info",
    "a4": {NAME: "remaining_time_hours", FACTOR: 0.1, SIGNED: False},  # In hours
    "a5": {NAME: "ac_input_power"},  # AC charging power to battery
    "a6": {NAME: "ac_output_power"},  # AC outlet power
    "a7": {NAME: "usbc_1_power"},  # USB-C port 1 output power
    "a8": {NAME: "usbc_2_power"},  # USB-C port 2 output power
    "a9": {NAME: "usbc_3_power"},  # USB-C port 3 output power
    "aa": {NAME: "usba_1_power"},  # USB-A port 1 output power
    "ab": {NAME: "usba_2_power"},  # USB-A port 2 output power
    "ac": {NAME: "dc_12v_1_power"},  # 12V port 1 output power
    "ad": {NAME: "dc_12v_2_power"},  # 12V port 2 output power
    "ae": {NAME: "dc_input_power"},  # DC input power (solar/car charging)
    "af": {NAME: "photovoltaic_power"},  # Solar input
    "b0": {NAME: "output_power_total"},  # Combined AC DC output power
    "b3": {NAME: "sw_version", "values": 1},  # Main firmware version
    "b9": {NAME: "sw_expansion", "values": 1},  # Expansion firmware version
    "ba": {NAME: "sw_controller", "values": 1},  # Controller firmware version
    "bd": {NAME: "temperature", SIGNED: True},  # Main device temperature (°C)
    "be": {
        NAME: "exp_1_temperature",
        SIGNED: True,
    },  # Expansion battery 1 temperature (°C)
    "c1": {NAME: "main_battery_soc"},  # Main battery state of charge (%)
    "c2": {NAME: "exp_1_soc"},  # Expansion battery 1 state of charge (%)
    "c3": {NAME: "battery_soh"},  # Main battery state of health (%)
    "c4": {NAME: "exp_1_soh"},  # Expansion battery 1 state of health (%)
    "c5": {NAME: "expansion_packs"},
    "d0": {NAME: "device_sn"},
    "d1": {NAME: "ac_input_limit"},  # Maximum charge setting (W)
    "d2": {
        NAME: "device_timeout_minutes"
    },  # Device auto-off timeout (minutes): 0 (Never), 30, 60, 120, 240, 360, 720, 1440
    "d3": {
        NAME: "display_timeout_seconds"
    },  # Display timeout: 20, 30, 60, 300, 1800 seconds
    "d7": {NAME: "ac_output_power_switch"},  # Disabled (0) or Enabled (1)
    "d8": {NAME: "dc_output_power_switch"},  # Disabled (0) or Enabled (1)
    "d9": {NAME: "display_mode"},  # Brightness: Off (0), Low (1), Medium (2), High (3)
    "da": {NAME: "ac_frequency"},  # 60 / 50 Hz
    "db": {NAME: "energy_saving_mode"},  # Disabled (0) or Enabled (1)
    "dc": {NAME: "light_mode"},  # Off (0), Low (1), Medium (2), High (3), Blinking (4)
    "dd": {NAME: "temp_unit_fahrenheit"},  # Celsius (0) or Fahrenheit (1)
    "de": {NAME: "display_switch"},  # Off (0) or On (1)
    "e5": {NAME: "backup_charge_switch"},  # Off (0) or On (1)
    "f8": {
        BYTES: {
            "00": {
                NAME: "dc_12v_output_mode",  # Normal (1), Smart (2) - auto-off below 3W
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "01": {
                NAME: "ac_output_mode",  # Normal (1), Smart (2) - auto-off when not charging and low power
                TYPE: DeviceHexDataTypes.ui.value,
            },
        }
    },
    "fd": {NAME: "exp_1_type"},  # Expansion battery type identifier
    "fe": {NAME: "msg_timestamp"},  # Message timestamp
}

_A1780_0408 = {
    # F2000(P) state info
    TOPIC: "state_info",
    "a3": {NAME: "device_sn"},
    "a4": {NAME: "local_timestamp"},
    "a5": {NAME: "utc_timestamp"},
    "a6": {NAME: "discharged_energy?", FACTOR: 0.001},  # in kWh
    "a7": {NAME: "charged_energy?", FACTOR: 0.001},  # in kWh
    "ac": {NAME: "main_battery_soc"},  # in %
}

_A1782_0421 = {
    # F3000 param info
    TOPIC: "param_info",
    "a2": {
        BYTES: {
            "01": {
                NAME: "device_sn",
                TYPE: DeviceHexDataTypes.str.value,
            },
            "20": {
                NAME: "device_pn",
                TYPE: DeviceHexDataTypes.str.value,
            },
        }
    },
    "a3": {
        BYTES: {
            "04": {
                NAME: "ac_input_limit_max",  # Max supported charge limit, seems fix
                TYPE: DeviceHexDataTypes.sile.value,
            },
            "07": {
                NAME: "battery_soh?",
                TYPE: DeviceHexDataTypes.ui.value,
            },
        }
    },
    "a4": {
        BYTES: {
            "00": {
                NAME: "ac_output_timeout_seconds",  # disable (0), min:0, max: 86400, step 300
                TYPE: DeviceHexDataTypes.var.value,
                LENGTH: 4,
            },
            "04": {
                NAME: "ac_input_limit",  # AC charge limit: 200-1800 W, step: 100
                TYPE: DeviceHexDataTypes.sile.value,
            },
            "07": {
                NAME: "ac_output_mode",  # Normal (0), Smart (1) - auto-off below 14W
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "08": {
                NAME: "dc_output_timeout_seconds",  # disable (0), min:0, max: 86400, step 300
                TYPE: DeviceHexDataTypes.var.value,
                LENGTH: 4,
            },
            "12": {
                NAME: "dc_12v_output_mode",  # Normal (0), Smart (1) - auto-off below 3W
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "13": {
                NAME: "device_timeout_minutes",  # 0 (Never), 30, 60, 120, 240, 360, 720, 1440
                TYPE: DeviceHexDataTypes.sile.value,
            },
            "15": {
                NAME: "display_timeout_seconds",  # 0 (Never), 10, 30, 60, 300, 1800
                TYPE: DeviceHexDataTypes.sile.value,
            },
            "17": {
                NAME: "display_mode",  # Low (1), Medium (2), High (3)
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "18": {
                NAME: "light_mode",  # Off (0), Low (1), Mid (2), Bright (3)
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "20": {
                NAME: "ac_fast_charge_switch?",  # Ultrafast Charge switch: Disabled (0) or Enabled (1)
            },
            "21": {
                NAME: "display_switch",  # Off (0), On (1)
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "22": {
                NAME: "port_memory_switch",  # Output Port Memory switch: Disabled (0) or Enabled (1)
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "26": {NAME: "region", TYPE: DeviceHexDataTypes.str.value, LENGTH: 2},
        }
    },
    "a5": {
        BYTES: {
            "00": {
                NAME: "temperature",
                SIGNED: True,
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "02": {
                NAME: "battery_soc",
                TYPE: DeviceHexDataTypes.ui.value,
            },
        }
    },
    "a6": {
        BYTES: {
            "00": {
                NAME: "output_power_total",  # Output power total
                TYPE: DeviceHexDataTypes.sile.value,
            },
            "02": {
                NAME: "ac_input_power",  # Input power total charge
                TYPE: DeviceHexDataTypes.sile.value,
            },
        },
    },
    "a7": {
        BYTES: {
            "00": {
                NAME: "ac_output_power_switch",  # Off (0), On (1)
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "01": {
                NAME: "ac_output_power",  # AC Output power
                TYPE: DeviceHexDataTypes.sile.value,
            },
        }
    },
    "a8": {
        BYTES: {
            "00": {
                NAME: "dc_input_power_status?",  # ?  Seems to have a value of 1 when the next field has a non-zero value
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "01": {
                NAME: "dc_input_power?",  # Don't know what this is; seems to be power-input-adjacent.
                TYPE: DeviceHexDataTypes.sile.value,
            },
        }
    },
    "aa": {
        BYTES: {
            "00": {
                NAME: "usbc_1_status",  # USB-C 1 status: Inactive (0), Discharging (1), Charging (2)
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "01": {
                NAME: "usbc_1_power",
                TYPE: DeviceHexDataTypes.sile.value,
            },
        }
    },
    "ab": {
        BYTES: {
            "00": {
                NAME: "usbc_2_status",  # USB-C 2 status: Inactive (0), Discharging (1), Charging (2)
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "01": {
                NAME: "usbc_2_power",
                TYPE: DeviceHexDataTypes.sile.value,
            },
        }
    },
    "ae": {
        BYTES: {
            "00": {
                NAME: "usba_1_status",  # USB-A 1 status: Inactive (0), Discharging (1), Charging (2)
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "01": {
                NAME: "usba_1_power",
                TYPE: DeviceHexDataTypes.sile.value,
            },
        }
    },
    "af": {
        BYTES: {
            "00": {
                NAME: "usba_2_status",  # USB-A 2 status: Inactive (0), Discharging (1), Charging (2)
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "01": {
                NAME: "usba_2_power",
                TYPE: DeviceHexDataTypes.sile.value,
            },
        }
    },
    "b2": {
        BYTES: {
            "00": {
                NAME: "dc_output_power_switch",  # Car Charger Output: Off (0), On (1)
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "01": {
                NAME: "dc_output_power",  # DC 12V output power when enabled
                TYPE: DeviceHexDataTypes.sile.value,
            },
        }
    },
    "c0": {
        BYTES: {
            # Expansion battery 1
            "00": {
                NAME: "exp_1_sn",
                TYPE: DeviceHexDataTypes.str.value,
            },
            "23": {
                NAME: "exp_1_temperature",  # Temperature in °C (signed)
                TYPE: DeviceHexDataTypes.ui.value,
                SIGNED: True,
            },
            "25": {
                NAME: "exp_1_soc",  # State of charge 0-100%
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "32": {
                NAME: "exp_1_type",  # type identifier
                TYPE: DeviceHexDataTypes.str.value,
            },
        }
    },
    "c1": {
        BYTES: {
            # Expansion battery 2
            "00": {
                NAME: "exp_2_sn",
                TYPE: DeviceHexDataTypes.str.value,
            },
            "23": {
                NAME: "exp_2_temperature",  # Temperature in °C (signed)
                TYPE: DeviceHexDataTypes.ui.value,
                SIGNED: True,
            },
            "25": {
                NAME: "exp_2_soc",  # State of charge 0-100%
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "32": {
                NAME: "exp_2_type",  # type identifier
                TYPE: DeviceHexDataTypes.str.value,
            },
        }
    },
    "c2": {
        BYTES: {
            # Expansion battery 3
            "00": {
                NAME: "exp_3_sn",
                TYPE: DeviceHexDataTypes.str.value,
            },
            "23": {
                NAME: "exp_3_temperature",  # Temperature in °C (signed)
                TYPE: DeviceHexDataTypes.ui.value,
                SIGNED: True,
            },
            "25": {
                NAME: "exp_3_soc",  # State of charge 0-100%
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "32": {
                NAME: "exp_3_type",  # type identifier
                TYPE: DeviceHexDataTypes.str.value,
            },
        }
    },
    "d9": {
        BYTES: {
            "03": {
                NAME: "max_soc",  # max_soc: 80, 85, 90, 95, 100 % ?
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "04": {
                NAME: "min_soc",  # min_soc: 1, 5, 10, 15, 20 % ?
                TYPE: DeviceHexDataTypes.ui.value,
            },
        }
    },
    "fd": {NAME: "unknown_fd_timestamp"},
    "fe": {NAME: "msg_timestamp"},
}

_A1782_0502 = {
    # F3000 state info with aggregated energies
    TOPIC: "state_info",
    # "a2": {
    #     BYTES: {
    #         "00": {
    #             NAME: "energy_a2_00",
    #             TYPE: DeviceHexDataTypes.sile.value,
    #             SIGNED: False,
    #         },
    #         "02": {
    #             NAME: "energy_a2_02",
    #             TYPE: DeviceHexDataTypes.sile.value,
    #             SIGNED: False,
    #         },
    #         "04": {
    #             NAME: "energy_a2_04",
    #             TYPE: DeviceHexDataTypes.sile.value,
    #             SIGNED: False,
    #         },
    #         "06": {
    #             NAME: "energy_a2_06",
    #             TYPE: DeviceHexDataTypes.sile.value,
    #             SIGNED: False,
    #         },
    #         "08": {
    #             NAME: "energy_a2_08",
    #             TYPE: DeviceHexDataTypes.sile.value,
    #             SIGNED: False,
    #         },
    #         "10": {
    #             NAME: "energy_a2_10",
    #             TYPE: DeviceHexDataTypes.sile.value,
    #             SIGNED: False,
    #         },
    #         "12": {
    #             NAME: "energy_a2_12",
    #             TYPE: DeviceHexDataTypes.sile.value,
    #             SIGNED: False,
    #         },
    #         "14": {
    #             NAME: "energy_a2_14",
    #             TYPE: DeviceHexDataTypes.sile.value,
    #             SIGNED: False,
    #         },
    #         "16": {
    #             NAME: "energy_a2_16",
    #             TYPE: DeviceHexDataTypes.sile.value,
    #             SIGNED: False,
    #         },
    #         "18": {
    #             NAME: "energy_a2_18",
    #             TYPE: DeviceHexDataTypes.sile.value,
    #             SIGNED: False,
    #         },
    #     }
    # },
    # "a3": {
    #     BYTES: {
    #         "00": {
    #             NAME: "energy_a3_00",
    #             TYPE: DeviceHexDataTypes.sile.value,
    #             SIGNED: False,
    #         },
    #         "02": {
    #             NAME: "energy_a3_02",
    #             TYPE: DeviceHexDataTypes.sile.value,
    #             SIGNED: False,
    #         },
    #         "04": {
    #             NAME: "energy_a3_04",
    #             TYPE: DeviceHexDataTypes.sile.value,
    #             SIGNED: False,
    #         },
    #         "06": {
    #             NAME: "energy_a3_06",
    #             TYPE: DeviceHexDataTypes.sile.value,
    #             SIGNED: False,
    #         },
    #         "08": {
    #             NAME: "energy_a3_08",
    #             TYPE: DeviceHexDataTypes.sile.value,
    #             SIGNED: False,
    #         },
    #         "10": {
    #             NAME: "energy_a3_10",
    #             TYPE: DeviceHexDataTypes.sile.value,
    #             SIGNED: False,
    #         },
    #     }
    # },
    # "a4": {
    #     BYTES: {
    #         "00": {
    #             NAME: "energy_a4_00",
    #             TYPE: DeviceHexDataTypes.sile.value,
    #             SIGNED: False,
    #         },
    #         "02": {
    #             NAME: "energy_a4_02",
    #             TYPE: DeviceHexDataTypes.sile.value,
    #             SIGNED: False,
    #         },
    #         "04": {
    #             NAME: "energy_a4_04",
    #             TYPE: DeviceHexDataTypes.sile.value,
    #             SIGNED: False,
    #         },
    #         "06": {
    #             NAME: "energy_a4_06",
    #             TYPE: DeviceHexDataTypes.sile.value,
    #             SIGNED: False,
    #         },
    #         "08": {
    #             NAME: "energy_a4_08",
    #             TYPE: DeviceHexDataTypes.sile.value,
    #             SIGNED: False,
    #         },
    #         "10": {
    #             NAME: "energy_a4_10",
    #             TYPE: DeviceHexDataTypes.sile.value,
    #             SIGNED: False,
    #         },
    #         "12": {
    #             NAME: "energy_a4_12",
    #             TYPE: DeviceHexDataTypes.sile.value,
    #             SIGNED: False,
    #         },
    #     }
    # },
    # "a5": {
    #     BYTES: {
    #         "00": {
    #             NAME: "energy_a5_00",
    #             TYPE: DeviceHexDataTypes.sile.value,
    #             SIGNED: False,
    #         },
    #         "02": {
    #             NAME: "energy_a5_02",
    #             TYPE: DeviceHexDataTypes.sile.value,
    #             SIGNED: False,
    #         },
    #         "04": {
    #             NAME: "energy_a5_04",
    #             TYPE: DeviceHexDataTypes.sile.value,
    #             SIGNED: False,
    #         },
    #         "06": {
    #             NAME: "energy_a5_06",
    #             TYPE: DeviceHexDataTypes.sile.value,
    #             SIGNED: False,
    #         },
    #         "08": {
    #             NAME: "energy_a5_08",
    #             TYPE: DeviceHexDataTypes.sile.value,
    #             SIGNED: False,
    #         },
    #         "10": {
    #             NAME: "energy_a5_10",
    #             TYPE: DeviceHexDataTypes.sile.value,
    #             SIGNED: False,
    #         },
    #         "12": {
    #             NAME: "energy_a5_12",
    #             TYPE: DeviceHexDataTypes.sile.value,
    #             SIGNED: False,
    #         },
    #         "14": {
    #             NAME: "energy_a5_14",
    #             TYPE: DeviceHexDataTypes.sile.value,
    #             SIGNED: False,
    #         },
    #         "16": {
    #             NAME: "energy_a5_16",
    #             TYPE: DeviceHexDataTypes.sile.value,
    #             SIGNED: False,
    #         },
    #     }
    # },
    # "a6": {
    #     BYTES: {
    #         "00": {
    #             NAME: "energy_a6_00",
    #             TYPE: DeviceHexDataTypes.sile.value,
    #             SIGNED: False,
    #         },
    #         "02": {
    #             NAME: "energy_a6_02",
    #             TYPE: DeviceHexDataTypes.sile.value,
    #             SIGNED: False,
    #         },
    #         "04": {
    #             NAME: "energy_a6_04",
    #             TYPE: DeviceHexDataTypes.sile.value,
    #             SIGNED: False,
    #         },
    #         "06": {
    #             NAME: "energy_a6_06",
    #             TYPE: DeviceHexDataTypes.sile.value,
    #             SIGNED: False,
    #         },
    #         "08": {
    #             NAME: "energy_a6_08",
    #             TYPE: DeviceHexDataTypes.sile.value,
    #             SIGNED: False,
    #         },
    #         "10": {
    #             NAME: "energy_a6_10",
    #             TYPE: DeviceHexDataTypes.sile.value,
    #             SIGNED: False,
    #         },
    #         "12": {
    #             NAME: "energy_a6_12",
    #             TYPE: DeviceHexDataTypes.sile.value,
    #             SIGNED: False,
    #         },
    #         "14": {
    #             NAME: "energy_a6_14",
    #             TYPE: DeviceHexDataTypes.sile.value,
    #             SIGNED: False,
    #         },
    #         "16": {
    #             NAME: "energy_a6_16",
    #             TYPE: DeviceHexDataTypes.sile.value,
    #             SIGNED: False,
    #         },
    #     }
    # },
    "fd": {NAME: "local_timestamp"},
    "fe": {NAME: "msg_timestamp"},
}

_A1790_0405 = {
    # F3800 param info
    TOPIC: "param_info",
    "a4": {NAME: "remaining_time_hours", FACTOR: 0.1, SIGNED: False},  # In hours
    "a5": {NAME: "ac_input_power"},
    "a6": {NAME: "ac_output_power"},
    "a7": {NAME: "usbc_1_power"},
    "a8": {NAME: "usbc_2_power"},
    "a9": {NAME: "usbc_3_power"},
    "aa": {NAME: "usba_1_power?"},
    "ab": {NAME: "usba_2_power?"},
    "ac": {NAME: "dc_12v_output_power_switch?"},
    "ad": {NAME: "main_battery_soc"},  # Main battery SOC?
    "ae": {NAME: "photovoltaic_power"},  # Total solar input
    "af": {NAME: "pv_1_power"},
    "b0": {NAME: "pv_2_power"},
    "b1": {NAME: "bat_charge_power"},  # Total charging (AC + Solar)
    "b2": {NAME: "output_power_total"},  # Combined AC DC output power
    "b4": {NAME: "bat_discharge_power?"},
    "b5": {NAME: "sw_version"},  # Main firmware version
    "ba": {NAME: "sw_expansion"},  # Expansion firmware version
    "bb": {NAME: "sw_controller"},
    "bc": {
        NAME: "ac_output_power_switch"
    },  # AC output switch: Disabled (0) or Enabled (1)
    "bd": {
        NAME: "charging_status",  # Publishes the raw integer value (0-3): Inactive (0), Solar (1), AC Input (2), Both (3)
    },
    "be": {NAME: "temperature", SIGNED: True},  # In Celsius
    "bf": {NAME: "display_status"},  # Asleep (0), Manual Off (1), On (2)
    "c0": {NAME: "battery_soc"},  # Total SOC of main + Exp batteries?
    "c1": {NAME: "battery_soh"},
    # TODO: What does USB status mean, is that a toggle setting? If port is used, this should be indicated by power as well
    "c2": {NAME: "usbc_1_status"},
    "c3": {NAME: "usbc_2_status"},
    "c4": {NAME: "usbc_3_status"},
    "c5": {NAME: "usba_1_status?"},
    "c6": {NAME: "usba_2_status?"},
    "c7": {
        NAME: "dc_output_power_switch"
    },  # 12V DC output switch: Disabled (0) or Enabled (1)
    "cc": {NAME: "device_sn"},
    "cd": {NAME: "ac_input_limit"},  # AC charge limit: 200-1800 W, step: 100
    "ce": {
        NAME: "device_timeout_minutes"
    },  # Device auto-off timeout (minutes): 0 (Never), 30, 60, 120, 240, 360, 720, 1440
    "cf": {NAME: "display_timeout_seconds"},  # User Setting (in seconds)
    "d3": {NAME: "ac_output_power_switch_dup?"},  # Duplicate of bc?
    "d4": {NAME: "dc_output_power_switch_dup?"},  # Duplicate of c7?
    "d5": {
        NAME: "display_mode"
    },  # Display brightness: Off (0), Low (1), Medium (2), High (3)
    "d6": {NAME: "ac_frequency"},  # 60 / 50 Hz
    "d8": {
        NAME: "temp_unit_fahrenheit"
    },  # Temperature unit: Celsius (0) or Fahrenheit (1)
    "d9": {
        NAME: "light_mode"
    },  # LED light mode: Off (0), Low (1), Medium (2), High (3), Blinking (4)
    "e6": {NAME: "ac_input_limit_max"},  # Maximum value for control
    "f6": {
        # sile type that contains 2 chars
        BYTES: {
            "00": {
                NAME: "region",
                TYPE: DeviceHexDataTypes.str.value,
                LENGTH: 2,
            },  # Value 21333 ("US")
        }
    },
    "f7": {
        NAME: "port_memory_switch"
    },  # Port Memory switch: Disabled (0) or Enabled (1)
    "fd": {NAME: "exp_1_type"},  # Expansion battery type identifier
    "fe": {NAME: "msg_timestamp"},
}

_A1790_040a = {
    # F3800 param info
    TOPIC: "param_info",
    "a2": {NAME: "expansion_packs?"},
    "a3": {NAME: "main_battery_soc?"},  # main battery SOC
    "a4": {
        BYTES: {
            "00": {
                NAME: "exp_1_sn?",
                LENGTH: 16,
                TYPE: DeviceHexDataTypes.str.value,
            },
            "19": {
                NAME: "exp_1_temperature?",
                TYPE: DeviceHexDataTypes.ui.value,
                SIGNED: True,
            },
            "21": {
                NAME: "exp_1_soc?",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "22": {
                NAME: "exp_1_soh?",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "28": {
                NAME: "exp_1_type",
                LENGTH: 10,
                TYPE: DeviceHexDataTypes.str.value,
            },
        }
    },
    "a5": {
        BYTES: {
            "00": {
                NAME: "exp_2_sn?",
                LENGTH: 16,
                TYPE: DeviceHexDataTypes.str.value,
            },
            "19": {
                NAME: "exp_2_temperature?",
                TYPE: DeviceHexDataTypes.ui.value,
                SIGNED: True,
            },
            "21": {
                NAME: "exp_2_soc?",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "22": {
                NAME: "exp_2_soh?",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "28": {
                NAME: "exp_2_type",
                LENGTH: 10,
                TYPE: DeviceHexDataTypes.str.value,
            },
        }
    },
    "a6": {
        BYTES: {
            "00": {
                NAME: "exp_3_sn?",
                LENGTH: 16,
                TYPE: DeviceHexDataTypes.str.value,
            },
            "19": {
                NAME: "exp_3_temperature?",
                TYPE: DeviceHexDataTypes.ui.value,
                SIGNED: True,
            },
            "21": {
                NAME: "exp_3_soc?",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "22": {
                NAME: "exp_3_soh?",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "28": {
                NAME: "exp_3_type",
                LENGTH: 10,
                TYPE: DeviceHexDataTypes.str.value,
            },
        }
    },
    "a7": {
        BYTES: {
            "00": {
                NAME: "exp_4_sn?",
                LENGTH: 16,
                TYPE: DeviceHexDataTypes.str.value,
            },
            "19": {
                NAME: "exp_4_temperature?",
                TYPE: DeviceHexDataTypes.ui.value,
                SIGNED: True,
            },
            "21": {
                NAME: "exp_4_soc?",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "22": {
                NAME: "exp_4_soh?",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "28": {
                NAME: "exp_4_type",
                LENGTH: 10,
                TYPE: DeviceHexDataTypes.str.value,
            },
        }
    },
    "a8": {
        BYTES: {
            "00": {
                NAME: "exp_5_sn?",
                LENGTH: 16,
                TYPE: DeviceHexDataTypes.str.value,
            },
            "19": {
                NAME: "exp_5_temperature?",
                TYPE: DeviceHexDataTypes.ui.value,
                SIGNED: True,
            },
            "21": {
                NAME: "exp_5_soc?",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "22": {
                NAME: "exp_5_soh?",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "28": {
                NAME: "exp_5_type",
                LENGTH: 10,
                TYPE: DeviceHexDataTypes.str.value,
            },
        }
    },
    "a9": {
        BYTES: {
            "00": {
                NAME: "exp_6_sn?",
                LENGTH: 16,
                TYPE: DeviceHexDataTypes.str.value,
            },
            "19": {
                NAME: "exp_6_temperature?",
                TYPE: DeviceHexDataTypes.ui.value,
                SIGNED: True,
            },
            "21": {
                NAME: "exp_6_soc?",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "22": {
                NAME: "exp_6_soh?",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "28": {
                NAME: "exp_6_type",
                LENGTH: 10,
                TYPE: DeviceHexDataTypes.str.value,
            },
        }
    },
    "fe": {NAME: "msg_timestamp"},
}

_A1790_0410 = {
    # F3800 param info
    TOPIC: "param_info",
    "a2": {
        BYTES: {
            "00": {
                NAME: "power_panel_sn?",
                LENGTH: 16,
                TYPE: DeviceHexDataTypes.str.value,
            },
        }
    },
    "a3": {
        BYTES: {
            "00": {
                NAME: "device_1_sn?",
                LENGTH: 16,
                TYPE: DeviceHexDataTypes.str.value,
            },
            "19": {
                NAME: "device_1_soc?",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "20": {
                NAME: "device_1_temperature?",
                SIGNED: True,
                TYPE: DeviceHexDataTypes.ui.value,
            },
        }
    },
    "a4": {
        BYTES: {
            "00": {
                NAME: "device_2_sn?",
                LENGTH: 16,
                TYPE: DeviceHexDataTypes.str.value,
            },
            "19": {
                NAME: "device_2_soc?",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "20": {
                NAME: "device_2_temperature?",
                SIGNED: True,
                TYPE: DeviceHexDataTypes.ui.value,
            },
        }
    },
    "a5": {NAME: "device_1_pn?"},
    "a6": {NAME: "device_2_pn?"},
    "fe": {NAME: "msg_timestamp"},
}

_A1790_0804 = {
    # F3800 param info
    TOPIC: "param_info",
}

_0407 = {
    # Network message
    TOPIC: "state_info",
    "a2": {NAME: "device_sn"},
    "a3": {NAME: "wifi_name"},
    "a4": {NAME: "wifi_signal"},
}

_PPS_0407 = _0407 | {
    # PPS network message
    "a6": {NAME: "ac_input_limit"},
}

_A17C0_0407 = _0407 | {
    # Solarbank network message
    "a5": {NAME: "charging_status"},
}

_A17C1_0405 = {
    # Solarbank 2 param info
    TOPIC: "param_info",
    "a2": {NAME: "device_sn"},
    "a3": {NAME: "main_battery_soc"},  # controller battery only
    "a5": {NAME: "error_code"},
    "a6": {NAME: "sw_version", "values": 4},
    "a7": {NAME: "sw_controller?", "values": 4},
    "a8": {NAME: "sw_expansion", "values": 4},
    "a9": {NAME: "temp_unit_fahrenheit"},
    "aa": {NAME: "temperature", SIGNED: True},
    "ab": {NAME: "photovoltaic_power", FACTOR: 0.1},
    "ac": {NAME: "ac_output_power", FACTOR: 0.1},
    "ad": {NAME: "battery_soc"},  # controller + expansions avg
    "b0": {NAME: "bat_charge_power", FACTOR: 0.01},
    "b1": {NAME: "pv_yield", FACTOR: 0.0001},
    "b3": {NAME: "output_energy", FACTOR: 0.0001},
    "b2": {NAME: "charged_energy", FACTOR: 0.00001},
    "b4": {NAME: "output_cutoff_data"},
    "b5": {NAME: "lowpower_input_data"},
    "b6": {NAME: "input_cutoff_data"},
    "b7": {NAME: "bat_discharge_power", FACTOR: 0.01},
    "bc": {NAME: "grid_to_home_power", FACTOR: 0.1},
    "bd": {NAME: "pv_to_grid_power", FACTOR: 0.1},
    "be": {NAME: "grid_import_energy", FACTOR: 0.0001},
    "bf": {NAME: "grid_export_energy", FACTOR: 0.0001},
    "c2": {NAME: "max_load"},
    "c4": {NAME: "home_demand", FACTOR: 0.1},
    "c6": {NAME: "usage_mode"},
    "c7": {NAME: "home_load_preset"},
    "c8": {NAME: "ac_socket_power", FACTOR: 0.1},
    "c9": {NAME: "consumed_energy", FACTOR: 0.0001},
    "ca": {NAME: "pv_1_power", FACTOR: 0.1},
    "cb": {NAME: "pv_2_power", FACTOR: 0.1},
    "cc": {NAME: "pv_3_power", FACTOR: 0.1},
    "cd": {NAME: "pv_4_power", FACTOR: 0.1},
    "d2": {NAME: "light_mode"},  # Normal mode (0) or Mood mode (1)
    "d3": {NAME: "output_power", FACTOR: 0.1},
    "e0": {NAME: "grid_status"},  # Grid OK (1), No grid (6), Grid connecting (3)
    "e1": {NAME: "light_off_switch"},  # Light on (0), Light off (1)
    "e8": {NAME: "battery_heating"},  # Not heating (1), heating (3)
    "fb": {
        BYTES: {
            "00": [{NAME: "grid_export_disabled", MASK: 0x01}],
        }
    },
    "fe": {NAME: "msg_timestamp"},
    # "ab": {NAME: "photovoltaic_power"},
    # "ac": {NAME: "battery_power_signed"},
    # "ae": {NAME: "ac_output_power_signed?"},
    # "b2": {NAME: "discharged_energy?"},
    # "ba": {
    #     BYTES: {
    #         "00": [
    #             {NAME: "light_mode", MASK: 0x40}, # Normal mode (0) or Mood mode (1)
    #             {NAME: "light_off_switch", MASK: 0x20}, # Enable (0) or disable (1) LEDs
    #             {NAME: "ac_socket_switch", MASK: 0x08}, # Disable (0) or enable (1) AC socket
    #             {NAME: "temp_unit_fahrenheit", MASK: 0x01},  # Toggle °C(0) or F(1) unit, this does not change temperature value itself
    #         ],
    #     }
    # },
    # "bb": {NAME: "heating_power"},
    # "bc": {NAME: "grid_to_battery_power?"},
    # "be": {NAME: "max_load_legal"},
    # "x1": {NAME: "photovoltaic_power"},
    # "c4": {NAME: "grid_power_signed"},
    # "c5": {NAME: "home_demand"},
}

_A17C1_0408 = {
    # Solarbank 2 state info
    TOPIC: "state_info",
    "a2": {NAME: "device_sn"},
    "a3": {NAME: "local_timestamp"},
    "a4": {NAME: "utc_timestamp"},
    "a8": {NAME: "charging_status"},
    # "af": {
    #     BYTES: {
    #         "00": [
    #             {NAME: "light_mode", MASK: 0x40}, # Normal mode (0) or Mood mode (1)
    #             {NAME: "light_off_switch", MASK: 0x20}, # Enable (0) or disable (1) LEDs
    #             {NAME: "ac_socket_switch", MASK: 0x08},  # Disable (0) or enable (1) AC socket
    #             {NAME: "temp_unit_fahrenheit", MASK: 0x01},  # Toggle °C(0) or F(1) unit, this does not change temperature value itself
    #         ],
    #     }
    # },
    "b0": {NAME: "battery_soc"},
    "b6": {NAME: "temperature", SIGNED: True},
    "b7": {NAME: "usage_mode?"},
    "b8": {NAME: "home_load_preset"},
    "bb": {NAME: "ac_input_power?"},
    "c0": {NAME: "discharge_power?"},
    "c1": {NAME: "ac_output_power?", FACTOR: 0.1},
    "c3": {NAME: "grid_import_energy", FACTOR: 0.0001},
    "c4": {NAME: "grid_export_energy", FACTOR: 0.0001},
    "c8": {NAME: "home_demand", FACTOR: 0.1},
    "ce": {NAME: "pv_1_power"},
    "cf": {NAME: "pv_2_power"},
    "d0": {NAME: "pv_3_power"},
    "d1": {NAME: "pv_4_power"},
    # "ab": {NAME: "photovoltaic_power"},
    # "ac": {NAME: "pv_yield?"},
    # "b1": {NAME: "unknown_power_2?"},
    # "b2": {NAME: "home_consumption"},
    # "b6": {NAME: "unknown_power_3?"},
    # "b7": {NAME: "charged_energy?"},
    # "b8": {NAME: "discharged_energy?"},
    # "be": {NAME: "grid_import_energy"},
    # "bf": {NAME: "unknown_energy_5?"},
    # "d3": {NAME: "unknown_power_6?"},
    # "d6": {NAME: "timestamp_1?"},
    # "dc": {NAME: "max_load"},
    # "e0": {NAME: "min_soc?"},
    # "e1": {NAME: "max_soc?"},
    # "e2": {NAME: "pv_power_3rd_party?"},
    # "e6": {NAME: "pv_limit"},
    # "e7": {NAME: "ac_input_limit"},
}

_A17C1_040a = {
    # Solarbank 2 Expansion data
    TOPIC: "param_info",
    "a2": {NAME: "expansion_packs"},
    "a3": {NAME: "main_battery_soc"},  # main battery SOC
    "a4": {
        BYTES: {
            "00": {
                NAME: "exp_1_controller_sn?",
                LENGTH: 17,
                TYPE: DeviceHexDataTypes.str.value,
            },
            "17": {
                NAME: "separator?",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "18": {
                NAME: "exp_1_position?",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "19": {
                NAME: "exp_1_temperature",
                TYPE: DeviceHexDataTypes.ui.value,
                SIGNED: True,
            },
            "20": {
                NAME: "separator?",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "21": {
                NAME: "exp_1_soc",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "22": {
                NAME: "exp_1_soh",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "27": {
                NAME: "exp_1_sn",
                LENGTH: 17,
                TYPE: DeviceHexDataTypes.str.value,
            },
            "44": {
                NAME: "end_marker?",
                TYPE: DeviceHexDataTypes.ui.value,
            },
        }
    },
    "a5": {
        BYTES: {
            "00": {
                NAME: "exp_2_controller_sn?",
                LENGTH: 17,
                TYPE: DeviceHexDataTypes.str.value,
            },
            "17": {
                NAME: "separator?",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "18": {
                NAME: "exp_2_position?",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "19": {
                NAME: "exp_2_temperature",
                TYPE: DeviceHexDataTypes.ui.value,
                SIGNED: True,
            },
            "20": {
                NAME: "separator?",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "21": {
                NAME: "exp_2_soc",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "22": {
                NAME: "exp_2_soh",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "27": {
                NAME: "exp_2_sn",
                LENGTH: 17,
                TYPE: DeviceHexDataTypes.str.value,
            },
            "44": {
                NAME: "end_marker?",
                TYPE: DeviceHexDataTypes.ui.value,
            },
        }
    },
    "a6": {
        BYTES: {
            "00": {
                NAME: "exp_3_controller_sn?",
                LENGTH: 17,
                TYPE: DeviceHexDataTypes.str.value,
            },
            "17": {
                NAME: "separator?",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "18": {
                NAME: "exp_3_position?",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "19": {
                NAME: "exp_3_temperature",
                TYPE: DeviceHexDataTypes.ui.value,
                SIGNED: True,
            },
            "20": {
                NAME: "separator?",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "21": {
                NAME: "exp_3_soc",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "22": {
                NAME: "exp_3_soh",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "27": {
                NAME: "exp_3_sn",
                LENGTH: 17,
                TYPE: DeviceHexDataTypes.str.value,
            },
            "44": {
                NAME: "end_marker?",
                TYPE: DeviceHexDataTypes.ui.value,
            },
        }
    },
    "a7": {
        BYTES: {
            "00": {
                NAME: "exp_4_controller_sn?",
                LENGTH: 17,
                TYPE: DeviceHexDataTypes.str.value,
            },
            "17": {
                NAME: "separator?",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "18": {
                NAME: "exp_4_position?",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "19": {
                NAME: "exp_4_temperature",
                TYPE: DeviceHexDataTypes.ui.value,
                SIGNED: True,
            },
            "20": {
                NAME: "separator?",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "21": {
                NAME: "exp_4_soc",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "22": {
                NAME: "exp_4_soh",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "27": {
                NAME: "exp_4_sn",
                LENGTH: 17,
                TYPE: DeviceHexDataTypes.str.value,
            },
            "44": {
                NAME: "end_marker?",
                TYPE: DeviceHexDataTypes.ui.value,
            },
        }
    },
    "a8": {
        BYTES: {
            "00": {
                NAME: "exp_5_controller_sn?",
                LENGTH: 17,
                TYPE: DeviceHexDataTypes.str.value,
            },
            "17": {
                NAME: "separator?",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "18": {
                NAME: "exp_5_position?",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "20": {
                NAME: "separator?",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "19": {
                NAME: "exp_5_temperature",
                TYPE: DeviceHexDataTypes.ui.value,
                SIGNED: True,
            },
            "21": {
                NAME: "exp_5_soc",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "22": {
                NAME: "exp_5_soh",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "27": {
                NAME: "exp_5_sn",
                LENGTH: 17,
                TYPE: DeviceHexDataTypes.str.value,
            },
            "44": {
                NAME: "end_marker?",
                TYPE: DeviceHexDataTypes.ui.value,
            },
        }
    },
    "fe": {NAME: "msg_timestamp"},
}

_A17C5_0405 = {
    # Solarbank 3 param info
    TOPIC: "param_info",
    "a2": {NAME: "device_sn"},
    "a3": {NAME: "main_battery_soc"},
    "a5": {NAME: "temperature", SIGNED: True},
    "a6": {NAME: "battery_soc"},
    "a7": {NAME: "sw_version", "values": 4},
    "a8": {NAME: "sw_controller?", "values": 4},
    "a9": {NAME: "sw_expansion", "values": 4},
    "ab": {NAME: "photovoltaic_power"},
    "ac": {NAME: "battery_power_signed"},
    "ad": {NAME: "output_power"},
    "ae": {NAME: "ac_output_power_signed"},
    "b0": {NAME: "pv_yield"},
    "b1": {NAME: "charged_energy"},
    "b2": {NAME: "discharged_energy"},
    "b3": {NAME: "output_energy"},
    "b4": {NAME: "consumed_energy"},
    "b5": {NAME: "min_soc"},
    "b6": {NAME: "min_soc_exp_1?"},  # Could also be min SOC of Main battery?
    "b7": {
        NAME: "min_soc_exp_2?"
    },  # Could also be min SOC of first Expansion? But why no other expansion SOC in this message?
    "b8": {NAME: "usage_mode"},
    "b9": {NAME: "home_load_preset"},
    "ba": {
        BYTES: {
            "00": [
                {
                    NAME: "light_mode",
                    MASK: 0x40,
                },  # Normal mode (0) or Mood mode (1)
                {
                    NAME: "light_off_switch",
                    MASK: 0x20,
                },  # Enable (0) or disable (1) LEDs
                {
                    NAME: "ac_socket_switch",
                    MASK: 0x08,
                },  # Disable (0) or enable (1) AC socket
                {
                    NAME: "temp_unit_fahrenheit",
                    MASK: 0x01,
                },  # Toggle °C (0) or F (1) unit, this does not change temperature value itself
            ],
        }
    },
    "bb": {NAME: "heating_power"},
    "bc": {NAME: "grid_to_battery_power"},
    "bd": {NAME: "max_load"},
    "be": {NAME: "max_load_legal"},
    "bf": {NAME: "backup_start_timestamp"},
    "c0": {NAME: "backup_end_timestamp"},
    "c2": {NAME: "photovoltaic_power?"},
    "c4": {NAME: "grid_power_signed"},
    "c5": {NAME: "home_demand"},
    "c6": {NAME: "pv_1_power"},
    "c7": {NAME: "pv_2_power"},
    "c8": {NAME: "pv_3_power"},
    "c9": {NAME: "pv_4_power"},
    "cb": {NAME: "expansion_packs"},
    "d4": {
        NAME: "device_timeout_minutes",
        FACTOR: 30,
    },  # timeout in 30 min chunks: 0, 30, 60, 120, 240, 360, 720, 1440 minutes
    "d5": {NAME: "pv_limit"},
    "d6": {NAME: "ac_input_limit"},
    "fb": {
        BYTES: {
            "00": [{NAME: "grid_export_disabled", MASK: 0x01}],
        }
    },
    "fe": {NAME: "msg_timestamp"},
}

_A17C5_0408 = {
    # Solarbank 3 state info
    TOPIC: "state_info",
    "a2": {NAME: "device_sn"},
    "a3": {NAME: "local_timestamp"},
    "a4": {NAME: "utc_timestamp"},
    "a5": {NAME: "battery_soc_calc", FACTOR: 0.1},
    "a6": {NAME: "battery_soh", FACTOR: 0.1},
    "a7": {NAME: "battery_soc"},
    "a9": {NAME: "usage_mode"},
    "a8": {NAME: "charging_status?"},
    "aa": {NAME: "home_load_preset"},
    "ab": {NAME: "photovoltaic_power"},
    "ac": {NAME: "pv_yield"},
    # "ad": {NAME: "pv_1_energy?"},
    # "ae": {NAME: "pv_2_energy?"},
    # "af": {NAME: "pv_3_energy?"},
    # "b0": {NAME: "pv_4_energy?"},
    "b1": {NAME: "home_demand"},
    "b2": {NAME: "home_consumption"},
    "b6": {NAME: "battery_power_signed?"},
    "b7": {NAME: "charged_energy"},
    "b8": {NAME: "discharged_energy"},
    "bd": {NAME: "grid_power_signed?"},
    "be": {NAME: "grid_import_energy"},
    "bf": {NAME: "grid_export_energy"},
    "c7": {NAME: "pv_1_power"},
    "c8": {NAME: "pv_2_power"},
    "c9": {NAME: "pv_3_power"},
    "ca": {NAME: "pv_4_power"},
    "d3": {NAME: "ac_output_power"},
    "d5": {NAME: "grid_to_home_power"},
    "d6": {NAME: "timestamp_1?"},
    "dc": {NAME: "max_load"},
    "dd": {NAME: "ac_input_limit"},
    # "de": {NAME: "output_energy"},
    "e0": {NAME: "min_soc"},
    "e1": {NAME: "max_soc?"},
    "e6": {NAME: "pv_limit"},
    "e7": {NAME: "ac_input_limit"},
    "cc": {NAME: "temperature", SIGNED: True},
}

_A17C5_040a = (
    _A17C1_040a
    | {
        # Additional/different Solarbank 3 Expansion data?
    }
)

_A17E1_040a = {
    # Home Backup System E10 Expansion data
    TOPIC: "param_info",
    "a2": {NAME: "expansion_packs"},
    "a3": {NAME: "battery_soc"},  # battery SOC
    "a4": {
        BYTES: {
            "00": {
                NAME: "exp_1_sn",
                LENGTH: 17,
                TYPE: DeviceHexDataTypes.str.value,
            },
            "17": {
                NAME: "separator?",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "21": {
                NAME: "separator?",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "26": {
                NAME: "exp_1_temperature",
                TYPE: DeviceHexDataTypes.ui.value,
                SIGNED: True,
            },
            "28": {
                NAME: "exp_1_soc",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "29": {
                NAME: "exp_1_soh",
                TYPE: DeviceHexDataTypes.ui.value,
            },
        }
    },
    "a5": {
        BYTES: {
            "00": {
                NAME: "exp_2_sn",
                LENGTH: 17,
                TYPE: DeviceHexDataTypes.str.value,
            },
            "17": {
                NAME: "separator?",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "21": {
                NAME: "separator?",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "26": {
                NAME: "exp_2_temperature",
                TYPE: DeviceHexDataTypes.ui.value,
                SIGNED: True,
            },
            "28": {
                NAME: "exp_2_soc",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "29": {
                NAME: "exp_2_soh",
                TYPE: DeviceHexDataTypes.ui.value,
            },
        }
    },
    "a6": {
        BYTES: {
            "00": {
                NAME: "exp_3_sn",
                LENGTH: 17,
                TYPE: DeviceHexDataTypes.str.value,
            },
            "17": {
                NAME: "separator?",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "21": {
                NAME: "separator?",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "26": {
                NAME: "exp_3_temperature",
                TYPE: DeviceHexDataTypes.ui.value,
                SIGNED: True,
            },
            "28": {
                NAME: "exp_3_soc",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "29": {
                NAME: "exp_3_soh",
                TYPE: DeviceHexDataTypes.ui.value,
            },
        }
    },
    "a7": {
        BYTES: {
            "00": {
                NAME: "exp_4_sn",
                LENGTH: 17,
                TYPE: DeviceHexDataTypes.str.value,
            },
            "17": {
                NAME: "separator?",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "21": {
                NAME: "separator?",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "26": {
                NAME: "exp_4_temperature",
                TYPE: DeviceHexDataTypes.ui.value,
                SIGNED: True,
            },
            "28": {
                NAME: "exp_4_soc",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "29": {
                NAME: "exp_4_soh",
                TYPE: DeviceHexDataTypes.ui.value,
            },
        }
    },
    "a8": {
        BYTES: {
            "00": {
                NAME: "exp_5_sn",
                LENGTH: 17,
                TYPE: DeviceHexDataTypes.str.value,
            },
            "17": {
                NAME: "separator?",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "21": {
                NAME: "separator?",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "26": {
                NAME: "exp_5_temperature",
                TYPE: DeviceHexDataTypes.ui.value,
                SIGNED: True,
            },
            "28": {
                NAME: "exp_5_soc",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "29": {
                NAME: "exp_5_soh",
                TYPE: DeviceHexDataTypes.ui.value,
            },
        }
    },
    "fe": {NAME: "msg_timestamp"},
}

_AX170_0405 = {
    # AX170 Power dock for home backup systems A17E1
    TOPIC: "param_info",
    "a2": {NAME: "device_sn"},
    "a6": {NAME: "battery_soc_total"},  # Average SOC of all devices in system
    "ab": {
        NAME: "pv_power_total"
    },  # Total PV power from all devices in system? Only verified with 1 E10 Module
    "ac": {
        NAME: "battery_power_signed_total"
    },  # Power draw from battery. Negative is charging, positive is discharging.
    "b5": {
        NAME: "backup_soc"
    },  # Minimum Self Consumption reserve %, Not overall reserve. Battery will stay above this level, unless grid fault.
    "b7": {NAME: "max_soc?"},  # Maybe battery health??
    "b9": {
        NAME: "main_breaker_limit?"
    },  # It's 200 on tests, so its a good chance its the 200AMP?
    "bf": {NAME: "timestamp_0405_bf?"},
    "c0": {NAME: "timestamp_0405_c0?"},
    "c3": {
        NAME: "use_time_band?"
    },  # use_time_band: 1=peak, 2=mid-peak, 3=off-peak, 4=super-off-peak
    "c4": {NAME: "grid_power_signed"},  # positive=import, negative=export
    "c5": {NAME: "ac_output_power?"},
    "cc": {
        BYTES: {
            "00": {
                NAME: "powerdock_state_code_1",
                TYPE: DeviceHexDataTypes.ui.value,
            },  # Not very reliable, not sure what the setting is exactly.
            "01": {
                NAME: "powerdock_charging_status",
                TYPE: DeviceHexDataTypes.ui.value,
            },  # 32 idle, 48 = charging, 64 = discharging, Is this only a upper half byte usage?
        }
    },
    "cd": {NAME: "home_demand_total"},
    "ce": {NAME: "generator_plug_status"},
    "d4": {NAME: "pv_power_3rd_party"},  # Power from external solar to home?
    "d6": {NAME: "generator_power"},  # Power from external DC generator
    "dd": {NAME: "display_timeout_seconds"},
    "de": {
        NAME: "max_load_limit_total?"
    },  # shows 4800 in monitoring. Not sure what this is.
    "e4": {
        BYTES: {
            "00": {
                NAME: "home_demand_circuit_01",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "04": {
                NAME: "home_demand_circuit_02",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "08": {
                NAME: "home_demand_circuit_03",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "12": {
                NAME: "home_demand_circuit_04",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "16": {
                NAME: "home_demand_circuit_05",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "20": {
                NAME: "home_demand_circuit_06",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "24": {
                NAME: "home_demand_circuit_07",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "28": {
                NAME: "home_demand_circuit_08",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "32": {
                NAME: "home_demand_circuit_09",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "36": {
                NAME: "home_demand_circuit_10",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "40": {
                NAME: "home_demand_circuit_11",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "44": {
                NAME: "home_demand_circuit_12",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
        }
    },
    "e8": {
        BYTES: {
            "00": {
                NAME: "device_1_pn",
                TYPE: DeviceHexDataTypes.str.value,
            },
            "11": {
                NAME: "device_1_sn",
                TYPE: DeviceHexDataTypes.str.value,
            },
            "41": {
                NAME: "device_1_soc",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "42": {
                NAME: "device_1_pv_1_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "45": {
                NAME: "device_1_pv_2_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "57": {
                NAME: "device_1_ac_output_power_signed",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
        }
    },
    "e9": {
        BYTES: {
            "00": {
                NAME: "device_2_pn",
                TYPE: DeviceHexDataTypes.str.value,
            },
            "11": {
                NAME: "device_2_sn",
                TYPE: DeviceHexDataTypes.str.value,
            },
            "41": {
                NAME: "device_2_soc",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "42": {
                NAME: "device_2_pv_1_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "45": {
                NAME: "device_2_pv_2_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "57": {
                NAME: "device_2_ac_output_power_signed",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
        }
    },
    "ea": {
        BYTES: {
            "00": {
                NAME: "device_3_pn",
                TYPE: DeviceHexDataTypes.str.value,
            },
            "11": {
                NAME: "device_3_sn",
                TYPE: DeviceHexDataTypes.str.value,
            },
            "41": {
                NAME: "device_3_soc",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "42": {
                NAME: "device_3_pv_1_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "45": {
                NAME: "device_3_pv_2_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "57": {
                NAME: "device_3_ac_output_power_signed",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
        }
    },
    "eb": {
        BYTES: {
            "00": {
                NAME: "device_4_pn",
                TYPE: DeviceHexDataTypes.str.value,
            },
            "11": {
                NAME: "device_4_sn",
                TYPE: DeviceHexDataTypes.str.value,
            },
            "41": {
                NAME: "device_4_soc",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "42": {
                NAME: "device_4_pv_1_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "45": {
                NAME: "device_4_pv_2_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "57": {
                NAME: "device_4_ac_output_power_signed",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
        }
    },
    "ec": {
        BYTES: {
            "00": {
                NAME: "device_5_pn",
                TYPE: DeviceHexDataTypes.str.value,
            },
            "11": {
                NAME: "device_5_sn",
                TYPE: DeviceHexDataTypes.str.value,
            },
            "41": {
                NAME: "device_5_soc",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "42": {
                NAME: "device_5_pv_1_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "45": {
                NAME: "device_5_pv_2_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "57": {
                NAME: "device_5_ac_output_power_signed",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
        }
    },
    "ed": {
        BYTES: {
            "00": {
                NAME: "device_6_pn",
                TYPE: DeviceHexDataTypes.str.value,
            },
            "11": {
                NAME: "device_6_sn",
                TYPE: DeviceHexDataTypes.str.value,
            },
            "41": {
                NAME: "device_6_soc",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "42": {
                NAME: "device_6_pv_1_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "45": {
                NAME: "device_6_pv_2_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "57": {
                NAME: "device_6_ac_output_power_signed",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
        }
    },
    "fe": {NAME: "msg_timestamp"},
}

_A7320_0405 = {
    # SOLIX Smart Generator 5500 runtime message.
    TOPIC: "param_info",
    "a2": {NAME: "device_sn"},
    "a3": {NAME: "paired_device_sn"},  # paired E10 (A17E1) SN
    "a4": {NAME: "tbd_0405_a4?"},
    "a5": {
        BYTES: {
            "00": {
                NAME: "tbd_0405_a5_u16_01?",
                TYPE: DeviceHexDataTypes.sile.value,
            },
            "02": {
                NAME: "ac_dc_mode",  # 3 = AC, 1 = DC
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "04": {
                NAME: "tbd_0405_a5_u16_03?",
                TYPE: DeviceHexDataTypes.sile.value,
            },
        }
    },
    "a7": {NAME: "sw_version?", "values": 4},
    "aa": {
        BYTES: {
            "00": {
                NAME: "tbd_0405_aa_u32_01?",
                TYPE: DeviceHexDataTypes.var.value,
            },
            "04": {
                NAME: "tbd_0405_aa_u32_02?",
                TYPE: DeviceHexDataTypes.var.value,
            },
            "08": {
                NAME: "tbd_0405_aa_u32_03?",
                TYPE: DeviceHexDataTypes.var.value,
            },
            "12": {
                NAME: "tbd_0405_aa_u32_04?",
                TYPE: DeviceHexDataTypes.var.value,
            },
            "16": {
                NAME: "tbd_0405_aa_u16_05?",
                TYPE: DeviceHexDataTypes.sile.value,
            },
            "18": {
                NAME: "tbd_0405_aa_u16_06?",
                TYPE: DeviceHexDataTypes.sile.value,
            },
        }
    },
    "ac": {
        BYTES: {
            "40": {
                NAME: "tbd_0405_ac_u32_01?",
                TYPE: DeviceHexDataTypes.var.value,
            },
            "44": {
                NAME: "lpg_remaining_percent",
                TYPE: DeviceHexDataTypes.sile.value,
            },
            "48": {
                NAME: "tbd_0405_ac_u32_03?",
                TYPE: DeviceHexDataTypes.var.value,
            },
            "52": {
                NAME: "lpg_remaining_lb",
                TYPE: DeviceHexDataTypes.sile.value,
                FACTOR: 0.1,  # lb
            },
            "56": {
                NAME: "lpg_full_lb",
                TYPE: DeviceHexDataTypes.sile.value,
                FACTOR: 0.1,  # 100 % lb
            },
        }
    },
    "ae": {
        BYTES: {
            "00": {
                NAME: "tbd_0405_ae_u16_01?",
                TYPE: DeviceHexDataTypes.sile.value,
            },
            "02": {
                NAME: "tbd_0405_ae_u16_02?",
                TYPE: DeviceHexDataTypes.sile.value,
            },
            "04": {
                NAME: "tbd_0405_ae_u16_03?",
                TYPE: DeviceHexDataTypes.sile.value,
            },
            "06": {
                NAME: "tbd_0405_ae_u16_04?",
                TYPE: DeviceHexDataTypes.sile.value,
            },
        }
    },
    "af": {NAME: "tbd_0405_af?"},
    "b0": {NAME: "tbd_0405_b0?"},
    "b2": {NAME: "tbd_0405_b2?"},
    "b3": {NAME: "tbd_0405_b3?"},
    "b4": {NAME: "tbd_0405_b4?"},
    "b5": {NAME: "temperature?"},
    "b6": {NAME: "tbd_0405_b6?"},
    "b7": {NAME: "tbd_0405_b7?"},
    "b8": {NAME: "tbd_0405_b8?"},
    "b9": {NAME: "tbd_0405_b9?"},
    "ba": {NAME: "tbd_0405_ba?"},
    "bb": {NAME: "tbd_0405_bb?"},
    "bc": {NAME: "generator_mode"},  # 0 = quiet, 1 = eco, 2 = turbo
    "bd": {NAME: "runtime_hours?"},
    "be": {NAME: "tbd_0405_be?"},
    "bf": {NAME: "tbd_0405_bf?"},
    "c0": {NAME: "tbd_0405_c0?"},
    "c1": {NAME: "tbd_0405_c1?"},
    "c2": {NAME: "tbd_0405_c2?"},
    "c3": {NAME: "tbd_0405_c3?"},
    "c4": {NAME: "tbd_0405_c4?"},
    "c5": {NAME: "tbd_0405_c5?"},
    "c6": {NAME: "tbd_0405_c6?"},
    "ca": {NAME: "tbd_0405_ca?"},
    "cb": {NAME: "tbd_0405_cb?"},
    "fd": {NAME: "tbd_0405_fd?"},
    "fe": {NAME: "msg_timestamp"},
}

_A7320_0408 = {
    # SOLIX Smart Generator 5500 extended status message.
    TOPIC: "param_info",
    "a2": {NAME: "device_sn"},
    "a3": {NAME: "paired_device_sn"},
    "a4": {NAME: "tbd_0408_a4?"},
    "a5": {
        BYTES: {
            "00": {
                NAME: "tbd_0408_a5_u16_01?",
                TYPE: DeviceHexDataTypes.sile.value,
            },
            "02": {
                NAME: "ac_dc_mode",  # 3 = AC, 1 = DC
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "04": {
                NAME: "tbd_0408_a5_u16_03?",
                TYPE: DeviceHexDataTypes.sile.value,
            },
        }
    },
    "ae": {
        BYTES: {
            "00": {
                NAME: "tbd_0408_ae_u16_01?",
                TYPE: DeviceHexDataTypes.sile.value,
            },
            "02": {
                NAME: "tbd_0408_ae_u16_02?",
                TYPE: DeviceHexDataTypes.sile.value,
            },
            "04": {
                NAME: "tbd_0408_ae_u16_03?",
                TYPE: DeviceHexDataTypes.sile.value,
            },
            "06": {
                NAME: "tbd_0408_ae_u16_04?",
                TYPE: DeviceHexDataTypes.sile.value,
            },
        }
    },
    "af": {NAME: "tbd_0408_af?"},
    "b0": {NAME: "tbd_0408_b0?"},
    "b2": {NAME: "tbd_0408_b2?"},
    "b3": {NAME: "tbd_0408_b3?"},
    "b4": {NAME: "tbd_0408_b4?"},
    "b5": {NAME: "tbd_0408_b5?"},
    "b6": {NAME: "tbd_0408_b6?"},
    "b7": {NAME: "tbd_0408_b7?"},
    "fd": {NAME: "tbd_0408_fd?"},
    "fe": {NAME: "msg_timestamp"},
}

_A2345_0303 = {
    # 250W Prime Charger
    TOPIC: "state_info",
    "a2": {
        BYTES: {
            "00": {
                NAME: "usbc_1_status",
                TYPE: DeviceHexDataTypes.ui.value,
            },  # status: Inactive (0), Active (1)
            "01": {
                NAME: "usbc_1_voltage",
                TYPE: DeviceHexDataTypes.sile.value,
                FACTOR: 0.001,
            },
            "03": {
                NAME: "usbc_1_current",
                TYPE: DeviceHexDataTypes.sile.value,
                FACTOR: 0.001,
            },
            "05": {
                NAME: "usbc_1_power",
                TYPE: DeviceHexDataTypes.sile.value,
                FACTOR: 0.01,
            },
        }
    },
    "a3": {
        BYTES: {
            "00": {
                NAME: "usbc_2_status",
                TYPE: DeviceHexDataTypes.ui.value,
            },  # status: Inactive (0), Active (1)
            "01": {
                NAME: "usbc_2_voltage",
                TYPE: DeviceHexDataTypes.sile.value,
                FACTOR: 0.001,
            },
            "03": {
                NAME: "usbc_2_current",
                TYPE: DeviceHexDataTypes.sile.value,
                FACTOR: 0.001,
            },
            "05": {
                NAME: "usbc_2_power",
                TYPE: DeviceHexDataTypes.sile.value,
                FACTOR: 0.01,
            },
        }
    },
    "a4": {
        BYTES: {
            "00": {
                NAME: "usbc_3_status",
                TYPE: DeviceHexDataTypes.ui.value,
            },  # status: Inactive (0), Active (1)
            "01": {
                NAME: "usbc_3_voltage",
                TYPE: DeviceHexDataTypes.sile.value,
                FACTOR: 0.001,
            },
            "03": {
                NAME: "usbc_3_current",
                TYPE: DeviceHexDataTypes.sile.value,
                FACTOR: 0.001,
            },
            "05": {
                NAME: "usbc_3_power",
                TYPE: DeviceHexDataTypes.sile.value,
                FACTOR: 0.01,
            },
        }
    },
    "a5": {
        BYTES: {
            "00": {
                NAME: "usbc_4_status",
                TYPE: DeviceHexDataTypes.ui.value,
            },  # status: Inactive (0), Active (1)
            "01": {
                NAME: "usbc_4_voltage",
                TYPE: DeviceHexDataTypes.sile.value,
                FACTOR: 0.001,
            },
            "03": {
                NAME: "usbc_4_current",
                TYPE: DeviceHexDataTypes.sile.value,
                FACTOR: 0.001,
            },
            "05": {
                NAME: "usbc_4_power",
                TYPE: DeviceHexDataTypes.sile.value,
                FACTOR: 0.01,
            },
        }
    },
    "a6": {
        BYTES: {
            "00": {
                NAME: "usba_1_status",
                TYPE: DeviceHexDataTypes.ui.value,
            },  # status: Inactive (0), Active (1)
            "01": {
                NAME: "usba_1_voltage",
                TYPE: DeviceHexDataTypes.sile.value,
                FACTOR: 0.001,
            },
            "03": {
                NAME: "usba_1_current",
                TYPE: DeviceHexDataTypes.sile.value,
                FACTOR: 0.001,
            },
            "05": {
                NAME: "usba_1_power",
                TYPE: DeviceHexDataTypes.sile.value,
                FACTOR: 0.01,
            },
        }
    },
    "a7": {
        BYTES: {
            "00": {
                NAME: "usba_2_status",
                TYPE: DeviceHexDataTypes.ui.value,
            },  # status: Inactive (0), Active (1)
            "01": {
                NAME: "usba_2_voltage",
                TYPE: DeviceHexDataTypes.sile.value,
                FACTOR: 0.001,
            },
            "03": {
                NAME: "usba_2_current",
                TYPE: DeviceHexDataTypes.sile.value,
                FACTOR: 0.001,
            },
            "05": {
                NAME: "usba_2_power",
                TYPE: DeviceHexDataTypes.sile.value,
                FACTOR: 0.01,
            },
        }
    },
    "fe": {NAME: "msg_timestamp"},
}

_A2345_0a00 = {
    "a2": {NAME: "sw_version", "values": 4},
    "a4": {
        BYTES: {
            "00": {
                NAME: "usbc_1_status",
                TYPE: DeviceHexDataTypes.ui.value,
            },  # status: Inactive (0), Active (1)
            "01": {
                NAME: "usbc_1_voltage",
                TYPE: DeviceHexDataTypes.sile.value,
                FACTOR: 0.001,
            },
            "03": {
                NAME: "usbc_1_current",
                TYPE: DeviceHexDataTypes.sile.value,
                FACTOR: 0.001,
            },
            "05": {
                NAME: "usbc_1_power",
                TYPE: DeviceHexDataTypes.sile.value,
                FACTOR: 0.01,
            },
        }
    },
    "a5": {
        BYTES: {
            "00": {
                NAME: "usbc_2_status",
                TYPE: DeviceHexDataTypes.ui.value,
            },  # status: Inactive (0), Active (1)
            "01": {
                NAME: "usbc_2_voltage",
                TYPE: DeviceHexDataTypes.sile.value,
                FACTOR: 0.001,
            },
            "03": {
                NAME: "usbc_2_current",
                TYPE: DeviceHexDataTypes.sile.value,
                FACTOR: 0.001,
            },
            "05": {
                NAME: "usbc_2_power",
                TYPE: DeviceHexDataTypes.sile.value,
                FACTOR: 0.01,
            },
        }
    },
    "a6": {
        BYTES: {
            "00": {
                NAME: "usbc_3_status",
                TYPE: DeviceHexDataTypes.ui.value,
            },  # status: Inactive (0), Active (1)
            "01": {
                NAME: "usbc_3_voltage",
                TYPE: DeviceHexDataTypes.sile.value,
                FACTOR: 0.001,
            },
            "03": {
                NAME: "usbc_3_current",
                TYPE: DeviceHexDataTypes.sile.value,
                FACTOR: 0.001,
            },
            "05": {
                NAME: "usbc_3_power",
                TYPE: DeviceHexDataTypes.sile.value,
                FACTOR: 0.01,
            },
        }
    },
    "a7": {
        BYTES: {
            "00": {
                NAME: "usbc_4_status",
                TYPE: DeviceHexDataTypes.ui.value,
            },  # status: Inactive (0), Active (1)
            "01": {
                NAME: "usbc_4_voltage",
                TYPE: DeviceHexDataTypes.sile.value,
                FACTOR: 0.001,
            },
            "03": {
                NAME: "usbc_4_current",
                TYPE: DeviceHexDataTypes.sile.value,
                FACTOR: 0.001,
            },
            "05": {
                NAME: "usbc_4_power",
                TYPE: DeviceHexDataTypes.sile.value,
                FACTOR: 0.01,
            },
        }
    },
    "a8": {
        BYTES: {
            "00": {
                NAME: "usba_1_status",
                TYPE: DeviceHexDataTypes.ui.value,
            },  # status: Inactive (0), Active (1)
            "01": {
                NAME: "usba_1_voltage",
                TYPE: DeviceHexDataTypes.sile.value,
                FACTOR: 0.001,
            },
            "03": {
                NAME: "usba_1_current",
                TYPE: DeviceHexDataTypes.sile.value,
                FACTOR: 0.001,
            },
            "05": {
                NAME: "usba_1_power",
                TYPE: DeviceHexDataTypes.sile.value,
                FACTOR: 0.01,
            },
        }
    },
    "a9": {
        BYTES: {
            "00": {
                NAME: "usba_2_status",
                TYPE: DeviceHexDataTypes.ui.value,
            },  # status: Inactive (0), Active (1)
            "01": {
                NAME: "usba_2_voltage",
                TYPE: DeviceHexDataTypes.sile.value,
                FACTOR: 0.001,
            },
            "03": {
                NAME: "usba_2_current",
                TYPE: DeviceHexDataTypes.sile.value,
                FACTOR: 0.001,
            },
            "05": {
                NAME: "usba_2_power",
                TYPE: DeviceHexDataTypes.sile.value,
                FACTOR: 0.01,
            },
        }
    },
    "aa": {
        BYTES: {
            "00": {
                NAME: "usbc_1_switch",
                TYPE: DeviceHexDataTypes.ui.value,
            },
        },
    },
    "ab": {
        BYTES: {
            "00": {
                NAME: "usbc_2_switch",
                TYPE: DeviceHexDataTypes.ui.value,
            },
        },
    },
    "ac": {
        BYTES: {
            "00": {
                NAME: "usbc_3_switch",
                TYPE: DeviceHexDataTypes.ui.value,
            },
        },
    },
    "ad": {
        BYTES: {
            "00": {
                NAME: "usbc_4_switch",
                TYPE: DeviceHexDataTypes.ui.value,
            },
        },
    },
    "ae": {
        BYTES: {
            "00": {
                NAME: "usba_switch",
                TYPE: DeviceHexDataTypes.ui.value,
            },
        },
    },
    "fe": {NAME: "msg_timestamp"},
}

_AS200_0421 = {
    "a2": {
        BYTES: {
            "01": {
                NAME: "device_sn",
                TYPE: DeviceHexDataTypes.str.value,
            },
            "20": {
                NAME: "device_pn",
                TYPE: DeviceHexDataTypes.str.value,
            },
        }
    },
    "a3": {
        BYTES: {
            "04": {
                NAME: "bat_charge_power",  # car battery charging power
                TYPE: DeviceHexDataTypes.sile.value,
            },
            # "08": {
            #     NAME: "output_power",  # reverse charging power?
            #     TYPE: DeviceHexDataTypes.sile.value,
            # },
        }
    },
    "a4": {
        BYTES: {
            "00": {NAME: "device_switch", TYPE: DeviceHexDataTypes.ui.value},
            "02": {
                NAME: "car_battery_type",
                TYPE: DeviceHexDataTypes.ui.value,
            },  # 0=LiFePO4, 1=Lead Acid
            "03": {
                NAME: "car_battery_voltage_type",
                TYPE: DeviceHexDataTypes.ui.value,
            },  # 0=12V, 1=24V
            "05": {
                NAME: "charge_voltage_limit",
                TYPE: DeviceHexDataTypes.sile.value,
                FACTOR: 0.1,
            },
            "07": {
                NAME: "charge_power_limit",
                TYPE: DeviceHexDataTypes.sile.value,
            },
            "09": {
                NAME: "output_power_limit",
                TYPE: DeviceHexDataTypes.sile.value,
            },
            "11": {
                NAME: "active_device_timeout_minutes",
                TYPE: DeviceHexDataTypes.sile.value,
            },
            # active device auto-off timeout (minutes): 0 (Never), 720–1440 min in 30 min steps
            "13": {
                NAME: "temp_unit_fahrenheit",
                TYPE: DeviceHexDataTypes.ui.value,
            },  # Celsius (0) or Fahrenheit (1)
            "14": {
                NAME: "device_timeout_switch",
                TYPE: DeviceHexDataTypes.ui.value,
            },  # Timeout (0) or Off (1)
            "16": {
                NAME: "device_timeout_minutes",
                TYPE: DeviceHexDataTypes.sile.value,
            },  # Device auto-off timeout control (minutes): 720–1440 min in 30 min steps
        }
    },
    "a6": {
        BYTES: {
            "02": {
                NAME: "temperature",
                TYPE: DeviceHexDataTypes.ui.value,
                SIGNED: True,
            },
            "06": {
                NAME: "charge_power_limit_min",
                TYPE: DeviceHexDataTypes.sile.value,
            },
            "08": {
                NAME: "charge_power_limit_max",
                TYPE: DeviceHexDataTypes.sile.value,
            },
            "10": {
                NAME: "output_power_limit_min",
                TYPE: DeviceHexDataTypes.sile.value,
            },
            "12": {
                NAME: "output_power_limit_max",
                TYPE: DeviceHexDataTypes.sile.value,
            },
            "14": {
                NAME: "charge_voltage_limit_min",
                TYPE: DeviceHexDataTypes.sile.value,
                FACTOR: 0.1,
            },
            "16": {
                NAME: "charge_voltage_limit_max",
                TYPE: DeviceHexDataTypes.sile.value,
                FACTOR: 0.1,
            },
            "18": {
                NAME: "battery_voltage",
                TYPE: DeviceHexDataTypes.sile.value,
                FACTOR: 0.1,
            },
        }
    },
    "a7": {
        BYTES: {
            "11": {
                NAME: "pps_sn?",
                TYPE: DeviceHexDataTypes.str.value,
            },
        }
    },
    "fd": {
        BYTES: {
            "00": {
                NAME: "utc_timestamp",
                TYPE: DeviceHexDataTypes.str.value,
                LENGTH: 13,
            },
        }
    },
    "fe": {
        BYTES: {
            "00": {
                NAME: "message_timestamp",
                TYPE: DeviceHexDataTypes.var.value,
                SIGNED: False,
            },
        }
    },
}

_PLUG_TIMER_STATUS = {
    BYTES: {
        "00": {
            NAME: "toggle_to_delay_time",
            TYPE: DeviceHexDataTypes.var.value,  # seconds:minutes:hours
            LENGTH: 3,
        },
        "03": {
            NAME: "toggle_current_setting?",
            TYPE: DeviceHexDataTypes.ui.value,
        },
        "04": {
            NAME: "toggle_delay_status?",  # 03 seen while toggle_to delay running, 00 while inactive
            TYPE: DeviceHexDataTypes.ui.value,
        },
        "05": {
            NAME: "toggle_to_elapsed_time",  # seconds:minutes:hours
            TYPE: DeviceHexDataTypes.var.value,
            LENGTH: 3,
        },
    }
}

_DOCK_0405 = {
    # multisystem message
    TOPIC: "param_info",
    "a2": {NAME: "device_sn"},
    "a3": {NAME: "sw_version", "values": 4},
    "a5": {NAME: "ac_output_power_signed"},
    "a6": {
        NAME: "device_output_power_signed_total",
        FACTOR: -1,
    },  # All SB outputs (negative is SB output)
    "a7": {NAME: "usage_mode"},  # SB2 usage mode
    "a8": {NAME: "unknown_0405_a8?"},
    "b3": {NAME: "utc_timestamp"},
    "b6": {
        BYTES: [
            # Field has flexible offset, depending on SN length
            {
                NAME: "device_1_sn",
                TYPE: DeviceHexDataTypes.str.value,
            },
            {
                NAME: "device_1_type",  # 01 = A17C1, 05 = A17C5 ?
                TYPE: DeviceHexDataTypes.ui.value,
            },
            {
                NAME: "device_1_soc",
                TYPE: DeviceHexDataTypes.ui.value,
                OFFSET: 0,  # Example for Byte offset from previous field in case of description gap
            },
        ]
    },
    "b7": {NAME: "device_1_ac_output_power_signed", FACTOR: -1},
    "b8": {
        BYTES: [
            # Field has flexible offset, depending on SN length
            {
                NAME: "device_2_sn",
                TYPE: DeviceHexDataTypes.str.value,
            },
            {
                NAME: "device_2_type",  # 01 = A17C1, 05 = A17C5 ?
                TYPE: DeviceHexDataTypes.ui.value,
            },
            {
                NAME: "device_2_soc",
                TYPE: DeviceHexDataTypes.ui.value,
            },
        ]
    },
    "b9": {NAME: "device_2_ac_output_power_signed", FACTOR: -1},
    "ba": {
        BYTES: [
            # Field has flexible offset, depending on SN length
            {
                NAME: "device_3_sn",
                TYPE: DeviceHexDataTypes.str.value,
            },
            {
                NAME: "device_3_type",  # 01 = A17C1, 05 = A17C5 ?
                TYPE: DeviceHexDataTypes.ui.value,
            },
            {
                NAME: "device_3_soc",
                TYPE: DeviceHexDataTypes.ui.value,
            },
        ]
    },
    "bb": {NAME: "device_3_ac_output_power_signed", FACTOR: -1},
    "bc": {
        BYTES: [
            # Field has flexible offset, depending on SN length
            {
                NAME: "device_4_sn",
                TYPE: DeviceHexDataTypes.str.value,
            },
            {
                NAME: "device_4_type",  # 01 = A17C1, 05 = A17C5 ?
                TYPE: DeviceHexDataTypes.ui.value,
            },
            {
                NAME: "device_4_soc",
                TYPE: DeviceHexDataTypes.ui.value,
            },
        ]
    },
    "bd": {NAME: "device_4_ac_output_power_signed", FACTOR: -1},
}

_DOCK_0420 = {
    # multisystem message
    TOPIC: "param_info",
    "a2": {NAME: "device_sn"},
    "a3": {NAME: "local_timestamp"},
    "a4": {NAME: "utc_timestamp"},
    "a7": {NAME: "battery_soc_total"},  # Average SOC of all solarbank devices in system
    "a8": {NAME: "0420_unknown_1?"},
    "a9": {NAME: "usage_mode"},  # SB usage modes
    "ab": {NAME: "grid_power_signed"},
    "ac": {NAME: "device_output_power_signed_total"},  # Combined device output power
    "ae": {NAME: "ac_output_power"},  # Dock output power to home
    "af": {NAME: "home_demand_total"},  # Total across all devices in system
    "b0": {NAME: "pv_power_total"},  # Total across all devices in system
    "b1": {NAME: "battery_power_signed_total"},
    "b3": {
        BYTES: {
            "00": {
                NAME: "device_1_sn",
                TYPE: DeviceHexDataTypes.str.value,
            },
            "18": {
                NAME: "device_1_battery_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "22": {
                NAME: "device_1_soc",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "23": {
                NAME: "device_1_pv_1_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "27": {
                NAME: "device_1_pv_2_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "31": {
                NAME: "device_1_pv_3_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "35": {
                NAME: "device_1_pv_4_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "39": {
                NAME: "device_1_pv_other_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "43": {
                NAME: "device_1_exp_packs",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "44": {
                NAME: "device_1_pv_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
        }
    },
    "b4": {
        BYTES: {
            "00": {
                NAME: "device_2_sn",
                TYPE: DeviceHexDataTypes.str.value,
            },
            "18": {
                NAME: "device_2_battery_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "22": {
                NAME: "device_2_soc",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "23": {
                NAME: "device_2_pv_1_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "27": {
                NAME: "device_2_pv_2_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "31": {
                NAME: "device_2_pv_3_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "35": {
                NAME: "device_2_pv_4_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "39": {
                NAME: "device_2_pv_other_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "43": {
                NAME: "device_2_exp_packs",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "44": {
                NAME: "device_2_pv_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
        }
    },
    "b5": {
        BYTES: {
            "00": {
                NAME: "device_3_sn",
                TYPE: DeviceHexDataTypes.str.value,
            },
            "18": {
                NAME: "device_3_battery_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "22": {
                NAME: "device_3_soc",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "23": {
                NAME: "device_3_pv_1_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "27": {
                NAME: "device_3_pv_2_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "31": {
                NAME: "device_3_pv_3_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "35": {
                NAME: "device_3_pv_4_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "39": {
                NAME: "device_3_pv_other_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "43": {
                NAME: "device_3_exp_packs",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "44": {
                NAME: "device_3_pv_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
        }
    },
    "b6": {
        BYTES: {
            "00": {
                NAME: "device_4_sn",
                TYPE: DeviceHexDataTypes.str.value,
            },
            "18": {
                NAME: "device_4_battery_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "22": {
                NAME: "device_4_soc",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "23": {
                NAME: "device_4_pv_1_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "27": {
                NAME: "device_4_pv_2_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "31": {
                NAME: "device_4_pv_3_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "35": {
                NAME: "device_4_pv_4_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "39": {
                NAME: "device_4_pv_other_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "43": {
                NAME: "device_4_exp_packs",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "44": {
                NAME: "device_4_pv_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
        }
    },
    "c1": {NAME: "main_device_sn?"},
    "c2": {NAME: "pv_power_3rd_party"},
    "c3": {NAME: "backup_start_timestamp"},
    "c4": {NAME: "backup_end_timestamp"},
}

_DOCK_0421 = {
    # multisystem message
    TOPIC: "state_info",
    "a4": {NAME: "max_load_total"},  # user applied max load limit across all devices
    "a5": {NAME: "ac_input_limit_total"},
    "a6": {
        NAME: "max_load_limit_total"
    },  # system defined limit based on given installation
    "a7": {NAME: "battery_soc_total"},  # Average SOC of all solarbank devices in system
    "ac": {NAME: "max_soc?"},
    "ae": {NAME: "usage_mode"},  # SB usage modes
    "fc": {NAME: "device_sn"},
    "fd": {NAME: "local_timestamp"},
    "fe": {NAME: "utc_timestamp"},
}

_DOCK_0428 = {
    # multisystem message
    TOPIC: "state_info",
    "a2": {NAME: "device_sn"},
    "a3": {NAME: "local_timestamp"},
    "a4": {NAME: "utc_timestamp"},
    "a5": {NAME: "battery_soc_total"},  # Average SOC of all solarbanks
    "a6": {NAME: "usage_mode"},  # SB usage modes
    "a7": {NAME: "home_load_default"},  # default home load
    "ab": {NAME: "pv_power_total"},
    "b1": {NAME: "device_output_power_signed_total"},
    "b5": {NAME: "battery_power_signed_total"},
    "bc": {NAME: "0428_unknown_bc?"},
    "bf": {
        BYTES: {
            "00": {
                NAME: "device_1_sn",
                TYPE: DeviceHexDataTypes.str.value,
            },
            "18": {
                NAME: "device_1_soc",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "19": {
                NAME: "device_1_pv_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "23": {
                NAME: "device_1_pv_1_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "27": {
                NAME: "device_1_pv_2_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "31": {
                NAME: "device_1_pv_3_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "35": {
                NAME: "device_1_pv_4_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
        },
    },
    "c0": {
        BYTES: {
            "00": {
                NAME: "device_2_sn",
                TYPE: DeviceHexDataTypes.str.value,
            },
            "18": {
                NAME: "device_2_soc",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "19": {
                NAME: "device_2_pv_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "23": {
                NAME: "device_2_pv_1_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "27": {
                NAME: "device_2_pv_2_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "31": {
                NAME: "device_2_pv_3_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "35": {
                NAME: "device_2_pv_4_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
        },
    },
    "c1": {
        BYTES: {
            "00": {
                NAME: "device_3_sn",
                TYPE: DeviceHexDataTypes.str.value,
            },
            "18": {
                NAME: "device_3_soc",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "19": {
                NAME: "device_3_pv_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "23": {
                NAME: "device_3_pv_1_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "27": {
                NAME: "device_3_pv_2_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "31": {
                NAME: "device_3_pv_3_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "35": {
                NAME: "device_3_pv_4_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
        },
    },
    "c2": {
        BYTES: {
            "00": {
                NAME: "device_4_sn",
                TYPE: DeviceHexDataTypes.str.value,
            },
            "18": {
                NAME: "device_4_soc",
                TYPE: DeviceHexDataTypes.ui.value,
            },
            "19": {
                NAME: "device_4_pv_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "23": {
                NAME: "device_4_pv_1_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "27": {
                NAME: "device_4_pv_2_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "31": {
                NAME: "device_4_pv_3_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
            "35": {
                NAME: "device_4_pv_4_power",
                TYPE: DeviceHexDataTypes.sfle.value,
            },
        },
    },
    "c9": {NAME: "home_demand_total"},  # Total across all devices in system
    "d9": {
        BYTES: {
            "00": {
                NAME: "device_1_sn",
                TYPE: DeviceHexDataTypes.str.value,
            },
        }
    },
    "da": {
        BYTES: {
            "00": {
                NAME: "device_2_sn",
                TYPE: DeviceHexDataTypes.str.value,
            },
        }
    },
    "db": {
        BYTES: {
            "00": {
                NAME: "device_3_sn",
                TYPE: DeviceHexDataTypes.str.value,
            },
        }
    },
    "dc": {
        BYTES: {
            "00": {
                NAME: "device_4_sn",
                TYPE: DeviceHexDataTypes.str.value,
            },
        }
    },
}

_DOCK_0500 = {
    # Only binary fields, format unknown
    TOPIC: "state_info",
}

_EV_CHARGER_0403 = {
    # V1 status message
    TOPIC: "param_info",
    "a5": {NAME: "charging_window_seconds"},
    "a6": {
        NAME: "solar_evcharge_min_current?"
    },  # 6 - max_current_limit (32 A), step 1 A
}

_EV_CHARGER_0405 = {
    # V1 status message
    TOPIC: "param_info",
    "a2": {NAME: "unknown_limit?"},
    # "a3": {NAME: "ocpp_connect_status?"},  # disconnected(0), connecting(1), connected(2)
    "a3": {NAME: "plug_lock_switch"},  # On (1), Off (2) !
    "a4": {NAME: "auto_start_switch"},  # Off (0), On (1)
    "a8": {
        NAME: "max_evcharge_current",
        FACTOR: 0.1,
    },  # 6 - rated_current (32 A), step 1 A
    "aa": {NAME: "light_brightness"},  # 0-100 %, step 10 %
    "ac": {NAME: "auto_charge_restart_switch"},  # Off (0), On (1)
    "ad": {NAME: "random_delay_switch"},  # Off (0), On (1)
    "af": {
        NAME: "wipe_up_mode"
    },  # off (0) / start charge (1) / stop charge (2) / boost charge (3)
    "b0": {
        NAME: "wipe_down_mode"
    },  # off (0) / start charge (1) / stop charge (2) / boost charge (3)
    "b2": {NAME: "smart_touch_mode"},  # simple (0), anti_mistouch (1)
    "b4": {NAME: "light_off_schedule_switch"},  # Off (0), On (1)
    "b5": {NAME: "light_off_start_time", SIGNED: False},  # sile: hour * 256 + sec
    "b6": {NAME: "light_off_end_time", SIGNED: False},  # sile: hour * 256 + sec
    "b7": {NAME: "modbus_switch"},  # Off (0), On (1)
    "cc": {NAME: "tcp_timeout_seconds"},  # Modbus TCP timeout
    "ce": {NAME: "max_current_limit", FACTOR: 0.1},  # rated A limit for model
    "cf": {NAME: "tcp_port"},  # Modbus TCP port
    "d0": {NAME: "ip_address"},  # device IP address
    "d3": {NAME: "load_balance_switch"},  # Off (0), On (1)
    "d4": {NAME: "main_breaker_limit"},  # 10-500 A, step 1 A
    "d5": {NAME: "load_balance_setting_d5"},  # System monitoring (1)
    "d6": {NAME: "load_balance_setting_d6"},  # 1 if SM monitored?
    "d7": {NAME: "load_balance_monitor_device"},  # SN of monitoring device
    "d8": {NAME: "solar_evcharge_switch"},  # Off (0), On (1)
    "d9": {NAME: "solar_evcharge_mode"},  # solar & grid (0), solar only (1)
    "da": {NAME: "solar_evcharge_min_current"},  # 6 - rated_current (32 A), step 1 A
    "db": {NAME: "phase_operating_mode"},  # auto (0), 1 phase (1)
    "dc": {NAME: "solar_evcharge_monitoring_mode"},
    "dd": {
        NAME: "auto_phase_switch"
    },  # Off (0), On (1), only available in 3 phase models
    "de": {NAME: "solar_evcharge_monitor_device"},  # monitoring device sn
    "df": {NAME: "boost_status"},  # Off (0), On (1)
    "e0": {NAME: "cp_signal_status"},
    # A=12V(0), B1=9V(3), B2=9V(4), C1=6V(5), C2=6V(6), Error(7), D1=3V(8), D2=3V(9),  E=0V(10), F=-12(11),
    "e2": {NAME: "plug_status"},  # Disconnected (0), Connected (1)
    "e3": {NAME: "ev_charger_status"},
    # Standby(0), Preparing(1), Charging(2), Charger_Paused(3), Vehicle_Paused(4), Completed (5), Reserving(6), Disabled(7), Error(8)
    "e6": {NAME: "schedule_switch"},  # on (1), off (2) !
    "e7": {NAME: "week_start_time", SIGNED: False},  # sile: hour * 256 + sec
    "e8": {NAME: "week_end_time", SIGNED: False},  # sile: hour * 256 + sec
    "e9": {NAME: "weekend_start_time", SIGNED: False},  # sile: hour * 256 + sec
    "ea": {NAME: "weekend_end_time", SIGNED: False},  # sile: hour * 256 + sec
    "eb": {NAME: "weekend_mode"},  # 1: same, 2: different
    "ec": {NAME: "schedule_mode"},  # 0: normal, 1: smart
    "f1": {NAME: "sw_version", "values": 4},
    "f2": {NAME: "sw_controller", "values": 4},
    "f3": {NAME: "hw_version", "values": 4},
    "fe": {NAME: "min_current_limit"},  # 6 A
}

_EV_CHARGER_0410 = {
    # V1 status message
    TOPIC: "param_info",
    "a2": {NAME: "voltage_l1", "factor": 0.1},
    "a3": {NAME: "voltage_l2", "factor": 0.1},
    "a4": {NAME: "voltage_l3", "factor": 0.1},
    "a5": {NAME: "current_l1", "factor": 0.1},
    "a6": {NAME: "current_l2", "factor": 0.1},
    "a7": {NAME: "current_l3", "factor": 0.1},
    "a8": {NAME: "bat_charge_power"},
    "a9": {NAME: "charging_duration_seconds"},
    "aa": {NAME: "charging_energy", "factor": 0.001},
    "ac": {
        NAME: "charging_mode?"
    },  # off/paused (0) / grid_charge (1) ? / solar_charge (7)
    "ab": {NAME: "charging_start_timestamp"},
    "ad": {NAME: "plug_countdown_seconds"},
    "ae": {NAME: "start_countdown_seconds"},
    "af": {NAME: "charging_window_seconds"},
    "b0": {NAME: "power_l1"},
    "b1": {NAME: "power_l2"},
    "b2": {NAME: "power_l3"},
    "b3": {NAME: "charging_energy_l1", "factor": 0.001},
    "b4": {NAME: "charging_energy_l2", "factor": 0.001},
    "b5": {NAME: "charging_energy_l3", "factor": 0.001},
    "b6": {NAME: "order_id?"},
    "b7": {NAME: "unknown_b7?"},  #  (0),  (1)
    "b8": {
        NAME: "ocpp_connect_status"
    },  # disconnected (0), Connecting (1), Connected (2)
    # "b9": {NAME: "cp_signal_status?"},
    # A=12V(0), B1=9V(3), B2=9V(4), C1=6V(5), C2=6V(6), Error(7), D1=3V(8), D2=3V(9),  E=0V(10), F=-12(11),
    "ba": {NAME: "phase_operating_mode"},  # auto (0), 1 phase (1)
    "bb": {NAME: "ev_charger_status"},
    # Standby(0), Preparing(1), Charging(2), Charger_Paused(3), Vehicle_Paused(4), Completed (5), Reserving(6), Disabled(7), Error(8)
}

_X1_JSON = {
    "sn": {NAME: "device_sn"},
    "subSn": {NAME: "sub_device_sn"},
    "localTime": {NAME: "local_datetime"},
    "ems_data": {
        "bs": {  # 0: Standby; 1: Charging; 2: Discharging; 3: Sleep
            NAME: "battery_status"
        },
        "gs": {NAME: "grid_status"},  # 0: OK??
        "ps": {  # 1: On-grid; 2: Off-grid 3: Standby 4: Fault
            NAME: "plant_status"
        },
        "soc": {NAME: "battery_soc"},  # 100 %
        "pp": {NAME: "photovoltaic_power"},  # 650 W
        "p2lp": {NAME: "pv_to_home_power"},  # 650 W
        "p2bp": {NAME: "pv_to_battery_power"},  # 0 W
        "p2gp": {NAME: "pv_to_grid_power"},  # 0 W
        "bp": {NAME: "battery_power_signed", FACTOR: -1},  # 0 W
        "b2lp": {NAME: "battery_to_home_power"},  # 0 W
        "b2gp": {NAME: "battery_to_grid_power"},  # 0 W
        "gp": {NAME: "grid_power_signed"},  # 0 W
        "g2bp": {NAME: "grid_to_battery_power"},  # 0 W
        "g2lp": {NAME: "grid_to_home_power"},  # 0 W
        "lp": {NAME: "ac_output_power"},  # 650 W
        "d2bp": {NAME: "generator_to_battery_power"},
        "d2lp": {NAME: "generator_to_home_power"},
        "dp": {NAME: "generator_power"},
        # daily energies in Wh?
        "pe": {NAME: "pv_yield_today", FACTOR: 0.001},  # 28629.02 Wh
        "p2le": {NAME: "pv_consumption_today", FACTOR: 0.001},  # 6348.36 Wh
        "p2be": {NAME: "pv_charge_today", FACTOR: 0.001},  # 22255.69 Wh
        "p2ge": {NAME: "pv_export_today", FACTOR: 0.001},  # 24.98 Wh
        "bdce": {NAME: "charged_energy_today", FACTOR: 0.001},  # 22255.69 Wh
        "bdde": {NAME: "discharged_energy_today", FACTOR: 0.001},  # 6879 Wh
        "b2le": {NAME: "battery_consumption_today", FACTOR: 0.001},  # 6838.9 Wh
        "b2ge": {NAME: "grid_discharged_today", FACTOR: 0.001},  # 40.09 Wh
        "g2be": {NAME: "grid_charged_today", FACTOR: 0.001},  # 0 Wh
        "g2le": {NAME: "grid_consumption_today", FACTOR: 0.001},  # 54 Wh
        "fge": {NAME: "grid_import_today", FACTOR: 0.001},
        "tge": {NAME: "grid_export_today", FACTOR: 0.001},
        "le": {NAME: "home_consumption_today", FACTOR: 0.001},  # 13241.26 Wh
        "de": {NAME: "generator_energy_today", FACTOR: 0.001},
        "d2be": {NAME: "generator_charged_today", FACTOR: 0.001},
        "d2le": {NAME: "generator_consumed_today", FACTOR: 0.001},
        # aggregated energies in Wh?
        "pae": {NAME: "pv_yield", FACTOR: 0.001},  # 5143662.5 Wh
        "bac": {NAME: "charged_energy", FACTOR: 0.001},  # 2675350.25 Wh
        "bad": {NAME: "discharged_energy", FACTOR: 0.001},  # 2541277 Wh
    },
    "pack_data": {
        "t": {
            NAME: "exp_{x}_temperature"
        },  # List field with temps: [42.4, 41.5, 42, 41.5] °C
        "fv": {NAME: "f_voltage"},  # 53.6,
        "batv": {NAME: "battery_voltage"},  # 53.5 V
        "usoc": {NAME: "battery_soc"},  # Battery SOC
        "soh": {NAME: "battery_soh"},  # Battery Health
        "tce": {NAME: "charged_energy?", FACTOR: 0.001},  # 426497
        "tde": {NAME: "discharged_energy?", FACTOR: 0.001},  # 399819
        "dce": {NAME: "charged_energy_today", FACTOR: 0.001},  # 3522,
        "dde": {NAME: "discharged_energy_today", FACTOR: 0.001},  # 633,
        "rt": {NAME: "r_temperature?"},  # 38.1,
        "mt": {NAME: "m_temperature?"},  # 38.7,
        "ct": {NAME: "c_temperature?"},  # 41,
        "wm": {
            NAME: "work_mode"
        },  # 0: Self-consumption; 1: TOU; 2: Backup only, 3: 3rd party control (VPP, etc) 4. User-Defined 5. Socket Aggregation
    },
}

_PP_JSON = {
    "localtime": {NAME: "local_datetime"},
    "data": {
        "sn": {NAME: "device_sn"},
        "b1sn": {NAME: "device_sn"},
        "wf": {NAME: "wifi_name"},
        "mv": {NAME: "sw_version"},  # v1.5.7
        "mdv": {NAME: "hw_version"},  # v0.2.3.1
        "90asn": {NAME: "device_1_sn"},
        "ppsapn": {NAME: "device_1_pn"},
        "90av": {NAME: "device_1_sw_version"},  # "v3.5.6"
        "90as": {NAME: "device_1_status"},  # 2
        "90asoc": {NAME: "device_1_soc"},  # 15
        "90bsn": {NAME: "device_2_sn"},
        "ppsbpn": {NAME: "device_2_pn"},
        "90bv": {NAME: "device_2_sw_version"},  # "v3.5.6"
        "90bs": {NAME: "device_2_status"},  # 2
        "90bsoc": {NAME: "device_2_soc"},  # 16
        # power values
        "mcp": {NAME: "max_charge_power"},  # 8000 W
        "b2lp": {NAME: "battery_to_home_power"},  # 0 W
        "b2gp": {NAME: "battery_to_grid_power"},  # 0 W
        "bp": {NAME: "battery_power_signed", FACTOR: -1},  # -2296 W = charging
        "bcp": {NAME: "bat_charge_power", FACTOR: -1},  # -226 W = charging
        "bdcp": {NAME: "bat_discharge_power"},  # 111 W
        "pp": {NAME: "photovoltaic_power"},  # 0 W
        "p2lp": {NAME: "pv_to_home_power"},  # 0 W
        "p2bp": {NAME: "pv_to_battery_power"},  # 0 W
        "p2gp": {NAME: "pv_to_grid_power"},  # 0 W
        "gp": {NAME: "grid_power_signed"},  # 3705 W
        "g2bp": {NAME: "grid_to_battery_power"},  # 2296 W
        "g2lp": {NAME: "grid_to_home_power"},  # 1409 W
        "lp": {NAME: "ac_output_power"},  # 1409 W
        "mpp": {NAME: "micro_inverter_power"},  # 0 W
        "op": {NAME: "other_power"},  # 0 W
        "o2lp": {NAME: "other_to_home_power"},  # 0 W
        "o2pp": {NAME: "other_to_pv_power?"},  # 0 W
        "gmp": {NAME: "max_load_power?"},  # 4800 W
        # disaster protection
        "dpp": {NAME: "disaster_protection_plan_{x}"},  # list with mappings
        "dps": {NAME: "disaster_protection_status?"},  # 0
        # status
        "ws": {NAME: "working_status?"},  # 0 = standby, 1 = running
        "m": {NAME: "mode"},  # (0 = off, 1 = on, 2 = auto)
        "gs": {NAME: "grid_status?"},  # (0 = offline, 1 = online)
        "bs": {  # 0: Standby; 1: Charging; 2: Discharging
            NAME: "battery_status"
        },
        "ps": {  # 0: Off, 1: On-grid
            NAME: "plant_status"
        },
        "soc": {NAME: "battery_soc"},  # 62 %
        "b1t": {NAME: "battery_1_temperature"},
        "bc": {NAME: "pps_count?"},  # 2
        "90s": {NAME: "pps_count"},  # 2
        "bds": {
            NAME: "device_{x}_data"
        },  # list with PPS data dict, eg {"sn": <pps_sn>,"soc":61,"power":-1148,"error":0}
        "cp": {NAME: "battery_soc_total?"},  # %
        "pu": {NAME: "power_usage_mode?"},
        "mps": {NAME: "micro_power_setting?"},
        "tpp": {NAME: "pv_power_total?"},  # 3045970
        "tgp": {NAME: "grid_power_signed_total?"},  # 3045970
        "tlp": {NAME: "home_load_total?"},  # 50620729
        "tsp": {NAME: "battery_power_total?"},  # 50620729
        # daily energies in Wh?
        "pe": {NAME: "pv_yield_today", FACTOR: 0.001},  # 6293 Wh
        "p2le": {NAME: "pv_consumption_today", FACTOR: 0.001},  # 4771 Wh
        "p2be": {NAME: "pv_charge_today", FACTOR: 0.001},  # 1522 Wh
        "p2ge": {NAME: "pv_export_today", FACTOR: 0.001},  # 24.98 Wh
        "bdce": {NAME: "charged_energy_today", FACTOR: 0.001},  # 2853 Wh
        "bdde": {NAME: "discharged_energy_today", FACTOR: 0.001},  # 11794 Wh
        "b2le": {NAME: "battery_consumption_today", FACTOR: 0.001},  # 11794 Wh
        "b2ge": {NAME: "grid_discharged_today", FACTOR: 0.001},  # 40.09 Wh
        "g2be": {NAME: "grid_charged_today", FACTOR: 0.001},  # 1331 Wh
        "g2le": {NAME: "grid_consumption_today", FACTOR: 0.001},  # 87889 Wh
        "fge": {NAME: "grid_import_today", FACTOR: 0.001},  # 89220 Wh
        "tge": {NAME: "grid_export_today", FACTOR: 0.001},  # 3 Wh
        "le": {NAME: "home_consumption_today", FACTOR: 0.001},  # 104452 Wh
        "de": {NAME: "generator_energy_today", FACTOR: 0.001},
        "d2be": {NAME: "generator_charged_today", FACTOR: 0.001},
        "d2le": {NAME: "generator_consumed_today", FACTOR: 0.001},
        "o2le": {NAME: "other_consumption_today", FACTOR: 0.001},
        "o2pe": {NAME: "other_pv_yield_today", FACTOR: 0.001},
        "oe": {NAME: "other_energy_today", FACTOR: 0.001},
        # aggregated energies in Wh?
        "pae": {NAME: "pv_yield", FACTOR: 0.001},  # 3045970 Wh
        "bac": {NAME: "charged_energy", FACTOR: 0.001},  # 12286143 Wh
        "bad": {NAME: "discharged_energy", FACTOR: 0.001},  # 8033557 Wh
    },
}


# Following is the consolidated mapping for all device types and messages
SOLIXMQTTMAP: Final[dict] = {
    # PPS C300 AC
    "A1722": {
        "0044": CMD_AC_CHARGE_LIMIT  # AC Recharge Limit: 100, 200, 300, 330 W
        | {
            "a2": {
                **CMD_AC_CHARGE_LIMIT["a2"],
                VALUE_OPTIONS: [100, 200, 300, 330],
            }
        },
        "004a": CMD_AC_OUTPUT_SWITCH,  # AC output switch: Disabled (0) or Enabled (1)
        "004b": CMD_DC_OUTPUT_SWITCH,  # DC output switch: Disabled (0) or Enabled (1)
        "004f": CMD_LIGHT_MODE  # LED mode: Off (0), Low (1), Medium (2), High (3)
        | {
            "a2": {
                **CMD_LIGHT_MODE["a2"],
                VALUE_OPTIONS: {"off": 0, "low": 1, "medium": 2, "high": 3},
            },
        },
        "0052": CMD_DISPLAY_SWITCH,  # Display switch: Disabled (0) or Enabled (1)
        "0057": CMD_REALTIME_TRIGGER,  # for regular status messages 0405 etc
        # Interval: ~3-5 seconds, but only with realtime trigger
        "0405": _A1722_0405,
        # Interval: Irregular, triggered on app actions, no fixed interval
        "0830": _PPS_VERSIONS_0830,
    },
    # PPS C300X AC
    "A1723": {
        "0044": CMD_AC_CHARGE_LIMIT  # AC Recharge Limit: 100, 200, 300, 330 W
        | {
            "a2": {
                **CMD_AC_CHARGE_LIMIT["a2"],
                VALUE_OPTIONS: [100, 200, 300, 330],
            }
        },
        "004a": CMD_AC_OUTPUT_SWITCH,  # AC output switch: Disabled (0) or Enabled (1)
        "004b": CMD_DC_OUTPUT_SWITCH,  # DC output switch: Disabled (0) or Enabled (1)
        "004f": CMD_LIGHT_MODE  # LED mode: Off (0), Low (1), Medium (2), High (3)
        | {
            "a2": {
                **CMD_LIGHT_MODE["a2"],
                VALUE_OPTIONS: {"off": 0, "low": 1, "medium": 2, "high": 3},
            },
        },
        "0052": CMD_DISPLAY_SWITCH,  # Display switch: Disabled (0) or Enabled (1)
        "0057": CMD_REALTIME_TRIGGER,  # for regular status messages 0405 etc
        # Interval: ~3-5 seconds, but only with realtime trigger
        "0405": _A1722_0405,
        # Interval: Irregular, triggered on app actions, no fixed interval
        "0830": _PPS_VERSIONS_0830,
    },
    # SOLIX C200(X) A1725
    "A1725": {
        "0045": CMD_DEVICE_TIMEOUT_MIN,  # Device timeout: 0 (Never), 30, 60, 120, 240, 360, 720, 1440 minutes
        "0046": CMD_DISPLAY_TIMEOUT_SEC,  # Options in seconds: 20, 30, 60, 300, 1800 seconds
        "004c": CMD_DISPLAY_MODE,  # Display brightness: Low (1), Medium (2), High (3)
        "0050": CMD_TEMP_UNIT,  # Temperature unit switch: Celsius (0) or Fahrenheit (1)
        "0052": CMD_DISPLAY_SWITCH,  # Display switch: Disabled (0) or Enabled (1)
        "0057": CMD_REALTIME_TRIGGER,  # for regular status messages 0405 etc
        "0401": _A1725_0401,  # Interval: Irregular, triggered on app/device actions
        "0405": _A1725_0405,  # Interval: ~3-5 seconds, but only with realtime trigger
    },
    # PPS C300 DC
    "A1726": {
        "0043": CMD_DC_OUTPUT_TIMEOUT_SEC  # DC output timeout: Custom Range 0-86100 seconds
        | {
            "a2": {
                **CMD_DC_OUTPUT_TIMEOUT_SEC["a2"],
                VALUE_MAX: 86100,
            },
        },
        "004b": CMD_DC_OUTPUT_SWITCH,  # DC output switch: Disabled (0) or Enabled (1)
        "004f": CMD_LIGHT_MODE  # LED mode: Off (0), Low (1), Medium (2), High (3)
        | {
            "a2": {
                **CMD_LIGHT_MODE["a2"],
                VALUE_OPTIONS: {"off": 0, "low": 1, "medium": 2, "high": 3},
            },
        },
        "0050": CMD_TEMP_UNIT,  # Temperature unit switch: Celsius (0) or Fahrenheit (1)
        "0052": CMD_DISPLAY_SWITCH,  # Display switch: Disabled (0) or Enabled (1)
        "0057": CMD_REALTIME_TRIGGER,  # for regular status messages 0405 etc
        "0401": _A1728_0401,  # Interval: Irregular, triggered on app/device actions, no fixed interval
        "0404": _A1728_0404,  # Interval: Irregular, triggered on app action, no fixed interval
        "0405": _A1728_0405,  # Interval: ~3-5 seconds, but only with realtime trigger
        "0830": _PPS_VERSIONS_0830,  # Interval: Irregular, triggered on app actions, no fixed interval
    },
    # SOLIX C200 DC A1727
    "A1727": {
        "0045": CMD_DEVICE_TIMEOUT_MIN,  # Device timeout: 0 (Never), 30, 60, 120, 240, 360, 720, 1440 minutes
        "0046": CMD_DISPLAY_TIMEOUT_SEC,  # Options in seconds: 20, 30, 60, 300, 1800 seconds
        "004c": CMD_DISPLAY_MODE,  # Display brightness: Low (1), Medium (2), High (3)
        "0050": CMD_TEMP_UNIT,  # Temperature unit switch: Celsius (0) or Fahrenheit (1)
        "0052": CMD_DISPLAY_SWITCH,  # Display switch: Disabled (0) or Enabled (1)
        "0057": CMD_REALTIME_TRIGGER,  # for regular status messages 0405 etc
        "0401": _A1725_0401,  # Interval: Irregular, triggered on app/device actions
        "0405": _A1725_0405,  # Interval: ~3-5 seconds, but only with realtime trigger
    },
    # PPS C300X DC
    "A1728": {
        "0043": CMD_DC_OUTPUT_TIMEOUT_SEC  # DC output timeout: Custom Range 0-86100 seconds
        | {
            "a2": {
                **CMD_DC_OUTPUT_TIMEOUT_SEC["a2"],
                VALUE_MAX: 86100,
            },
        },
        "004b": CMD_DC_OUTPUT_SWITCH,  # DC output switch: Disabled (0) or Enabled (1)
        "004f": CMD_LIGHT_MODE  # LED mode: Off (0), Low (1), Medium (2), High (3)
        | {
            "a2": {
                **CMD_LIGHT_MODE["a2"],
                VALUE_OPTIONS: {"off": 0, "low": 1, "medium": 2, "high": 3},
            },
        },
        "0050": CMD_TEMP_UNIT,  # Temperature unit switch: Celsius (0) or Fahrenheit (1)
        "0052": CMD_DISPLAY_SWITCH,  # Display switch: Disabled (0) or Enabled (1)
        "0057": CMD_REALTIME_TRIGGER,  # for regular status messages 0405 etc
        "0401": _A1728_0401,  # Interval: Irregular, triggered on app/device actions, no fixed interval
        "0404": _A1728_0404,  # Interval: Irregular, triggered on app action, no fixed interval
        "0405": _A1728_0405,  # Interval: ~3-5 seconds, but only with realtime trigger
        "0830": _PPS_VERSIONS_0830,  # Interval: Irregular, triggered on app actions, no fixed interval
    },
    # SOLIX C200X DC A1729
    "A1729": {
        "0045": CMD_DEVICE_TIMEOUT_MIN,  # Device timeout: 0 (Never), 30, 60, 120, 240, 360, 720, 1440 minutes
        "0046": CMD_DISPLAY_TIMEOUT_SEC,  # Options in seconds: 20, 30, 60, 300, 1800 seconds
        "004c": CMD_DISPLAY_MODE,  # Display brightness: Low (1), Medium (2), High (3)
        "0050": CMD_TEMP_UNIT,  # Temperature unit switch: Celsius (0) or Fahrenheit (1)
        "0052": CMD_DISPLAY_SWITCH,  # Display switch: Disabled (0) or Enabled (1)
        "0057": CMD_REALTIME_TRIGGER,  # for regular status messages 0405 etc
        "0401": _A1725_0401,  # Interval: Irregular, triggered on app/device actions
        "0405": _A1729_0405,  # Interval: ~3-5 seconds, but only with realtime trigger
        "0830": _PPS_VERSIONS_0830,  # Interval: Irregular, triggered on app actions, no fixed interval
    },
    # PPS C1000(X) + B1000 Extension
    "A1761": {
        "0044": CMD_AC_CHARGE_LIMIT
        | {
            "a2": {
                **CMD_AC_CHARGE_LIMIT["a2"],
                VALUE_MIN: 100,
                VALUE_MAX: 1000,
                VALUE_STEP: 100,
            }
        },
        "0045": CMD_DEVICE_TIMEOUT_MIN,  # Options in minutes: 0 (Never), 30, 60, 120, 240, 360, 720, 1440
        "0046": CMD_DISPLAY_TIMEOUT_SEC,  # Options in seconds: 20, 30, 60, 300, 1800 seconds
        "004a": CMD_AC_OUTPUT_SWITCH,  # AC output switch: Disabled (0) or Enabled (1)
        "004b": CMD_DC_OUTPUT_SWITCH,  # DC output switch: Disabled (0) or Enabled (1)
        "004c": CMD_DISPLAY_MODE,  # Display brightness: Off (0), Low (1), Medium (2), High (3)
        "004f": CMD_LIGHT_MODE,  # LED mode: Off (0), Low (1), Medium (2), High (3), Blinking (4)
        # "00x0": CMD_AC_CHARGE_LIMIT,  # TODO: Update correct message type, What is the range/steps/options? 100-800 W, step 100?
        "0050": CMD_TEMP_UNIT,  # Temperature unit switch: Celsius (0) or Fahrenheit (1)
        "0052": CMD_DISPLAY_SWITCH,  # Display switch: Disabled (0) or Enabled (1)
        "0057": CMD_REALTIME_TRIGGER,  # for regular status messages 0405 etc
        "005e": CMD_AC_FAST_CHARGE_SWITCH,  # Ultrafast charge switch: Disabled (0) or Enabled (1)
        "0076": CMD_DC_12V_OUTPUT_MODE,  # Normal (1), Smart (0)
        "0077": CMD_AC_OUTPUT_MODE,  # Normal (1), Smart (0)
        # Interval: ~3-5 seconds, but only with realtime trigger
        "0405": _A1761_0405,
        # Interval: varies, probably upon change
        "0407": _0407,
        # Interval: Irregular, triggered on app actions, no fixed interval
        "0830": _PPS_VERSIONS_0830,
    },
    # PPS C1000 Gen 2
    "A1763": {
        "0057": CMD_REALTIME_TRIGGER,  # for regular status messages 0405 etc
        "0101": {
            # AC command group
            COMMAND_LIST: [
                SolixMqttCommands.ac_output_switch,  # field a2
                SolixMqttCommands.ac_output_timeout_seconds,  # field a3
                SolixMqttCommands.ac_charge_limit,  # field a4
                SolixMqttCommands.ac_output_mode_select,  # field a6
            ],
            SolixMqttCommands.ac_output_switch: CMD_COMMON_V2
            | {
                "a2": {
                    NAME: "set_ac_output_switch",  # Disable (0) | Enable (1)
                    TYPE: DeviceHexDataTypes.ui.value,
                    STATE_NAME: "ac_output_power_switch",
                    VALUE_OPTIONS: {"off": 0, "on": 1},
                },
            },
            SolixMqttCommands.ac_output_timeout_seconds: CMD_COMMON_V2
            | {
                "a3": {
                    NAME: "set_ac_output_timeout_seconds",  # Timeout seconds, custom range: 0-86400, step 300
                    TYPE: DeviceHexDataTypes.var.value,
                    STATE_NAME: "ac_output_timeout_seconds",
                    VALUE_MIN: 0,
                    VALUE_MAX: 86400,
                    VALUE_STEP: 300,
                },
            },
            SolixMqttCommands.ac_charge_limit: CMD_COMMON_V2
            | {
                "a4": {
                    NAME: "set_ac_input_limit",  # in W; min: 100, max: 1200, step: 100
                    TYPE: DeviceHexDataTypes.sile.value,
                    STATE_NAME: "ac_input_limit",
                    VALUE_MIN: 100,
                    VALUE_MAX: 1200,
                    VALUE_STEP: 100,
                },
            },
            SolixMqttCommands.ac_output_mode_select: CMD_COMMON_V2
            | {
                "a6": {
                    NAME: "set_ac_output_mode",  # Normal (0), Smart (1)
                    TYPE: DeviceHexDataTypes.ui.value,
                    STATE_NAME: "ac_output_mode",
                    VALUE_OPTIONS: {"normal": 0, "smart": 1},
                },
            },
        },
        "0102": {
            # DC command group
            COMMAND_LIST: [
                SolixMqttCommands.dc_output_switch,  # field a2
                SolixMqttCommands.dc_output_timeout_seconds,  # field a3
                SolixMqttCommands.dc_12v_output_mode_select,  # field a4
            ],
            SolixMqttCommands.dc_output_switch: CMD_COMMON_V2
            | {
                "a2": {
                    NAME: "set_dc_output_switch",  # Disable (0) | Enable (1)
                    TYPE: DeviceHexDataTypes.ui.value,
                    STATE_NAME: "dc_output_power_switch",
                    VALUE_OPTIONS: {"off": 0, "on": 1},
                },
            },
            SolixMqttCommands.dc_output_timeout_seconds: CMD_COMMON_V2
            | {
                "a3": {
                    NAME: "set_dc_output_timeout_seconds",  # Timeout seconds, custom range: 0-86400, step 300
                    TYPE: DeviceHexDataTypes.var.value,
                    STATE_NAME: "dc_output_timeout_seconds",
                    VALUE_MIN: 0,
                    VALUE_MAX: 86400,
                    VALUE_STEP: 300,
                },
            },
            SolixMqttCommands.dc_12v_output_mode_select: CMD_COMMON_V2
            | {
                "a4": {
                    NAME: "set_dc_12v_output_mode",  # Normal (0), Smart (0)
                    TYPE: DeviceHexDataTypes.ui.value,
                    STATE_NAME: "dc_12v_output_mode",
                    VALUE_OPTIONS: {"normal": 0, "smart": 1},
                },
            },
        },
        "0103": {
            # Other command group
            COMMAND_LIST: [
                SolixMqttCommands.display_switch,  # field a2
                SolixMqttCommands.display_mode_select,  # field a3
                SolixMqttCommands.display_timeout_seconds,  # field a4
                SolixMqttCommands.device_timeout_minutes,  # field a6
                SolixMqttCommands.port_memory_switch,  # field a8
                SolixMqttCommands.soc_limits,  # field aa, ab
            ],
            SolixMqttCommands.display_switch: CMD_COMMON_V2
            | {
                "a2": {
                    NAME: "set_display_switch",  # Off (0), On (1)
                    TYPE: DeviceHexDataTypes.ui.value,
                    STATE_NAME: "display_switch",
                    VALUE_OPTIONS: {"off": 0, "on": 1},
                },
            },
            SolixMqttCommands.display_mode_select: CMD_COMMON_V2
            | {
                "a3": {
                    NAME: "set_display_mode",  # Low (1), Medium (2), High (3)
                    TYPE: DeviceHexDataTypes.ui.value,
                    STATE_NAME: "display_mode",
                    VALUE_OPTIONS: {"low": 1, "medium": 2, "high": 3},
                },
            },
            SolixMqttCommands.display_timeout_seconds: CMD_COMMON_V2
            | {
                "a4": {
                    NAME: "set_display_timeout_sec",  # 0 (Never), 10, 20, 30, 60, 300, 1800
                    TYPE: DeviceHexDataTypes.sile.value,
                    STATE_NAME: "display_timeout_seconds",
                    VALUE_OPTIONS: [0, 10, 20, 30, 60, 300, 1800],
                },
            },
            SolixMqttCommands.device_timeout_minutes: CMD_COMMON_V2
            | {
                "a6": {
                    NAME: "set_device_timeout_min",  # 0 (Never), 30, 60, 120, 240, 360, 720, 1440
                    TYPE: DeviceHexDataTypes.sile.value,
                    STATE_NAME: "device_timeout_minutes",
                    VALUE_OPTIONS: [0, 30, 60, 120, 240, 360, 720, 1440],
                },
            },
            SolixMqttCommands.port_memory_switch: CMD_COMMON_V2
            | {
                "a8": {
                    NAME: "set_port_memory_switch",  # Off (0), On (1)
                    TYPE: DeviceHexDataTypes.ui.value,
                    STATE_NAME: "port_memory_switch",
                    VALUE_OPTIONS: {"off": 0, "on": 1},
                },
            },
            SolixMqttCommands.soc_limits: CMD_SOC_LIMITS_V2,
            # Contains fields aa ab for the limits
            # aa = max_soc: 80, 85, 90, 95, 100 %
            # ab = min_soc: 1, 5, 10, 15, 20 %
        },
        # Interval: ~3-5 seconds, but only with realtime trigger
        "0421": _A1763_0421,
        # Interval: Irregular, triggered on app actions, no fixed interval
        "0830": _PPS_VERSIONS_0830,
        # Interval: ~300 seconds
        "0889": {
            "a4": {NAME: "0889_unknown_1?"},
            "a5": {NAME: "0889_unknown_2?"},
            "a6": {NAME: "0889_unknown_3?"},
            "fd": {NAME: "0889_timestamp?"},
        },
        # Interval: Irregular, maybe on changes or as response to App status request? Same content as 0421
        "0900": _A1763_0421,
    },
    # PPS C2000 Gen 2
    "A1783": {
        "0057": CMD_REALTIME_TRIGGER,  # for regular status messages 0405 etc
        "0101": {
            # AC command group
            COMMAND_LIST: [
                SolixMqttCommands.ac_output_switch,  # field a2
                SolixMqttCommands.ac_output_timeout_seconds,  # field a3
                SolixMqttCommands.ac_charge_limit,  # field a4
                SolixMqttCommands.ac_output_mode_select,  # field a6
            ],
            SolixMqttCommands.ac_output_switch: CMD_COMMON_V2
            | {
                "a2": {
                    NAME: "set_ac_output_switch",  # Disable (0) | Enable (1)
                    TYPE: DeviceHexDataTypes.ui.value,
                    STATE_NAME: "ac_output_power_switch",
                    VALUE_OPTIONS: {"off": 0, "on": 1},
                },
            },
            SolixMqttCommands.ac_charge_limit: CMD_COMMON_V2
            | {
                "a4": {
                    NAME: "set_ac_input_limit",  # in W; min: 200, max: 1800-2400, step: 100
                    TYPE: DeviceHexDataTypes.sile.value,
                    STATE_NAME: "ac_input_limit",
                    VALUE_MIN: 200,
                    VALUE_MAX: 1800,  # lowest limit for all variants
                    VALUE_MAX_STATE: "ac_input_limit_max",  # adopt limit based on device variant
                    VALUE_STEP: 100,
                },
            },
            SolixMqttCommands.ac_output_timeout_seconds: CMD_COMMON_V2
            | {
                "a3": {
                    NAME: "set_ac_output_timeout_seconds",  # Timeout seconds, custom range: 0-86400, step 300
                    TYPE: DeviceHexDataTypes.var.value,
                    STATE_NAME: "ac_output_timeout_seconds",
                    VALUE_MIN: 0,
                    VALUE_MAX: 86400,
                    VALUE_STEP: 300,
                },
            },
            SolixMqttCommands.ac_output_mode_select: CMD_COMMON_V2
            | {
                "a6": {
                    NAME: "set_ac_output_mode",  # Normal (0), Smart (1)
                    TYPE: DeviceHexDataTypes.ui.value,
                    STATE_NAME: "ac_output_mode",
                    VALUE_OPTIONS: {"normal": 0, "smart": 1},
                },
            },
        },
        "0102": {
            # DC command group
            COMMAND_LIST: [
                SolixMqttCommands.dc_output_switch,  # field a2
                SolixMqttCommands.dc_12v_output_mode_select,  # field a4
            ],
            SolixMqttCommands.dc_output_switch: CMD_COMMON_V2
            | {
                "a2": {
                    NAME: "set_dc_output_switch",  # Disable (0) | Enable (1)
                    TYPE: DeviceHexDataTypes.ui.value,
                    STATE_NAME: "dc_output_power_switch",
                    VALUE_OPTIONS: {"off": 0, "on": 1},
                },
            },
            SolixMqttCommands.dc_12v_output_mode_select: CMD_COMMON_V2
            | {
                "a4": {
                    NAME: "set_dc_12v_output_mode",  # Normal (0), Smart (0)
                    TYPE: DeviceHexDataTypes.ui.value,
                    STATE_NAME: "dc_12v_output_mode",
                    VALUE_OPTIONS: {"normal": 0, "smart": 1},
                },
            },
        },
        "0103": {
            # Other command group
            COMMAND_LIST: [
                SolixMqttCommands.display_switch,  # field a2
                SolixMqttCommands.display_mode_select,  # field a3
                SolixMqttCommands.display_timeout_seconds,  # field a4
                SolixMqttCommands.device_timeout_minutes,  # field a6
                SolixMqttCommands.port_memory_switch,  # field a8
                SolixMqttCommands.soc_limits,  # field aa, ab
            ],
            SolixMqttCommands.display_switch: CMD_COMMON_V2
            | {
                "a2": {
                    NAME: "set_display_switch",  # Off (0), On (1)
                    TYPE: DeviceHexDataTypes.ui.value,
                    STATE_NAME: "display_switch",
                    VALUE_OPTIONS: {"off": 0, "on": 1},
                },
            },
            SolixMqttCommands.display_mode_select: CMD_COMMON_V2
            | {
                "a3": {
                    NAME: "set_display_mode",  # Low (1), Medium (2), High (3)
                    TYPE: DeviceHexDataTypes.ui.value,
                    STATE_NAME: "display_mode",
                    VALUE_OPTIONS: {"low": 1, "medium": 2, "high": 3},
                },
            },
            SolixMqttCommands.display_timeout_seconds: CMD_COMMON_V2
            | {
                "a4": {
                    NAME: "set_display_timeout_sec",  # 0 (Never), 10, 20, 30, 60, 300, 1800
                    TYPE: DeviceHexDataTypes.sile.value,
                    STATE_NAME: "display_timeout_seconds",
                    VALUE_OPTIONS: [0, 10, 20, 30, 60, 300, 1800],
                },
            },
            SolixMqttCommands.device_timeout_minutes: CMD_COMMON_V2
            | {
                "a6": {
                    NAME: "set_device_timeout_min",  # 0 (Never), 30, 60, 120, 240, 360, 720, 1440
                    TYPE: DeviceHexDataTypes.sile.value,
                    STATE_NAME: "device_timeout_minutes",
                    VALUE_OPTIONS: [0, 30, 60, 120, 240, 360, 720, 1440],
                },
            },
            SolixMqttCommands.port_memory_switch: CMD_COMMON_V2
            | {
                "a8": {
                    NAME: "set_port_memory_switch",  # Off (0), On (1)
                    TYPE: DeviceHexDataTypes.ui.value,
                    STATE_NAME: "port_memory_switch",
                    VALUE_OPTIONS: {"off": 0, "on": 1},
                },
            },
            SolixMqttCommands.soc_limits: CMD_SOC_LIMITS_V2,
            # Contains fields aa ab for the limits
            # aa = max_soc: 80, 85, 90, 95, 100 %
            # ab = min_soc: 1, 5, 10, 15, 20 %
        },
        # Interval: ~3-5 seconds, but only with realtime trigger
        "0421": _A1783_0421,
        # Interval: Irregular, triggered on app actions, no fixed interval
        "0830": _PPS_VERSIONS_0830,
        # Interval: Irregular, maybe on changes or as response to App status request? Same content as 0421
        "0900": _A1783_0421,
    },
    # PPS F2000
    "A1780": {
        "0044": CMD_AC_CHARGE_LIMIT  # in W; min: 100, max: 1440, step: 100
        | {
            "a2": {
                **CMD_AC_CHARGE_LIMIT["a2"],
                VALUE_MIN: 100,
                VALUE_MAX: 1440,
                VALUE_STEP: 100,
            }
        },
        "0045": CMD_DEVICE_TIMEOUT_MIN,  # Options in minutes: 0 (Never), 30, 60, 120, 240, 360, 720, 1440
        "0046": CMD_DISPLAY_TIMEOUT_SEC,  # Options in seconds: 20, 30, 60, 300, 1800 seconds
        "004a": CMD_AC_OUTPUT_SWITCH,  # AC output switch: Disabled (0) or Enabled (1)
        "004b": CMD_DC_OUTPUT_SWITCH,  # DC output switch: Disabled (0) or Enabled (1)
        "004c": CMD_DISPLAY_MODE,  # Display brightness: Off (0), Low (1), Medium (2), High (3)
        "004f": CMD_LIGHT_MODE,  # LED mode: Off (0), Low (1), Medium (2), High (3), Blinking (4)
        "0052": CMD_DISPLAY_SWITCH,  # Display switch: Disabled (0) or Enabled (1)
        "0050": CMD_TEMP_UNIT,  # Temperature unit switch: Celsius (0) or Fahrenheit (1)
        "0057": CMD_REALTIME_TRIGGER,  # for regular status messages 0405 etc
        # Interval: ~3-5 seconds, but only with realtime trigger
        "0405": _A1780_0405,
        # Interval: irregular, triggerd by wifi signal change?
        "0407": _PPS_0407,
        # Interval: ??
        "0408": _A1780_0408,
        # Interval: Irregular, triggered on app actions, no fixed interval
        "0830": _PPS_VERSIONS_0830,
    },
    # PPS F2000 Plus
    "A1780P": {
        "0044": CMD_AC_CHARGE_LIMIT  # in W; min: 100, max: 1440, step: 100
        | {
            "a2": {
                **CMD_AC_CHARGE_LIMIT["a2"],
                VALUE_MIN: 100,
                VALUE_MAX: 1440,
                VALUE_STEP: 100,
            }
        },
        "0045": CMD_DEVICE_TIMEOUT_MIN,  # Options in minutes: 0 (Never), 30, 60, 120, 240, 360, 720, 1440
        "0046": CMD_DISPLAY_TIMEOUT_SEC,  # Options in seconds: 20, 30, 60, 300, 1800 seconds
        "004a": CMD_AC_OUTPUT_SWITCH,  # AC output switch: Disabled (0) or Enabled (1)
        "004b": CMD_DC_OUTPUT_SWITCH,  # DC output switch: Disabled (0) or Enabled (1)
        "004c": CMD_DISPLAY_MODE,  # Display brightness: Off (0), Low (1), Medium (2), High (3)
        "004f": CMD_LIGHT_MODE,  # LED mode: Off (0), Low (1), Medium (2), High (3), Blinking (4)
        "0052": CMD_DISPLAY_SWITCH,  # Display switch: Disabled (0) or Enabled (1)
        "0050": CMD_TEMP_UNIT,  # Temperature unit switch: Celsius (0) or Fahrenheit (1)
        "0057": CMD_REALTIME_TRIGGER,  # for regular status messages 0405 etc
        # Interval: ~3-5 seconds, but only with realtime trigger
        "0405": _A1780_0405,
        # Interval: irregular, triggerd by wifi signal change?
        "0407": _PPS_0407,
        # Interval: ??
        "0408": _A1780_0408,
        # Interval: Irregular, triggered on app actions, no fixed interval
        "0830": _PPS_VERSIONS_0830,
    },
    # PPS F3800
    "A1790": {
        "0044": CMD_AC_CHARGE_LIMIT  # Range: 100-1800 W, Step: 100 W
        | {
            "a2": {
                **CMD_AC_CHARGE_LIMIT["a2"],
                VALUE_MIN: 100,
                VALUE_MAX: 1800,
                VALUE_MAX_STATE: "ac_charge_limit_max",  # adopt limit based on device variant
                VALUE_STEP: 100,
            }
        },
        "0045": CMD_DEVICE_TIMEOUT_MIN,  # Options in minutes: 0 (Never), 30, 60, 120, 240, 360, 720, 1440
        "0046": CMD_DISPLAY_TIMEOUT_SEC,  # Options in seconds: 20, 30, 60, 300, 1800 seconds
        "004a": CMD_AC_OUTPUT_SWITCH,  # AC output switch: Disabled (0) or Enabled (1)
        "004b": CMD_DC_OUTPUT_SWITCH,  # DC output switch: Disabled (0) or Enabled (1)
        "004c": CMD_DISPLAY_MODE,  # Display brightness: Off (0), Low (1), Medium (2), High (3)
        "004f": CMD_LIGHT_MODE,  # LEF mode: Off (0), Low (1), Medium (2), High (3), Blinking (4)
        "0050": CMD_TEMP_UNIT,  # Temperature unit switch: Celsius (0) or Fahrenheit (1)
        "0052": CMD_DISPLAY_SWITCH,
        "0057": CMD_REALTIME_TRIGGER,  # for regular status messages 0405 etc
        "0076": CMD_DC_12V_OUTPUT_MODE,  # Normal (1), Smart (0)
        "0077": CMD_AC_OUTPUT_MODE,  # Normal (1), Smart (0)
        "0079": CMD_PORT_MEMORY_SWITCH,  # Port Memory switch: Disabled (0) or Enabled (1)
        # Interval: ~3-5 seconds, but only with realtime trigger
        "0405": _A1790_0405,
        # Interval: irregular, triggerd by wifi signal change?
        "0407": _PPS_0407,
        # Interval: ??
        "040a": _A1790_040a,
        # Interval: ??
        "0410": _A1790_0410,
        # Interval: ??
        "0804": _A1790_0804,
        # Interval: Irregular, triggered on app actions, no fixed interval
        "0830": _PPS_VERSIONS_0830,
        # Interval: ??
        "0840": _A1790_0405,
    },
    # PPS F3800 Plus
    "A1790P": {
        "0044": CMD_AC_CHARGE_LIMIT  # Range: 100-1800 W, Step: 100 W
        | {
            "a2": {
                **CMD_AC_CHARGE_LIMIT["a2"],
                VALUE_MIN: 100,
                VALUE_MAX: 1800,
                VALUE_MAX_STATE: "ac_charge_limit_max",  # adopt limit based on device variant
                VALUE_STEP: 100,
            }
        },
        "0045": CMD_DEVICE_TIMEOUT_MIN,  # Options in minutes: 0 (Never), 30, 60, 120, 240, 360, 720, 1440
        "0046": CMD_DISPLAY_TIMEOUT_SEC,  # Options in seconds: 20, 30, 60, 300, 1800 seconds
        "004a": CMD_AC_OUTPUT_SWITCH,  # AC output switch: Disabled (0) or Enabled (1)
        "004b": CMD_DC_OUTPUT_SWITCH,  # DC output switch: Disabled (0) or Enabled (1)
        "004c": CMD_DISPLAY_MODE,  # Display brightness: Off (0), Low (1), Medium (2), High (3)
        "004f": CMD_LIGHT_MODE,  # LEF mode: Off (0), Low (1), Medium (2), High (3), Blinking (4)
        "0050": CMD_TEMP_UNIT,  # Temperature unit switch: Celsius (0) or Fahrenheit (1)
        "0052": CMD_DISPLAY_SWITCH,
        "0057": CMD_REALTIME_TRIGGER,  # for regular status messages 0405 etc
        "0076": CMD_DC_12V_OUTPUT_MODE,  # Normal (1), Smart (0)
        "0077": CMD_AC_OUTPUT_MODE,  # Normal (1), Smart (0)
        "0079": CMD_PORT_MEMORY_SWITCH,  # Enabled (1), Disabled (0)
        # Interval: ~3-5 seconds, but only with realtime trigger
        "0405": _A1790_0405,
        # Interval: irregular, triggerd by wifi signal change?
        "0407": _PPS_0407,
        # Interval: ??
        "040a": _A1790_040a,
        # Interval: ??
        "0410": _A1790_0410,
        # Interval: ??
        "0804": _A1790_0804,
        # Interval: Irregular, triggered on app actions, no fixed interval
        "0830": _PPS_VERSIONS_0830,
        # Interval: ??
        "0840": _A1790_0405,
    },
    # Solarbank PPS F3000
    "A1782": {
        "0057": CMD_REALTIME_TRIGGER,  # for regular status messages
        "0101": {
            # AC command group
            COMMAND_LIST: [
                SolixMqttCommands.ac_output_switch,  # field a2
                SolixMqttCommands.ac_output_timeout_seconds,  # field a3
                SolixMqttCommands.ac_charge_limit,  # field a4
                SolixMqttCommands.ac_output_mode_select,  # field a6
            ],
            SolixMqttCommands.ac_output_switch: CMD_COMMON_V2
            | {
                "a2": {
                    NAME: "set_ac_output_switch",  # Disable (0) | Enable (1)
                    TYPE: DeviceHexDataTypes.ui.value,
                    STATE_NAME: "ac_output_power_switch",
                    VALUE_OPTIONS: {"off": 0, "on": 1},
                },
            },
            SolixMqttCommands.ac_output_timeout_seconds: CMD_COMMON_V2
            | {
                "a3": {
                    NAME: "set_ac_output_timeout_seconds",  # Timeout seconds, custom range: 0-86400, step 300
                    TYPE: DeviceHexDataTypes.var.value,
                    STATE_NAME: "ac_output_timeout_seconds",
                    VALUE_MIN: 0,
                    VALUE_MAX: 86400,
                    VALUE_STEP: 300,
                },
            },
            SolixMqttCommands.ac_charge_limit: CMD_COMMON_V2
            | {
                "a4": {
                    NAME: "set_ac_input_limit",  # in W; min: 200, max: 1800, step: 100
                    TYPE: DeviceHexDataTypes.sile.value,
                    STATE_NAME: "ac_input_limit",
                    VALUE_MIN: 200,
                    VALUE_MAX: 1800,
                    VALUE_MAX_STATE: "ac_input_limit_max",
                    VALUE_STEP: 100,
                },
            },
            SolixMqttCommands.ac_output_mode_select: CMD_COMMON_V2
            | {
                "a6": {
                    NAME: "set_ac_output_mode",  # Normal (0), Smart (1)
                    TYPE: DeviceHexDataTypes.ui.value,
                    STATE_NAME: "ac_output_mode",
                    VALUE_OPTIONS: {"normal": 0, "smart": 1},
                },
            },
        },
        "0102": {
            # DC command group
            COMMAND_LIST: [
                SolixMqttCommands.dc_output_switch,  # field a2
                SolixMqttCommands.dc_output_timeout_seconds,  # field a3
                SolixMqttCommands.dc_12v_output_mode_select,  # field a4
            ],
            SolixMqttCommands.dc_output_switch: CMD_COMMON_V2
            | {
                "a2": {
                    NAME: "set_dc_output_switch",  # Disable (0) | Enable (1)
                    TYPE: DeviceHexDataTypes.ui.value,
                    STATE_NAME: "dc_output_power_switch",
                    VALUE_OPTIONS: {"off": 0, "on": 1},
                },
            },
            SolixMqttCommands.dc_output_timeout_seconds: CMD_COMMON_V2
            | {
                "a3": {
                    NAME: "set_dc_output_timeout_seconds",  # Timeout seconds, custom range: 0-86400, step 300
                    TYPE: DeviceHexDataTypes.var.value,
                    STATE_NAME: "dc_output_timeout_seconds",
                    VALUE_MIN: 0,
                    VALUE_MAX: 86400,
                    VALUE_STEP: 300,
                },
            },
            SolixMqttCommands.dc_12v_output_mode_select: CMD_COMMON_V2
            | {
                "a4": {
                    NAME: "set_dc_12v_output_mode",  # Normal (0), Smart (1)
                    TYPE: DeviceHexDataTypes.ui.value,
                    STATE_NAME: "dc_12v_output_mode",
                    VALUE_OPTIONS: {"normal": 0, "smart": 1},
                },
            },
        },
        "0103": {
            # Other command group
            COMMAND_LIST: [
                SolixMqttCommands.display_switch,  # field a2
                SolixMqttCommands.display_mode_select,  # field a3
                SolixMqttCommands.display_timeout_seconds,  # field a4
                SolixMqttCommands.device_timeout_minutes,  # field a6
                SolixMqttCommands.light_mode_select,  # field a7
                SolixMqttCommands.port_memory_switch,  # field a8
                SolixMqttCommands.soc_limits,  # field aa, ab
            ],
            SolixMqttCommands.display_switch: CMD_COMMON_V2
            | {
                "a2": {
                    NAME: "set_display_switch",  # Off (0), On (1)
                    TYPE: DeviceHexDataTypes.ui.value,
                    STATE_NAME: "display_switch",
                    VALUE_OPTIONS: {"off": 0, "on": 1},
                },
            },
            SolixMqttCommands.display_mode_select: CMD_COMMON_V2
            | {
                "a3": {
                    NAME: "set_display_mode",  # Low (1), Medium (2), High (3)
                    TYPE: DeviceHexDataTypes.ui.value,
                    STATE_NAME: "display_mode",
                    VALUE_OPTIONS: {"low": 1, "medium": 2, "high": 3},
                },
            },
            SolixMqttCommands.display_timeout_seconds: CMD_COMMON_V2
            | {
                "a4": {
                    NAME: "set_display_timeout_sec",  # 0 (Never), 10, 20, 30, 60, 300, 1800
                    TYPE: DeviceHexDataTypes.sile.value,
                    STATE_NAME: "display_timeout_seconds",
                    VALUE_OPTIONS: [0, 10, 20, 30, 60, 300, 1800],
                },
            },
            SolixMqttCommands.device_timeout_minutes: CMD_COMMON_V2
            | {
                "a6": {
                    NAME: "set_device_timeout_min",  # 0 (Never), 30, 60, 120, 240, 360, 720, 1440
                    TYPE: DeviceHexDataTypes.sile.value,
                    STATE_NAME: "device_timeout_minutes",
                    VALUE_OPTIONS: [0, 30, 60, 120, 240, 360, 720, 1440],
                },
            },
            SolixMqttCommands.light_mode_select: CMD_COMMON_V2
            | {
                "a7": {
                    NAME: "set_light_mode",  # Off (0), Low (1), Medium (2), High (3)
                    TYPE: DeviceHexDataTypes.ui.value,
                    STATE_NAME: "light_mode",
                    VALUE_OPTIONS: {"off": 0, "low": 1, "medium": 2, "high": 3},
                },
            },
            SolixMqttCommands.port_memory_switch: CMD_COMMON_V2
            | {
                "a8": {
                    NAME: "set_port_memory_switch",  # Off (0), On (1)
                    TYPE: DeviceHexDataTypes.ui.value,
                    STATE_NAME: "port_memory_switch",
                    VALUE_OPTIONS: {"off": 0, "on": 1},
                },
            },
            SolixMqttCommands.soc_limits: CMD_SOC_LIMITS_V2,
            # Contains fields aa ab for the limits
            # aa = max_soc: 80, 85, 90, 95, 100 %
            # ab = min_soc: 1, 5, 10, 15, 20 %
        },
        # Interval: irregular, triggerd by wifi signal change?
        "0407": _PPS_0407,
        "0421": _A1782_0421,
        "0502": _A1782_0502,
        # Upon request, followed by 0100 status request command
        "0900": _A1782_0421,  # Same content as 0421
    },
    # Solarbank 1 E1600
    "A17C0": {
        "0040": CMD_STATUS_REQUEST,  # Device status request, more reliable than RT (one time status messages 0405 etc)
        "0050": CMD_TEMP_UNIT,  # Temperature unit switch: Celsius (0) or Fahrenheit (1)
        "0056": CMD_SB_STATUS_CHECK,  # Complex command with multiple parms
        "0057": CMD_REALTIME_TRIGGER,  # Works only in certain states for status messages 0405 etc
        "0067": CMD_SB_POWER_CUTOFF,  # Complex command with multiple parms
        "0068": CMD_SB_INVERTER_TYPE,  # Complex command with multiple parms
        "0405": {
            # Interval: ~5 seconds with realtime trigger, or immediately with status request
            TOPIC: "param_info",
            "a2": {NAME: "device_sn"},
            "a3": {NAME: "battery_soc"},
            "a4": {NAME: "405_unknown_1?"},
            "a5": {NAME: "error_code"},
            "a6": {NAME: "sw_version", "values": 1},
            "a7": {NAME: "sw_controller", "values": 1},
            "a8": {NAME: "hw_version", "values": 1},
            "a9": {NAME: "temp_unit_fahrenheit"},
            "aa": {NAME: "temperature", SIGNED: True},
            "ab": {NAME: "photovoltaic_power"},
            "ac": {NAME: "output_power"},
            "ad": {NAME: "charging_status?"},
            # "ae": Binary structure for schedule slots, dynamic size depending on schedule
            # 2 bytes LE for start/end time in minutes, 1 byte priority limit, Export switch switch setting and discharge prio in bitmask
            # Dynamic byte structures cannot be described, the schedule should be managed completely via Api
            "b0": {NAME: "bat_charge_power"},
            "b1": {NAME: "pv_yield", FACTOR: 0.0001},
            "b2": {NAME: "charged_energy", FACTOR: 0.0001},
            "b3": {NAME: "output_energy", FACTOR: 0.0001},
            "b4": {NAME: "output_cutoff_data"},
            "b5": {NAME: "lowpower_input_data"},
            "b6": {NAME: "input_cutoff_data"},
            "b7": {NAME: "inverter_brand"},
            "b8": {NAME: "inverter_model"},
            "b9": {NAME: "min_load"},
            "c0": {NAME: "0w_switch_sn"},
            "c1": {NAME: "0w_switch_bt_mac"},
            "fe": {NAME: "msg_timestamp"},
        },
        # Interval: varies, probably upon change
        "0407": _A17C0_0407,
        "0408": {
            # Interval: ~60 seconds
            TOPIC: "state_info",
            "a2": {NAME: "device_sn"},
            "a3": {NAME: "local_timestamp"},
            "a4": {NAME: "utc_timestamp"},
            "a5": {NAME: "battery_soc_calc", FACTOR: 0.001},
            "a6": {NAME: "battery_soh", FACTOR: 0.001},
            "a8": {NAME: "charging_status"},
            "a9": {NAME: "home_load_preset"},
            "aa": {NAME: "photovoltaic_power"},
            "ab": {NAME: "bat_charge_power"},
            "ac": {NAME: "output_power"},
            "ad": {NAME: "408_unknown_1?"},
            "ae": {NAME: "408_unknown_2?"},
            "af": {NAME: "408_unknown_3?"},
            "b0": {NAME: "battery_soc"},
            "b1": {NAME: "pv_yield", FACTOR: 0.0001},
            "b2": {NAME: "charged_energy", FACTOR: 0.0001},
            "b3": {NAME: "output_energy", FACTOR: 0.0001},
            "b4": {NAME: "discharged_energy", FACTOR: 0.0001},
            "b5": {NAME: "bypass_energy", FACTOR: 0.0001},
            "b6": {NAME: "temperature", SIGNED: True},
            "b7": {NAME: "pv_voltage", FACTOR: 0.01},
            "b8": {NAME: "output_voltage", FACTOR: 0.01},
            "b9": {NAME: "battery_voltage", FACTOR: 0.01},
        },
    },
    # Solarbank 2 E1600 Pro
    "A17C1": {
        "0050": CMD_TEMP_UNIT,  # Temperature unit switch: Celsius (0) or Fahrenheit (1)
        "0057": CMD_REALTIME_TRIGGER,  # for regular status messages 0405 etc
        "005a": CMD_SB_MAX_LOAD  # same pattern but different command for max load settings in parallel systems
        | {
            COMMAND_NAME: SolixMqttCommands.sb_max_load_parallel,
            "a2": {
                **CMD_SB_MAX_LOAD["a2"],
                VALUE_OPTIONS: [1200, 2400, 3600, 4800],
                VALUE_OPTIONS_STATE: "max_load_parallel_options",  # key to be used to provide valid options
            },
            "a3": {
                **CMD_SB_MAX_LOAD["a3"],
                VALUE_DEFAULT: 2,
            },
        },
        # Interval: ~3-5 seconds with realtime trigger, or immediately with status request
        "0067": CMD_SB_POWER_CUTOFF,  # Complex command with multiple parms
        "0068": {
            # solarbank light command group
            COMMAND_LIST: [
                SolixMqttCommands.sb_light_mode_select,  # field a2
                SolixMqttCommands.sb_light_switch,  # field a3
            ],
            SolixMqttCommands.sb_light_mode_select: CMD_SB_LIGHT_MODE,  # Normal (0), Mood light (1)
            SolixMqttCommands.sb_light_switch: CMD_SB_LIGHT_SWITCH,  # Light Off (1), Light On (0)
        },
        "0080": {
            # solarbank command group
            COMMAND_LIST: [
                SolixMqttCommands.sb_max_load,  # field a2, a3
                SolixMqttCommands.sb_disable_grid_export_switch,  # field a5, a6, a9
            ],
            SolixMqttCommands.sb_max_load: CMD_SB_MAX_LOAD  # 350,600,800,1000 W, may depend on country settings
            | {
                "a2": {
                    **CMD_SB_MAX_LOAD["a2"],
                    VALUE_OPTIONS: [350, 600, 800, 1000],
                    VALUE_OPTIONS_STATE: "max_load_options",  # key to be used to provide valid options
                }
            },
            SolixMqttCommands.sb_disable_grid_export_switch: CMD_SB_DISABLE_GRID_EXPORT_SWITCH,  # Grid export (0), Disable grid export (1)
        },
        "0405": _A17C1_0405,
        # Interval: varies, probably upon change
        "0407": _A17C0_0407,
        # Interval: ~300 seconds
        "0408": _A17C1_0408,
        # Expansion data
        # Interval: ~3-5 seconds, but only with realtime trigger
        "040a": _A17C1_040a,
    },
    # Solarbank 2 E1600 AC
    "A17C2": {
        "0050": CMD_TEMP_UNIT,  # Temperature unit switch: Celsius (0) or Fahrenheit (1)
        "0057": CMD_REALTIME_TRIGGER,  # for regular status messages 0405 etc
        "005a": CMD_SB_MAX_LOAD  # same pattern but different command for max load settings in parallel systems
        | {
            COMMAND_NAME: SolixMqttCommands.sb_max_load_parallel,
            "a2": {
                **CMD_SB_MAX_LOAD["a2"],
                VALUE_OPTIONS: [1200, 2400, 3600, 4800],
                VALUE_OPTIONS_STATE: "max_load_parallel_options",  # key to be used to provide valid options
            },
            "a3": {
                **CMD_SB_MAX_LOAD["a3"],
                VALUE_DEFAULT: 2,
            },
        },
        "0067": CMD_SB_POWER_CUTOFF,  # Complex command with multiple parms
        "0068": {
            # solarbank light command group
            COMMAND_LIST: [
                SolixMqttCommands.sb_light_mode_select,  # field a2
                SolixMqttCommands.sb_light_switch,  # field a3
            ],
            SolixMqttCommands.sb_light_mode_select: CMD_SB_LIGHT_MODE,  # Normal (0), Mood light (1)
            SolixMqttCommands.sb_light_switch: CMD_SB_LIGHT_SWITCH,  # Light Off (1), Light On (0)
        },
        "0080": {
            # solarbank command group
            COMMAND_LIST: [
                SolixMqttCommands.sb_max_load,  # field a2, a3
                SolixMqttCommands.sb_disable_grid_export_switch,  # field a5, a6, a9
                SolixMqttCommands.sb_ac_input_limit,  # field a8
            ],
            SolixMqttCommands.sb_max_load: CMD_SB_MAX_LOAD  # 350,600,800,1000,1200 W, may depend on country settings
            | {
                "a2": {
                    **CMD_SB_MAX_LOAD["a2"],
                    VALUE_OPTIONS: [350, 600, 800, 1000, 1200],
                    VALUE_OPTIONS_STATE: "max_load_options",  # key to be used to provide valid options
                }
            },
            SolixMqttCommands.sb_disable_grid_export_switch: CMD_SB_DISABLE_GRID_EXPORT_SWITCH,  # Grid export (0), Disable grid export (1)
            SolixMqttCommands.sb_ac_input_limit: CMD_SB_AC_INPUT_LIMIT,  # 0 - 1200 W, step: 100
        },
        # Interval: ~3-5 seconds with realtime trigger, or immediately with status request
        "0405": _A17C5_0405,
        # Interval: varies, probably upon change
        "0407": _A17C0_0407,
        # Interval: ~300 seconds
        "0408": _A17C5_0408,
        # Expansion data
        # Interval: ~3-5 seconds, but only with realtime trigger
        "040a": _A17C5_040a,
    },
    # Solarbank 2 E1600 Plus
    "A17C3": {
        "0050": CMD_TEMP_UNIT,  # Temperature unit switch: Celsius (0) or Fahrenheit (1)
        "0057": CMD_REALTIME_TRIGGER,  # for regular status messages 0405 etc
        "005a": CMD_SB_MAX_LOAD  # same pattern but different command for max load settings in parallel systems
        | {
            COMMAND_NAME: SolixMqttCommands.sb_max_load_parallel,
            "a2": {
                **CMD_SB_MAX_LOAD["a2"],
                VALUE_OPTIONS: [1200, 2400, 3600, 4800],
                VALUE_OPTIONS_STATE: "max_load_parallel_options",  # key to be used to provide valid options
            },
            "a3": {
                **CMD_SB_MAX_LOAD["a3"],
                VALUE_DEFAULT: 2,
            },
        },
        "0067": CMD_SB_POWER_CUTOFF,  # Complex command with multiple parms
        "0068": {
            # solarbank light command group
            COMMAND_LIST: [
                SolixMqttCommands.sb_light_mode_select,  # field a2
                SolixMqttCommands.sb_light_switch,  # field a3
            ],
            SolixMqttCommands.sb_light_mode_select: CMD_SB_LIGHT_MODE,  # Normal (0), Mood light (1)
            SolixMqttCommands.sb_light_switch: CMD_SB_LIGHT_SWITCH,  # Light Off (1), Light On (0)
        },
        "0080": {
            # solarbank command group
            COMMAND_LIST: [
                SolixMqttCommands.sb_max_load,  # field a2, a3
                SolixMqttCommands.sb_disable_grid_export_switch,  # field a5, a6, a9
            ],
            SolixMqttCommands.sb_max_load: CMD_SB_MAX_LOAD  # 350,600,800,1000 W, may depend on country settings
            | {
                "a2": {
                    **CMD_SB_MAX_LOAD["a2"],
                    VALUE_OPTIONS: [350, 600, 800, 1000],
                    VALUE_OPTIONS_STATE: "max_load_options",  # key to be used to provide valid options
                },
            },
            SolixMqttCommands.sb_disable_grid_export_switch: CMD_SB_DISABLE_GRID_EXPORT_SWITCH,  # Grid export (0), Disable grid export (1)
        },
        # Interval: ~3-5 seconds with realtime trigger, or immediately with status request
        "0405": _A17C1_0405,
        # Interval: varies, probably upon change
        "0407": _A17C0_0407,
        # Interval: ~300 seconds
        "0408": _A17C1_0408,
        # Expansion data
        # Interval: ~3-5 seconds, but only with realtime trigger
        "040a": _A17C1_040a,
    },
    # Solarbank 3 E2700 Pro
    "A17C5": {
        "0050": CMD_TEMP_UNIT,  # Temperature unit switch: Celsius (0) or Fahrenheit (1)
        "0057": CMD_REALTIME_TRIGGER,  # for regular status messages 0405 etc
        "005a": CMD_SB_MAX_LOAD  # same pattern but different command for max load settings in parallel systems
        | {
            COMMAND_NAME: SolixMqttCommands.sb_max_load_parallel,
            "a2": {
                **CMD_SB_MAX_LOAD["a2"],
                VALUE_OPTIONS: [1200, 2400, 3600, 4800],
                VALUE_OPTIONS_STATE: "max_load_parallel_options",
            },
            "a3": {
                **CMD_SB_MAX_LOAD["a3"],
                VALUE_DEFAULT: 2,
            },
        },
        "005e": CMD_SB_USAGE_MODE,  # NOTE: Cmd not supported directly, but description used for msg decoding
        "0067": CMD_SB_MIN_SOC,  # select SOC reserve
        "0068": {
            # solarbank light command group
            COMMAND_LIST: [
                SolixMqttCommands.sb_light_mode_select,  # field a2
                SolixMqttCommands.sb_light_switch,  # field a3
            ],
            SolixMqttCommands.sb_light_mode_select: CMD_SB_LIGHT_MODE,  # Normal (0), Mood light (1)
            SolixMqttCommands.sb_light_switch: CMD_SB_LIGHT_SWITCH,  # Light Off (1), Light On (0)
        },
        "0073": CMD_SB_AC_SOCKET_SWITCH,  # Switch for emergency AC socket
        "0080": {
            # solarbank command group
            COMMAND_LIST: [
                SolixMqttCommands.sb_max_load,  # field a2, a3, a4
                SolixMqttCommands.sb_disable_grid_export_switch,  # field a5, a6, a9
                SolixMqttCommands.sb_pv_limit_select,  # field a7
                SolixMqttCommands.sb_ac_input_limit,  # field a8
            ],
            SolixMqttCommands.sb_max_load: CMD_SB_MAX_LOAD  # 350,600,800,1000,1200 W, may depend on country settings
            | {
                "a2": {
                    **CMD_SB_MAX_LOAD["a2"],
                    VALUE_OPTIONS: [350, 600, 800, 1000, 1200],
                    VALUE_OPTIONS_STATE: "max_load_options",  # key to be used to provide valid options
                },
                # Extra field a4 observed for SB3, which does not seem to be used for SB2?
                "a4": {
                    NAME: "set_max_load_a4?",  # Unknown, 0 observed
                    TYPE: DeviceHexDataTypes.sile.value,
                    VALUE_DEFAULT: 0,
                },
            },
            SolixMqttCommands.sb_disable_grid_export_switch: CMD_SB_DISABLE_GRID_EXPORT_SWITCH,  # Grid export (0), Disable grid export (1)
            SolixMqttCommands.sb_pv_limit_select: CMD_SB_PV_LIMIT,  # 2000 W or 3600 W
            SolixMqttCommands.sb_ac_input_limit: CMD_SB_AC_INPUT_LIMIT,  # 0 - 1200 W, step: 100
        },
        "0085": CMD_SB_3RD_PARTY_PV_SWITCH,  # 3rd Party support switch, cloud driven
        "009a": CMD_SB_DEVICE_TIMEOUT,  # timeout in 30 min chunks: 0, 30, 60, 120, 240, 360, 720, 1440 minutes
        # Interval: ~3-5 seconds with realtime trigger, or immediately with status request
        "0405": _A17C5_0405,
        # Interval: varies, probably upon change
        "0407": _A17C0_0407,
        # Interval: ~300 seconds
        "0408": _A17C5_0408,
        # Expansion data
        # Interval: ~3-5 seconds, but only with realtime trigger, NOT with status request
        "040a": _A17C5_040a,
        # multisystem messages
        # Interval: ~3-10 seconds, but only with realtime trigger, NOT with status request
        "0420": _DOCK_0420,
        # Interval: ~300 seconds
        "0421": _DOCK_0421,
        # Interval: ~300 seconds
        "0428": _DOCK_0428,
        # Interval: ~300 seconds
        "0500": _DOCK_0500,
    },
    # Anker SOLIX E10
    "A17E1": {
        "0057": CMD_REALTIME_TRIGGER,
        "0405": {
            # Interval: ~3-5 seconds, but only with realtime trigger
            TOPIC: "param_info",
            "a2": {NAME: "device_sn"},
            "a3": {NAME: "battery_soc"},
            "a4": {
                NAME: "charging_status"
            },  # charging_status: 0=inactive, 1=discharging, 2=charging
            "a5": {NAME: "temperature", SIGNED: True},
            "a6": {NAME: "battery_soc?"},
            "a7": {NAME: "sw_version?", "values": 4},
            "a8": {NAME: "sw_controller?", "values": 4},
            "a9": {NAME: "sw_expansion?", "values": 4},  # Expansion firmware version
            "ab": {NAME: "photovoltaic_power"},
            "ac": {NAME: "battery_power"},
            "ad": {NAME: "ac_output_power"},  # inverter AC output
            "ae": {NAME: "ac_output_power_inverted?"},  # inverter PV/Battery input?
            "b0": {NAME: "bypass_energy?"},
            "b1": {NAME: "charged_energy?"},
            "b2": {NAME: "consumed_energy?"},
            "b3": {NAME: "discharged_energy?"},
            "b4": {NAME: "pv_yield?"},
            "b8": {
                NAME: "usage_mode?"
            },  # 2=self-consume, 4=manual-backup, 5=time-of-use, 8=backup/emergency
            "bf": {NAME: "unknown_timestamp_0405_bf?"},
            "c0": {NAME: "unknown_timestamp_0405_c0?"},
            "c3": {
                NAME: "use_time_band?"
            },  # use_time_band: 1=peak, 2=mid-peak, 3=off-peak, 4=super-off-peak
            "c4": {NAME: "grid_power_signed"},  # positive=import, negative=export
            "c5": {NAME: "home_demand"},
            "c6": {NAME: "pv_1_power"},
            "c7": {NAME: "pv_2_power"},
            "af": {
                NAME: "generator_to_home_power?"
            },  # generator AC input power to home
            "ba": {
                BYTES: {
                    "02": {
                        NAME: "storm_guard_switch",
                        MASK: 0x01,
                    },  # 0=off, 1=on
                }
            },
            "c2": {
                NAME: "ac_output_power?"
            },  # total AC output power to home from all sources in W (solar, battery, generator, grid)
            "cb": {NAME: "expansion_packs?"},  # number of expansion batteries
            "d5": {
                NAME: "generator_to_battery_power?"
            },  # generator AC charging battery W
            "dc": {NAME: "grid_status"},  # 0=grid-connected, 2=off-grid/backup
            "fe": {NAME: "msg_timestamp"},
        },
        "0408": {
            # Interval: ??? seconds
            TOPIC: "param_info",
            "a2": {NAME: "device_sn"},
            "a3": {NAME: "unknown_timestamp_0408_a3?"},
            "a4": {NAME: "unknown_timestamp_0408_a4?"},
            "a7": {NAME: "battery_soc?"},
            "a8": {NAME: "expansion_packs?"},  # number of expansion batteries
            "a9": {NAME: "usage_mode?"},
            "ac": {NAME: "bypass_energy?"},  # same as 0405 b0
            "b2": {NAME: "unknown_energy_0408_b2?"},
            "b7": {NAME: "charged_energy?"},  # same as 0405 b1
            "b8": {NAME: "consumed_energy?"},  # same as 0405 b2
            "be": {NAME: "pv_yield?"},  # same as 0405 b4
            "cc": {NAME: "temperature", SIGNED: True},
        },
        # Interval: ~3-5 seconds, but only with realtime trigger
        "040a": _A17E1_040a,
    },
    # AX170 Power dock for home backup systems A17E1
    "AX170": {
        "0057": CMD_REALTIME_TRIGGER,  # for regular status messages 0405 etc
        "0405": _AX170_0405,
        "0666": {
            EMBEDDED: "tlv",  # Name of field with embedded hexdata
            "a2": {NAME: "sn"},
            "a3": {NAME: "type"},
            "a4": {NAME: "tlv"},
        },
    },
    # Anker Solarbank Smartmeter
    "A17X7": {
        "0057": CMD_REALTIME_TRIGGER,  # for regular status messages 0405 etc
        "0405": {
            # Interval: ~5 seconds, but only with realtime trigger
            TOPIC: "param_info",
            "a2": {NAME: "device_sn"},
            "a6": {NAME: "sw_version", "values": 4},
            "a7": {NAME: "sw_controller", "values": 4},
            "a8": {NAME: "grid_to_home_power"},
            "a9": {NAME: "pv_to_grid_power"},
            "aa": {NAME: "grid_import_energy", FACTOR: 0.01},
            "ab": {NAME: "grid_export_energy", FACTOR: 0.01},
            # "ad": {NAME: "pv_to_grid_power"},
        },
    },
    # Anker Solarbank Smartmeter
    "A17X7US": {
        "0057": CMD_REALTIME_TRIGGER,  # for regular status messages 0405 etc
        "0405": {
            # Interval: ~5 seconds, but only with realtime trigger
            TOPIC: "param_info",
            "a2": {NAME: "device_sn"},
            "a6": {NAME: "sw_version", "values": 4},
            "a7": {NAME: "sw_controller", "values": 4},
            "b1": {NAME: "grid_power_signed_l1"},  # negative = Export
            "b2": {NAME: "grid_power_signed_l2"},  # negative = Export
            "b3": {NAME: "grid_power_signed"},  # negative = Export
            "b4": {NAME: "current_l1"},
            "b5": {NAME: "voltage_l1"},
            "b6": {NAME: "current_l2"},
            "b7": {NAME: "voltage_l2"},
            "b8": {NAME: "power_factor"},
            "b9": {NAME: "voltage_l1l2"},
            "ba": {NAME: "system_output_power_signed_l1", FACTOR: -1},
            "bb": {NAME: "system_output_power_signed_l2", FACTOR: -1},
            "bc": {NAME: "system_output_current_l1"},
            "bd": {NAME: "system_output_current_l2"},
            "be": {NAME: "voltage_l1l2_alt?"},
            "fe": {NAME: "msg_timestamp"},
        },
    },
    # Shello Pro 3 EM
    "SHEMP3": {
        "0057": CMD_REALTIME_TRIGGER,  # for regular status messages 0405 etc
        "0405": {
            # Interval: ~5 seconds, but only with realtime trigger
            TOPIC: "param_info",
            "a2": {NAME: "device_sn"},
            "a8": {NAME: "grid_to_home_power", FACTOR: 0.01},
            "a9": {NAME: "pv_to_grid_power", FACTOR: 0.01},
            "aa": {NAME: "grid_import_energy", FACTOR: 0.00001},
            "ab": {NAME: "grid_export_energy", FACTOR: 0.00001},
            "fe": {NAME: "msg_timestamp"},
        },
    },
    # Anker Smartplug
    "A17X8": {
        "0040": CMD_STATUS_REQUEST,  # Device status request, more reliable than RT (one time status messages 0405 etc)
        "0057": CMD_REALTIME_TRIGGER,  # for regular status messages 0405 etc
        "007a": CMD_AC_OUTPUT_SWITCH,  # AC output switch: Disabled (0) or Enabled (1)
        "007c": CMD_PLUG_SCHEDULE,  # Set a plug schedule
        "007e": CMD_PLUG_DELAYED_TOGGLE,  # Set a delayed toggle
        "007f": CMD_TIMER_REQUEST,  # Request timer status from device for delayed toggle
        "0405": {
            # Interval: ~5 seconds, but only with realtime trigger
            TOPIC: "param_info",
            "a2": {NAME: "device_sn"},
            "a4": {NAME: "ac_output_power_switch"},  # Off (0), On (1)
            "a6": {NAME: "sw_version", "values": 4},
            "a7": {NAME: "sw_controller", "values": 4},
            "a8": {NAME: "voltage", "factor": 0.1},
            "a9": {NAME: "current", "factor": 0.01},
            "aa": {NAME: "power", "factor": 0.1},
            "ab": {NAME: "output_energy", FACTOR: 0.001},
            "ad": _PLUG_TIMER_STATUS,
            "fe": {NAME: "msg_timestamp"},
        },
        "087f": {
            # Interval: upon timer request command
            TOPIC: "param_info",
            "a2": _PLUG_TIMER_STATUS,
        },
    },
    # Anker Power Dock
    "AE100": {
        "0057": CMD_REALTIME_TRIGGER,  # for regular status messages 0405 etc
        "005a": CMD_SB_MAX_LOAD  # same pattern but different command for max load settings in parallel systems
        | {
            COMMAND_NAME: SolixMqttCommands.sb_max_load_parallel,
            "a2": {
                **CMD_SB_MAX_LOAD["a2"],
                VALUE_OPTIONS: [1200, 2400, 3600, 4800],
                VALUE_OPTIONS_STATE: "max_load_parallel_options",  # key to be used to provide valid options
                STATE_NAME: "max_load_total",
            },
            "a3": {
                **CMD_SB_MAX_LOAD["a3"],
                VALUE_DEFAULT: 2,
            },
        },
        "0067": CMD_SB_MIN_SOC,  # select SOC reserve, cloud driven
        "0080": CMD_SB_DISABLE_GRID_EXPORT_SWITCH,  # Grid export (0), Disable grid export (1)
        "0084": CMD_SB_EV_CHARGER_SWITCH,  # EV charger support switch, cloud driven
        "0085": CMD_SB_3RD_PARTY_PV_SWITCH,  # 3rd Party support switch, cloud driven
        # Interval: ~3-10 seconds, but only with realtime trigger
        "0405": _DOCK_0405,
        # Interval: varies, probably upon change
        "0407": _0407,
        # multisystem messages
        # Interval: ~3-10 seconds, but only with realtime trigger
        "0420": _DOCK_0420,
        # Interval: ~300 seconds
        "0421": _DOCK_0421,
        # Interval: ~300 seconds
        "0428": _DOCK_0428,
        # Interval: ~300 seconds
        "0500": _DOCK_0500,
    },
    # Power Cooler Everfrost 2 40L
    "A17A4": {
        # Interval: Irregular, triggered on app actions, no fixed interval
        "0830": _PPS_VERSIONS_0830,
        "0889": {
            "a2": {NAME: "setting_0889_a2"},
            "a3": {NAME: "setting_0889_a3"},
            "a4": {NAME: "setting_0889_a4"},
            "a5": {NAME: "setting_0889_a5"},
            "a6": {NAME: "setting_0889_a6"},
        },
    },
    # Prime Charger 250W
    "A2345": {
        "0200": CMD_STATUS_REQUEST,  # Device status request for message 0a00
        "0207": {
            # USB port switch command. Same command, but selected port is a parameter
            COMMAND_LIST: [
                SolixMqttCommands.usbc_1_port_switch,
                SolixMqttCommands.usbc_2_port_switch,
                SolixMqttCommands.usbc_3_port_switch,
                SolixMqttCommands.usbc_4_port_switch,
                SolixMqttCommands.usba_port_switch,
            ],
            SolixMqttCommands.usbc_1_port_switch: CMD_USB_PORT_SWITCH
            | {
                "a2": {
                    **CMD_USB_PORT_SWITCH["a2"],
                    VALUE_DEFAULT: 0,  # same pattern but different default option for port
                },
                "a3": {
                    **CMD_USB_PORT_SWITCH["a3"],
                    STATE_NAME: "usbc_1_switch",
                },
            },
            SolixMqttCommands.usbc_2_port_switch: CMD_USB_PORT_SWITCH
            | {
                "a2": {
                    **CMD_USB_PORT_SWITCH["a2"],
                    VALUE_DEFAULT: 1,  # same pattern but different default option for port
                },
                "a3": {
                    **CMD_USB_PORT_SWITCH["a3"],
                    STATE_NAME: "usbc_2_switch",
                },
            },
            SolixMqttCommands.usbc_3_port_switch: CMD_USB_PORT_SWITCH
            | {
                "a2": {
                    **CMD_USB_PORT_SWITCH["a2"],
                    VALUE_DEFAULT: 2,  # same pattern but different default option for port
                },
                "a3": {
                    **CMD_USB_PORT_SWITCH["a3"],
                    STATE_NAME: "usbc_3_switch",
                },
            },
            SolixMqttCommands.usbc_4_port_switch: CMD_USB_PORT_SWITCH
            | {
                "a2": {
                    **CMD_USB_PORT_SWITCH["a2"],
                    VALUE_DEFAULT: 3,  # same pattern but different default option for port
                },
                "a3": {
                    **CMD_USB_PORT_SWITCH["a3"],
                    STATE_NAME: "usbc_4_switch",
                },
            },
            SolixMqttCommands.usba_port_switch: CMD_USB_PORT_SWITCH
            | {
                "a2": {
                    **CMD_USB_PORT_SWITCH["a2"],
                    VALUE_DEFAULT: 4,  # same pattern but different default option for port
                },
                "a3": {
                    **CMD_USB_PORT_SWITCH["a3"],
                    STATE_NAME: "usba_switch",
                },
            },
        },
        # Special realtime trigger for this device, with 10 seconds timeout fix, sending a 0303 message per second
        "020b": {
            k: v for k, v in CMD_REALTIME_TRIGGER.items() if k not in ["a2", "a3"]
        },
        # Interval: Upon change of the referred port toggle, usable by data extractor to adjust correct port state
        "0302": {
            "a2": {NAME: "set_port_switch_select"},
            "a3": {NAME: "set_port_switch"},
            "fe": {NAME: "msg_timestamp"},
        },
        # Interval: ~1 second, but only with realtime trigger. Consumption data, all data fields are also in 0a00 message
        "0303": _A2345_0303,
        # Interval: only with status request command. Contains all settings and consumption data
        "0a00": _A2345_0a00,
    },
    # Prime Charging Station 240W 8-in-1
    "A91B2": {
        "0200": CMD_STATUS_REQUEST,  # Device status request for message 0a00
        "0207": {
            # AC outlet switch command. Same message type as A2345 USB port switch.
            # port_select: 0=ac_1, 1=ac_2
            COMMAND_LIST: [
                SolixMqttCommands.ac_1_port_switch,
                SolixMqttCommands.ac_2_port_switch,
            ],
            SolixMqttCommands.ac_1_port_switch: CMD_AC_PORT_SWITCH
            | {
                "a2": {
                    **CMD_AC_PORT_SWITCH["a2"],
                    VALUE_DEFAULT: 0,
                },
                "a3": {
                    **CMD_AC_PORT_SWITCH["a3"],
                    STATE_NAME: "ac_1_switch",
                },
            },
            SolixMqttCommands.ac_2_port_switch: CMD_AC_PORT_SWITCH
            | {
                "a2": {
                    **CMD_AC_PORT_SWITCH["a2"],
                    VALUE_DEFAULT: 1,
                },
                "a3": {
                    **CMD_AC_PORT_SWITCH["a3"],
                    STATE_NAME: "ac_2_switch",
                },
            },
        },
        # Special realtime trigger (no a2/a3 timeout params, same as A2345)
        "020b": {
            k: v for k, v in CMD_REALTIME_TRIGGER.items() if k not in ["a2", "a3"]
        },
        # Port switch state notification (broadcast by device after 0207 command)
        "0302": {
            "a2": {NAME: "set_port_switch_select"},
            "a3": {NAME: "set_port_switch"},
            "fe": {NAME: "msg_timestamp"},
        },
        # Interval: ~1 second with realtime trigger. USB port consumption data (same layout as A2345).
        "0303": _A2345_0303,
        # Full device status including AC outlet switch states, sent on status request.
        "0a00": {
            "a2": {NAME: "sw_version", "values": 4},
            # USB ports: a4=usbc_1 ... a9=usba_2 (same 8-byte structure as A2345 0a00)
            "a4": {
                BYTES: {
                    "00": {NAME: "usbc_1_status", TYPE: DeviceHexDataTypes.ui.value},
                    "01": {
                        NAME: "usbc_1_voltage",
                        TYPE: DeviceHexDataTypes.sile.value,
                        FACTOR: 0.001,
                    },
                    "03": {
                        NAME: "usbc_1_current",
                        TYPE: DeviceHexDataTypes.sile.value,
                        FACTOR: 0.001,
                    },
                    "05": {
                        NAME: "usbc_1_power",
                        TYPE: DeviceHexDataTypes.sile.value,
                        FACTOR: 0.01,
                    },
                }
            },
            "a5": {
                BYTES: {
                    "00": {NAME: "usbc_2_status", TYPE: DeviceHexDataTypes.ui.value},
                    "01": {
                        NAME: "usbc_2_voltage",
                        TYPE: DeviceHexDataTypes.sile.value,
                        FACTOR: 0.001,
                    },
                    "03": {
                        NAME: "usbc_2_current",
                        TYPE: DeviceHexDataTypes.sile.value,
                        FACTOR: 0.001,
                    },
                    "05": {
                        NAME: "usbc_2_power",
                        TYPE: DeviceHexDataTypes.sile.value,
                        FACTOR: 0.01,
                    },
                }
            },
            "a6": {
                BYTES: {
                    "00": {NAME: "usbc_3_status", TYPE: DeviceHexDataTypes.ui.value},
                    "01": {
                        NAME: "usbc_3_voltage",
                        TYPE: DeviceHexDataTypes.sile.value,
                        FACTOR: 0.001,
                    },
                    "03": {
                        NAME: "usbc_3_current",
                        TYPE: DeviceHexDataTypes.sile.value,
                        FACTOR: 0.001,
                    },
                    "05": {
                        NAME: "usbc_3_power",
                        TYPE: DeviceHexDataTypes.sile.value,
                        FACTOR: 0.01,
                    },
                }
            },
            "a7": {
                BYTES: {
                    "00": {NAME: "usbc_4_status", TYPE: DeviceHexDataTypes.ui.value},
                    "01": {
                        NAME: "usbc_4_voltage",
                        TYPE: DeviceHexDataTypes.sile.value,
                        FACTOR: 0.001,
                    },
                    "03": {
                        NAME: "usbc_4_current",
                        TYPE: DeviceHexDataTypes.sile.value,
                        FACTOR: 0.001,
                    },
                    "05": {
                        NAME: "usbc_4_power",
                        TYPE: DeviceHexDataTypes.sile.value,
                        FACTOR: 0.01,
                    },
                }
            },
            "a8": {
                BYTES: {
                    "00": {NAME: "usba_1_status", TYPE: DeviceHexDataTypes.ui.value},
                    "01": {
                        NAME: "usba_1_voltage",
                        TYPE: DeviceHexDataTypes.sile.value,
                        FACTOR: 0.001,
                    },
                    "03": {
                        NAME: "usba_1_current",
                        TYPE: DeviceHexDataTypes.sile.value,
                        FACTOR: 0.001,
                    },
                    "05": {
                        NAME: "usba_1_power",
                        TYPE: DeviceHexDataTypes.sile.value,
                        FACTOR: 0.01,
                    },
                }
            },
            "a9": {
                BYTES: {
                    "00": {NAME: "usba_2_status", TYPE: DeviceHexDataTypes.ui.value},
                    "01": {
                        NAME: "usba_2_voltage",
                        TYPE: DeviceHexDataTypes.sile.value,
                        FACTOR: 0.001,
                    },
                    "03": {
                        NAME: "usba_2_current",
                        TYPE: DeviceHexDataTypes.sile.value,
                        FACTOR: 0.001,
                    },
                    "05": {
                        NAME: "usba_2_power",
                        TYPE: DeviceHexDataTypes.sile.value,
                        FACTOR: 0.01,
                    },
                }
            },
            # AC outlet switch states: byte "00" of f_value = 0 (off) or 1 (on)
            "aa": {
                BYTES: {
                    "00": {NAME: "ac_1_switch", TYPE: DeviceHexDataTypes.ui.value},
                },
            },
            "ab": {
                BYTES: {
                    "00": {NAME: "ac_2_switch", TYPE: DeviceHexDataTypes.ui.value},
                },
            },
            "fe": {NAME: "msg_timestamp"},
        },
    },
    # Alternator charger
    "AS200": {
        "0057": CMD_REALTIME_TRIGGER,  # for regular status messages
        "0103": {
            # command group
            COMMAND_LIST: [
                SolixMqttCommands.car_battery_type,  # field a3, aa
                SolixMqttCommands.battery_charge_limits,  # field a5, b4
                SolixMqttCommands.device_switch,  # field ac
                SolixMqttCommands.device_timeout_minutes,  # field ae, bb, bc
                SolixMqttCommands.temp_unit_switch,  # field b2
                SolixMqttCommands.device_power_mode,  # field b8
            ],
            SolixMqttCommands.car_battery_type: CMD_COMMON_V2
            | {
                "a3": {
                    NAME: "set_car_battery_type",  # LiFePO4 (0), Lead Acid (1)
                    TYPE: DeviceHexDataTypes.ui.value,
                    STATE_NAME: "car_battery_type",
                    VALUE_OPTIONS: {"li_fe_po": 0, "lead_acid": 1},
                    VALUE_STATE: "car_battery_type",
                },
                "aa": {
                    NAME: "set_car_battery_voltage_type",  # 12V (0), 24V (1)
                    TYPE: DeviceHexDataTypes.ui.value,
                    STATE_NAME: "car_battery_voltage_type",
                    VALUE_OPTIONS: {"12_v": 0, "24_v": 1},
                    VALUE_STATE: "car_battery_voltage_type",
                },
            },
            SolixMqttCommands.battery_charge_limits: CMD_BATTERY_CHARGE_LIMITS,
            SolixMqttCommands.device_switch: CMD_DEVICE_SWITCH,  # Off (0), On (1)
            SolixMqttCommands.device_timeout_minutes: CMD_COMMON_V2
            | {
                "ae": {
                    NAME: "set_active_device_timeout_minutes",  # applied setting, 720–1440, step 30 if switch off(1), otherwise 0
                    TYPE: DeviceHexDataTypes.sile.value,
                    STATE_NAME: "active_device_timeout_minutes",
                    VALUE_FOLLOWS: "set_device_timeout_minutes",  # follow state to ensure converter cache has all dependent states
                    STATE_CONVERTER: lambda value, state, cache: (
                        (
                            0
                            if cache.get(
                                "set_device_timeout_switch",
                                cache.get("device_timeout_switch"),
                            )
                            else cache.get(
                                "set_device_timeout_minutes",
                                cache.get("device_timeout_minutes"),
                            )
                        )
                        if value is not None
                        else state
                    ),  # Smart setting represented with state 2
                    VALUE_MIN: 0,
                    VALUE_MAX: 1440,
                    VALUE_STEP: 30,
                },
                "bb": {
                    NAME: "set_device_timeout_minutes",  # control setting, 720–1440 step 30
                    TYPE: DeviceHexDataTypes.sile.value,
                    STATE_NAME: "device_timeout_minutes",
                    VALUE_STATE: "device_timeout_minutes",
                    VALUE_MIN: 720,
                    VALUE_MAX: 1440,
                    VALUE_STEP: 30,
                },
                "bc": {
                    NAME: "set_device_timeout_switch",  # on (0), off (1) = No timeout !
                    TYPE: DeviceHexDataTypes.ui.value,
                    STATE_NAME: "device_timeout_switch",
                    VALUE_OPTIONS: {"off": 1, "on": 0},
                    VALUE_STATE: "device_timeout_switch",
                },
            },
            SolixMqttCommands.temp_unit_switch: CMD_TEMP_UNIT_V2,  # Off (0), On (1)
            SolixMqttCommands.device_power_mode: CMD_COMMON_V2
            | {
                # Command: Device shutdown, needs physical power on button afterwards
                "b8": {
                    NAME: "set_device_power_mode",  # Shutdown(1)
                    TYPE: DeviceHexDataTypes.ui.value,
                    VALUE_OPTIONS: {"shutdown": 1},
                    VALUE_DEFAULT: 1,
                },
            },
        },
        # status message, every 3 seconds but only if realtime trigger active
        "0421": _AS200_0421,
        # Interval: ~every 5 minutes, same content as 0421
        "0900": _AS200_0421,
    },
    # Power Panel
    "A17B1": {
        "0057": CMD_REALTIME_TRIGGER,  # for regular status messages
        # Interval: unknown?
        "0500": {
            "a2": {
                "json": _PP_JSON,
            }
        },
        "0502": {
            "a2": {
                "json": _PP_JSON,
            }
        },
        "0503": {
            "a2": {
                "json": _PP_JSON,
            }
        },
        "0505": {
            "a2": {
                "json": _PP_JSON,
            }
        },
        "0601": {
            EMBEDDED: "tlv",  # Name of field with embedded hexdata
        },
    },
    # HES X1
    "A5101": {
        "0057": CMD_REALTIME_TRIGGER,  # for regular status messages
        # Interval: unknown?
        "json": _X1_JSON,
    },
    "A5102": {
        "0057": CMD_REALTIME_TRIGGER,  # for regular status messages
        # Interval: unknown?
        "json": _X1_JSON,
    },
    "A5103": {
        "0057": CMD_REALTIME_TRIGGER,  # for regular status messages
        # Interval: unknown?
        "json": _X1_JSON,
    },
    # EV Charger V1
    "A5191": {
        # "0040": CMD_STATUS_REQUEST | {  # Device status request (one time status messages 0840=0405, but no 410)
        #    **TIMESTAMP_FE_NOTYPE # App uses timestamp field without field type, Anker Bug?
        # },
        "0057": CMD_REALTIME_TRIGGER,  # for regular status messages 0410
        "0100": {
            # EV command group
            COMMAND_LIST: [
                SolixMqttCommands.plug_lock_switch,  # field a3
                SolixMqttCommands.ev_auto_start_switch,  # field a4
                SolixMqttCommands.ev_max_charge_current,  # field a8
                SolixMqttCommands.light_brightness,  # field aa
                SolixMqttCommands.ev_auto_charge_restart_switch,  # field ac
                SolixMqttCommands.ev_random_delay_switch,  # field ad
                SolixMqttCommands.swipe_up_mode_select,  # field af
                SolixMqttCommands.swipe_down_mode_select,  # field b0
                SolixMqttCommands.smart_touch_mode_select,  # field b2
                SolixMqttCommands.light_off_schedule,  # field b4, b5, b6
                SolixMqttCommands.modbus_switch,  # field b7
            ],
            SolixMqttCommands.plug_lock_switch: CMD_PLUG_LOCK_SWITCH,  # On (1), Off (2) !
            SolixMqttCommands.ev_auto_start_switch: CMD_EV_AUTO_START_SWITCH,  # Off (0), On (1)
            SolixMqttCommands.ev_max_charge_current: CMD_EV_MAX_CHARGE_CURRENT,  # min limit to max limit (e.g. 6-32 A, step 1 A)
            SolixMqttCommands.ev_auto_charge_restart_switch: CMD_EV_AUTO_CHARGE_RESTART_SWITCH,  # Off (0), On (1)
            SolixMqttCommands.ev_random_delay_switch: CMD_EV_CHARGE_RANDOM_DELAY_SWITCH,  # Off (0), On (1)
            SolixMqttCommands.light_brightness: CMD_EV_LIGHT_BRIGHTNESS,  # 0-100 %, step 10 %
            SolixMqttCommands.swipe_up_mode_select: CMD_SWIPE_UP_MODE,  # off (0), start charge (1), stop charge (2), boost charge (3)
            SolixMqttCommands.swipe_down_mode_select: CMD_SWIPE_DOWN_MODE,  # off (0), start charge (1), stop charge (2), boost charge (3)
            SolixMqttCommands.smart_touch_mode_select: CMD_SMART_TOUCH_MODE,  # simple (0), avoid_error (1)
            SolixMqttCommands.light_off_schedule: CMD_EV_LIGHT_OFF_SCHEDULE,  # Switch, start time, end time
            SolixMqttCommands.modbus_switch: CMD_MODBUS_SWITCH,  # Off (0), On (1)
        },
        "0105": {
            COMMAND_LIST: [
                SolixMqttCommands.ev_charger_mode_select,  # field a4
            ],
            SolixMqttCommands.ev_charger_mode_select: CMD_EV_CHARGER_MODE,  # Start(1), Stop(2), Skip Delay (3), Boost(4)
        },
        "0106": {
            COMMAND_LIST: [
                SolixMqttCommands.ev_charger_schedule_settings,  # field a2, a8
                SolixMqttCommands.ev_charger_schedule_times,  # field a3 - a7
            ],
            SolixMqttCommands.ev_charger_schedule_settings: CMD_EV_CHARGER_SCHEDULE_SETTINGS,  # Schedule switch, mode
            SolixMqttCommands.ev_charger_schedule_times: CMD_EV_CHARGER_SCHEDULE_TIMES,  # schedule times
        },
        "0108": {
            COMMAND_LIST: [
                SolixMqttCommands.device_power_mode,  # field a2
            ],
            SolixMqttCommands.device_power_mode: CMD_DEVICE_POWER_MODE,  # Restart(5)
        },
        "010c": {
            COMMAND_LIST: [
                SolixMqttCommands.main_breaker_limit,  # field a3
                SolixMqttCommands.ev_load_balancing,  # field a2, a4, a5, a6
            ],
            SolixMqttCommands.main_breaker_limit: CMD_MAIN_BREAKER_LIMIT,  # 10-500 A, step 1 A
            SolixMqttCommands.ev_load_balancing: CMD_EV_LOAD_BALANCING,  # Switch, monitoring type and device SN
        },
        "010e": {
            COMMAND_LIST: [
                SolixMqttCommands.ev_solar_charging,  # field a2-a8
            ],
            SolixMqttCommands.ev_solar_charging: CMD_EV_SOLAR_CHARGING,  # Solar charge settings
        },
        # Interval: 5 minutes regular, contains 3 unknown settings. Only regular message without trigger/request
        "0400": {
            TOPIC: "state_info",
            "a2": {NAME: "unknown_setting_400_a2"},
            "a3": {NAME: "unknown_setting_400_a3"},
            "a4": {NAME: "unknown_setting_400_a4"},
        },
        # Interval: Unknown
        "0403": _EV_CHARGER_0403,  # Few device parms for charging after 0105 command?
        # Interval: Irregular, but only after status request command?
        "0405": _EV_CHARGER_0405,  # Device parms, after command was acknowledged
        # Interval: ~3-5 seconds, but only with realtime trigger
        "0410": _EV_CHARGER_0410,
        # Interval: once requested via status request command, same as 0405
        "0840": _EV_CHARGER_0405,
        # Interval: Control change confirmation message
        "0900": _EV_CHARGER_0405,
    },
    "A7320": {
        # SOLIX Smart Generator 5500
        "0057": CMD_REALTIME_TRIGGER,  # for regular status messages 0405 etc
        "0073": {
            COMMAND_LIST: [
                SolixMqttCommands.ac_dc_mode_select,  # field a5
            ],
            SolixMqttCommands.ac_dc_mode_select: CMD_AC_DC_MODE,  # AC/DC mode selection
        },
        "0405": _A7320_0405,
        "0408": _A7320_0408,
    },
}
