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

  1. MySolensoAuth - authentication and token management.

  2. MySolensoMe - authenticated user profile.

  3. MySolensoStation - PV station list and active station selection.

  4. MySolensoStationData - detailed configuration of the active station.

  5. MySolensoStationCount - real-time and cumulative energy counters.

  6. MySolensoPowerByDay - intra-day grid power curve for today.

  7. MySolensoCountByDayOfYeay - full day-of-year production history (Wh per day since commissioning).

  8. MySolensoPowerByStation - per-station power data in 15-minute intervals for a single day.

  9. MySolensoOEMPower - OEM daily PV energy list report (one record per day, paginated).

  10. MySolensoOEMPowerCount - OEM aggregated PV and consumption totals over a date range.

  11. MySolensoStationInfoDevice - Full device tree for the active station (DTU + microinverters).

  12. MySolensoStationCountDevice - Device count summary (DTU, microinverters, repeaters, meters, etc.).

  13. MySolensoStationAK - Geographic and address information for the active station.

  14. MySolensoDTUSelectAll - DTU and associated microinverter list for the active station.

  15. MySolensoDTUFind - Detailed record for a single DTU.

  16. 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: object

Main 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 when token is given.

  • token (Optional[str]) – Pre-obtained session token. When provided, the authentication network call is skipped entirely.

Raises:
username

Account identifier supplied at construction.

Type:

str

password

Encrypted password kept in memory (used only during construction; not reused afterward).

Type:

Optional[str]

token

Initial token supplied at construction.

Type:

Optional[str]

auth

Session management and HTTP authorisation headers. Provides get_auth_headers_solenso() and get_auth_headers_hoymiles().

Type:

MySolensoAuth

me

Authenticated user profile (name, email, role, group).

Type:

MySolensoMe

station

PV station list and active station control. Use set_station() to switch the active station; all other services update accordingly.

Type:

MySolensoStation

stationdata

Detailed technical configuration of the active station: timezone, installed capacity, pricing, inverters.

Type:

MySolensoStationData

stationcount

Real-time and cumulative energy counters - today/month/year/lifetime yield, current power, CO₂ offset.

Type:

MySolensoStationCount

powerbyday

Intra-day grid power curve. Returns a {HH:MM: watts} mapping for the active station and a given date. Use set_day() to query a specific date.

Type:

MySolensoPowerByDay

countbydayofyear

Full production history as a {YYYY-MM-DD: Wh} dictionary covering every day since the station was commissioned.

Type:

MySolensoCountByDayOfYeay

powerbystation

Per-station power data in 15-minute intervals for a single day (PV, consumption, grid, BMS).

Type:

MySolensoPowerByStation

oempower

OEM daily PV energy list report. Returns one record per day with pv_eq (kWh) and auxiliary fields. Use set_day() to set the date range.

Type:

MySolensoOEMPower

oempowercount

OEM aggregated PV and consumption totals over a date range. Exposes total_pv and total_consumption for the configured period. Use set_day() to set the date range.

Type:

MySolensoOEMPowerCount

stationinfodevice

Full device tree for the active station. Returns the DTU and all attached microinverters with serial numbers, firmware versions, and connectivity status.

Type:

MySolensoStationInfoDevice

stationcountdevice

Device count summary for the active station. Exposes counts by device type (DTU, microinverters, repeaters, meters, BMS, etc.).

Type:

MySolensoStationCountDevice

stationak

Geographic and address information for the active station. Exposes longitude, latitude, and address.

Type:

MySolensoStationAK

dtuselectall

DTU and associated microinverter list for the active station. Use list_micros for a minimal {sn, id} projection or list_micros_info for the full records.

Type:

MySolensoDTUSelectAll

dtufind

Detailed record for a single DTU. Call set_dtu() with the DTU id before accessing all_data.

Type:

MySolensoDTUFind

microfind

Detailed record for a single microinverter. Call set_micro() with the microinverter id before accessing all_data.

Type:

MySolensoMicroFind

stationlayout

Physical panel placement data for the active station. Returns a list of DTU/microinverter records with grid coordinates (x, y). Use list_dtu to enumerate DTUs and get_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. Use set_day() to query a specific date and get_power_refresh() to force a reload.

Type:

MySolensoPowerPlayBackByDay

stationdatamodule

Daily module data download descriptor for the active station. Exposes sid, date, url, and full_url pointing 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}")