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:
objectAccess 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
MySolensoproviding access to theauthsub-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 isstation = 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 between1andstation_totalinclusive.- Raises:
MySolensoException – If
idis out of the valid range.- Return type:
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 toall_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:
- 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:
- property station_total: int
Total number of stations available for this account.
- Returns:
Value of the
totalfield returned by the API.- Return type:
- property station_ids: List[int]
List of identifiers for all stations.
- Returns:
List of
idfields 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:
idfield of the current station.- Return type:
- property name: str
Name of the active photovoltaic installation.
- Returns:
namefield of the current station.- Return type:
- property city_code: str
City code where the station is located.
- Returns:
city_codefield of the current station.- Return type:
- property status: int
Operational status of the station.
- Returns:
statusfield of the current station (1= online, other values = offline or alarm).- Return type:
- property create_at: str
Date the station was registered on the platform.
- Returns:
create_atfield (ISO 8601 format or similar).- Return type:
- property tz_name: str
Timezone of the station (e.g.
"UTC+01").- Returns:
tz_namefield of the current station.- Return type:
- property capacitor: str
Solar panel capacity associated with the station (kVA).
- Returns:
capacitorfield of the current station.- Return type:
- property install_power: str
Installed power of the station.
- Returns:
install_powerfield of the current station.- Return type:
- property address: str
Full geographic address of the station.
- Returns:
addressfield of the current station.- Return type:
- property org_name: str
Name of the organisation that owns the station.
- Returns:
org_namefield of the current station.- Return type: