mysolenso.services.station - PV Stations

MySolenso PV station service.

Provides the MySolensoStation class, which queries the /station_select_by_page endpoint and exposes the user’s photovoltaic installation data.

When an account has multiple stations, the class selects the first one by default. Use MySolensoStation.set_station() to switch the active station.

This module is instantiated automatically by MySolenso and accessible via client.station.

Example

client = MySolenso(username="user", token="tok")

print(client.station.station_total)   # total number of stations
print(client.station.station_id)      # ID of the active station
print(client.station.name)            # installation name
print(client.station.install_power)   # installed power
print(client.station.stations)        # list of [{id, ak}, ...]
class mysolenso.services.station.MySolensoStation(parent)[source]

Bases: object

Access to the Solenso user’s photovoltaic stations.

Queries the API at instantiation to retrieve the complete list of stations. The active station index (1-based) can be changed with set_station().

Parameters:

parent – Instance of MySolenso providing access to the auth sub-module.

Raises:

MySolensoException – If no station is found (total == 0), or if the API response is invalid.

Note

The station index is 1-based: the first station is station = 1, the second is station = 2, and so on.

Example

client = MySolenso(username="admin", token="tok")
st = client.station

print(st.station_total)   # 2
print(st.station_id)      # ID of station 1
st.set_station(2)         # switch to station 2
print(st.station_id)      # ID of station 2
set_station(id)[source]

Select the active station by its 1-based index.

Parameters:

id (int) – Index of the station to activate. Must be between 1 and station_total inclusive.

Raises:

MySolensoException – If id is out of the valid range.

Return type:

None

Example

client.station.set_station(2)   # activate the 2nd station
print(client.station.station_id)
refresh_station()[source]

Reload all attributes from the cached data.

Useful after changing the station index via set_station(), or to synchronise properties following an update to all_data.

Note

This method does not make a network call. To refresh data from the API, re-instantiate the class or call _get_station_me().

Return type:

None

property all_data: list

Full raw list of all stations returned by the API.

Example

[
{

“id”: 9999999, “name”: “JOHN DOE”, “city_code”: “FR99999000000000”, “parent_city”: [

{

“id”: 69, “pid”: 0, “code”: “FR00000000000000”, “weather_of_cid”: 0, “city_name”: “France”, “country_code”: “FR”, “level”: 1

}

], “status”: 40, “classify”: 1, “create_by”: 299988, “create_by_name”: “JDOE”, “create_at”: “2025-11-08 10:44:51”, “tz_name”: “UTC+01”, “pic_path”: “”, “capacitor”: “5”, “install_power”: “0”, “address”: “95 Moon Road, 99999 Galaxy, World”, “owner_name”: “John Doe”, “gid”: 123456, “org_name”: “Install Solenso”, “is_stars”: 0, “is_balance”: 0, “is_reflux”: 0, “warn_data”: {

“s_uoff”: false, “s_ustable”: false, “s_uid”: false, “l3_warn”: false, “g_warn”: false, “me_warn”: false, “dl”: null, “pw_off”: false

}, “nk_name”: “”, “is_3rd”: 0, “dc”: 0, “cr”: 0, “ak”: “aP9kGrfAzvTe41dR2R1kjfWlldns”

}

]

Returns:

List of dicts (one per station).

Return type:

list

property station_total: int

Total number of stations available for this account.

Returns:

Value of the total field returned by the API.

Return type:

int

property station_ids: List[int]

List of identifiers for all stations.

Returns:

List of id fields from each station. Malformed entries are silently ignored.

Return type:

List[int]

Example

print(client.station.station_ids)  # [42, 43]
property stations: List[dict]

Summary list of all stations (id + AK key).

Returns:

List of {"id": ..., "ak": ...} dicts for each station. Malformed entries are silently ignored.

Return type:

List[dict]

Example

for s in client.station.stations:
    print(s["id"], s["ak"])
property station_id: int

Unique identifier of the active station.

Returns:

id field of the current station.

Return type:

int

property name: str

Name of the active photovoltaic installation.

Returns:

name field of the current station.

Return type:

str

property city_code: str

City code where the station is located.

Returns:

city_code field of the current station.

Return type:

str

property status: int

Operational status of the station.

Returns:

status field of the current station (1 = online, other values = offline or alarm).

Return type:

int

property create_at: str

Date the station was registered on the platform.

Returns:

create_at field (ISO 8601 format or similar).

Return type:

str

property tz_name: str

Timezone of the station (e.g. "UTC+01").

Returns:

tz_name field of the current station.

Return type:

str

property capacitor: str

Solar panel capacity associated with the station (kVA).

Returns:

capacitor field of the current station.

Return type:

str

property install_power: str

Installed power of the station.

Returns:

install_power field of the current station.

Return type:

str

property address: str

Full geographic address of the station.

Returns:

address field of the current station.

Return type:

str

property org_name: str

Name of the organisation that owns the station.

Returns:

org_name field of the current station.

Return type:

str

property warn_data: dict

Alarm/warning data for the station.

Returns:

warn_data field of the current station.

Return type:

dict

property ak: str

Access key (API Key) specific to this station.

Used for calls to the associated Hoymiles API.

Returns:

ak field of the current station.

Return type:

str