mysolenso.services.dtu.selectall - DTU Select All

Service for retrieving the DTU and associated microinverter list.

This module provides MySolensoDTUSelectAll, which wraps the dtu_select_all Solenso endpoint. One call returns the primary DTU record and the complete list of microinverters attached through the repeater layer.

class mysolenso.services.dtu.selectall.MySolensoDTUSelectAll(parent)[source]

Bases: object

Retrieve the DTU and all associated microinverters for a station.

Call dtu_select_all_refresh() to populate the data, then access the properties below. The active station is inherited from the parent MySolenso object; use set_station() to query a different station without rebuilding the whole client.

Parameters:

parent (MySolenso) – The parent client object that holds the authentication context and the active station reference.

Raises:

MySolensoException – If no active station is set on the parent at construction time.

set_station(id, refresh=True)[source]

Switch the active station for DTU queries.

Parameters:
  • id (int) – ID of the target station. Must exist in the account’s station list.

  • refresh (bool) – When True (default), immediately re-fetches the DTU data for the new station.

Raises:

MySolensoException – If the requested station ID is not found in the account.

Return type:

None

dtu_select_all_refresh()[source]

Force a fresh fetch of the DTU and microinverter data from the API.

Equivalent to calling _get_dtu_select_all() directly. Use this method to update the cached data without switching station.

Return type:

None

property all_data: dict

Raw API response for the DTU select-all endpoint.

Returns:

Full response dictionary containing the dtu record and the repeater_list with its nested micros list. Example:

{
    "dtu": {
        "id": 1238090,
        "sn": "D0900999H",
        "dev_type": 1,
        "vc": "289"
    },
    "repeater_list": [
        {
            "id": 0,
            "sn": "",
            "dev_type": 2,
            "inv_id": null,
            "inv_sn": null,
            "inv_type": null,
            "micros": [
                {
                    "sn": "A900016B1",
                    "id": 9988920,
                    "vc": "2BD",
                    "dev_type": 3,
                    "port_array": [
                        1,
                        2
                    ]
                },
                {
                    "sn": "A900016B2",
                    "id": 9988930,
                    "vc": "23D",
                    "dev_type": 3,
                    "port_array": [
                        1,
                        2
                    ]
                },
                {
                    "sn": "A900016B3",
                    "id": 9988910,
                    "vc": "212",
                    "dev_type": 3,
                    "port_array": [
                        1,
                        2
                    ]
                },
                {
                    "sn": "A900016B4",
                    "id": 9988940,
                    "vc": "22L",
                    "dev_type": 3,
                    "port_array": [
                        1,
                        2
                    ]
                },
                {
                    "sn": "A900016B5",
                    "id": 9988950,
                    "vc": "2L2",
                    "dev_type": 3,
                    "port_array": [
                        1,
                        2
                    ]
                }
            ]
        }
    ]
}

Return type:

dict

property dtu_id: int

Internal numeric ID of the primary DTU.

property dtu_sn: str

Serial number of the primary DTU (e.g. "D0900999H").

property dtu_dev_type: int

Device type code of the primary DTU (1 for a standard DTU).

property dtu_vc: str

Firmware version code of the primary DTU (e.g. "289").

property list_micros_info: list[dict]

Full microinverter records attached to the DTU.

Returns:

Each item contains sn, id, vc, dev_type, and port_array for one microinverter. Example:

[
    {"sn": "A900016B1", "id": 9988920, "vc": "2BD",
     "dev_type": 3, "port_array": [1, 2]},
    ...
]

Return type:

list[dict]

property list_micros: list[dict]

serial number and internal ID only.

Returns:

Each item contains only sn and id. Example:

[
    {"sn": "A900016B1", "id": 9988920},
    {"sn": "A900016B2", "id": 9988930},
    ...
]

Return type:

list[dict]

Raises:

ValueError – If the internal data store is uninitialised or empty (i.e. dtu_select_all_refresh() has not been called yet).

Type:

Minimal microinverter projection