mysolenso - Main Facade
Main entry point for the MySolenso library.
This module exposes the MySolenso facade class, which groups all
library sub-modules into a single, unified interface. Most users only need
to import and instantiate this class.
Sub-modules initialised at construction
MySolensoAuth- authentication and token management.MySolensoMe- authenticated user profile.MySolensoStation- PV station list and active station selection.MySolensoStationData- detailed configuration of the active station.MySolensoStationCount- real-time and cumulative energy counters.MySolensoPowerByDay- intra-day grid power curve for today.MySolensoCountByDayOfYeay- full day-of-year production history (Wh per day since commissioning).MySolensoPowerByStation- per-station power data in 15-minute intervals for a single day.MySolensoOEMPower- OEM daily PV energy list report (one record per day, paginated).MySolensoOEMPowerCount- OEM aggregated PV and consumption totals over a date range.MySolensoStationInfoDevice- Full device tree for the active station (DTU + microinverters).MySolensoStationCountDevice- Device count summary (DTU, microinverters, repeaters, meters, etc.).MySolensoStationAK- Geographic and address information for the active station.MySolensoDTUSelectAll- DTU and associated microinverter list for the active station.MySolensoDTUFind- Detailed record for a single DTU.MySolensoMicroFind- Detailed record for a single microinverter.
Example
Connect with an encrypted password:
from mysolenso import MySolenso
client = MySolenso(username="jdoe@example.com", password="encrypted_pass")
# Authentication status
print(client.auth.isConnect()) # True
# User profile
print(client.me.name)
print(client.me.email)
# Active station
print(client.station.station_id)
print(client.station.install_power)
# Real-time energy counters
print(client.stationcount.today_eq) # kWh produced today
print(client.stationcount.real_power) # current output in W
# Intra-day power curve (15-min intervals)
curve = client.powerbyday.get_data
print(curve["date"], curve["values"]) # {"08:00": 512.0, ...}
# Historical daily production since commissioning
history = client.countbydayofyear.get_data
print(history["2026-01-01"]) # Wh produced on that day
# OEM daily list report for a date range
client.oempower.set_day("2026-04-01", "2026-04-30")
for record in client.oempower.all_data:
print(record["date"], record["pv_eq"], "kWh")
# OEM aggregated totals for the same range
client.oempowercount.set_day("2026-04-01", "2026-04-30")
print(client.oempowercount.total_pv) # e.g. "415.72"
Connect with an existing token (skips the authentication network call):
client = MySolenso(username="jdoe@example.com", token="eyJ...")
- class mysolenso.mysolenso.MySolenso(username, password=None, token=None)[source]
Bases:
objectMain facade for the MySolenso library.
Instantiates and groups all service sub-modules under a single object. Authentication and initial data loading are performed automatically at construction time in the order listed in the module docstring.
- Parameters:
username (
str) – Solenso account e-mail address or identifier.password (
Optional[str]) – Encrypted password. When provided, a POST request is made to the authentication endpoint to obtain a session token. Must be omitted whentokenis given.token (
Optional[str]) – Pre-obtained session token. When provided, the authentication network call is skipped entirely.
- Raises:
MySolensoConnectionException – If
usernameis empty, or if neitherpasswordnortokenis supplied.MySolensoAuthenticationException – If the supplied credentials are rejected by the Solenso API.
MySolensoException – On any network error or missing data during sub-module initialisation.
- password
Encrypted password kept in memory (used only during construction; not reused afterward).
- Type:
Optional[str]
- auth
Session management and HTTP authorisation headers. Provides
get_auth_headers_solenso()andget_auth_headers_hoymiles().- Type:
- me
Authenticated user profile (name, email, role, group).
- Type:
- station
PV station list and active station control. Use
set_station()to switch the active station; all other services update accordingly.- Type:
- stationdata
Detailed technical configuration of the active station: timezone, installed capacity, pricing, inverters.
- Type:
- stationcount
Real-time and cumulative energy counters - today/month/year/lifetime yield, current power, CO₂ offset.
- Type:
- powerbyday
Intra-day grid power curve. Returns a
{HH:MM: watts}mapping for the active station and a given date. Useset_day()to query a specific date.- Type:
- countbydayofyear
Full production history as a
{YYYY-MM-DD: Wh}dictionary covering every day since the station was commissioned.
- powerbystation
Per-station power data in 15-minute intervals for a single day (PV, consumption, grid, BMS).
- Type:
- oempower
OEM daily PV energy list report. Returns one record per day with
pv_eq(kWh) and auxiliary fields. Useset_day()to set the date range.- Type:
- oempowercount
OEM aggregated PV and consumption totals over a date range. Exposes
total_pvandtotal_consumptionfor the configured period. Useset_day()to set the date range.- Type:
- stationinfodevice
Full device tree for the active station. Returns the DTU and all attached microinverters with serial numbers, firmware versions, and connectivity status.
- stationcountdevice
Device count summary for the active station. Exposes counts by device type (DTU, microinverters, repeaters, meters, BMS, etc.).
- stationak
Geographic and address information for the active station. Exposes
longitude,latitude, andaddress.- Type:
- dtuselectall
DTU and associated microinverter list for the active station. Use
list_microsfor a minimal{sn, id}projection orlist_micros_infofor the full records.- Type:
- dtufind
Detailed record for a single DTU. Call
set_dtu()with the DTU id before accessingall_data.- Type:
- microfind
Detailed record for a single microinverter. Call
set_micro()with the microinverter id before accessingall_data.- Type:
- stationlayout
Physical panel placement data for the active station. Returns a list of DTU/microinverter records with grid coordinates (x, y). Use
list_dtuto enumerate DTUs andget_mi_info_by_dtu()to retrieve panels per DTU.- Type:
MySolensoStationLayout
- stationarray
Panel array configuration for the active station. Exposes
name,angle_tilt,orientation,row,column, and related geometry fields describing the solar array setup.- Type:
MySolensoStationArray
- powerplaybackbyday
Intra-day power playback curve (Hoymiles). Returns a
{HH:MM: watts}mapping for the active station and a given date. Useset_day()to query a specific date andget_power_refresh()to force a reload.- Type:
MySolensoPowerPlayBackByDay
- stationdatamodule
Daily module data download descriptor for the active station. Exposes
sid,date,url, andfull_urlpointing to the Hoymiles binary data file for the configured day.- Type:
MySolensoStationDataModuleDay
Example
from mysolenso import MySolenso from mysolenso.exceptions import MySolensoException try: client = MySolenso(username="jdoe", password="encrypted_pass") print(client.me.name) print(client.stationcount.today_eq) print(client.powerbyday.get_data["values"]) # OEM report for the last month client.oempower.set_day("2026-04-01", "2026-04-30") print(client.oempower.power_data) client.oempowercount.set_day("2026-04-01", "2026-04-30") print(client.oempowercount.total_pv, "kWh total") except MySolensoException as e: print(f"Error: {e}")