Skip to main content

Library to interface Solenso site monitor.solenso.net.

Project description

mysolenso

PyPI TestPyPI License

Docs Workflow Status

Python Versions Downloads

Python library for the Solenso photovoltaic monitoring platform.

The library handles authentication, user profile retrieval, PV station data, real-time energy counters, historical daily production, and OEM reporting — all from a single MySolenso client object.

Note: The project is independent of Solenso. You must use your encrypted password or a token, not your plain-text password. Use pwdsolenso to obtain the encrypted credential.


Table of contents


https://www.solenso.fr/ - mysolenso

This library can read information from https://monitor.solenso.net/platform/. The project is independent of Solenso.


Installation

pip install mysolenso

The library requires Python 3.10+ and has no mandatory third-party runtime dependencies beyond the standard library and requests.


Authentication

You need two pieces of information:

Parameter Description
username Your Solenso account e-mail address.
password Your encrypted password (from pwdsolenso), or
token A pre-obtained API token (skip password when using this).
from mysolenso import MySolenso

# Option A — with encrypted password
client = MySolenso(username="jdoe", password="encrypted_pass")

# Option B — with a token
client = MySolenso(username="jdoe", token="your_api_token")

Quick start

from mysolenso import MySolenso

client = MySolenso(username="jdoe", password="encrypted_pass")

# Display the account owner name
print(client.me.name)

# Today's total energy production (kWh)
print(client.stationcount.today_eq)

# Intra-day power curve (Watts, 15-min intervals)
data = client.powerbyday.get_data
print(data["date"], data["values"])

# Full production history (Wh per day since commissioning)
history = client.day_of_year.get_data
print(history["2026-01-01"])  # e.g. 3241.5

# OEM energy totals for a date range
client.oem_power_count.set_day("2026-04-01", "2026-04-30")
print(client.oem_power_count.total_pv)   # e.g. "415.72"

Services

All services are instantiated automatically by MySolenso and are accessible as attributes on the client object.

me — User profile

print(client.me.name)       # account display name
print(client.me.email)      # account e-mail

station — Station list

# List all stations linked to the account
for s in client.station.stations:
    print(s["id"], s["name"])

# Switch the active station (all other services follow)
client.station.set_station(station_id=43)

stationdata — Station configuration

Detailed technical configuration of the active station (inverter model, capacity, timezone, etc.).

info = client.stationdata.station_data
print(info["capacity"])

stationcount — Real-time counters

Real-time and cumulative energy counters for the active station.

print(client.stationcount.today_eq)    # today's production (kWh)
print(client.stationcount.total_eq)    # all-time total (kWh)
print(client.stationcount.co2)         # CO₂ offset (kg)

powerbyday — Intra-day power curve

Grid power measurements (Watts) sampled in 15-minute intervals throughout a single day.

result = client.powerbyday.get_data
# {
#   "metric": "grid_power",
#   "date":   "2026-05-15",
#   "values": {"08:00": 512.0, "08:30": 1024.5, ...}
# }

# Query a specific date
client.powerbyday.set_day("2025-12-25")
print(client.powerbyday.get_data["values"])

# Refresh without changing the date
client.powerbyday.get_power_refresh()

day_of_year — Daily production history

Complete daily PV energy production (Wh) since the station was commissioned.

history = client.day_of_year.get_data
# {"2025-06-01": 28612.5, "2025-06-02": 31072.0, ..., "2026-05-15": 0.0}

# Days with 0 Wh (cloudy days, current day before sunset) are included
from datetime import date
print(history.get(str(date.today()), "N/A"))

# Switch station
client.day_of_year.set_station_id(43)

oem_power — OEM daily report (list)

Daily PV energy production records from the Solenso OEM endpoint, one record per day.

# Fetch records for April 2026
client.oem_power.set_day("2026-04-01", "2026-04-30")

# Full records (all API fields)
for record in client.oem_power.all_data:
    print(record["date"], record["pv_eq"], "kWh")

# Simplified {date, power} view
for entry in client.oem_power.power_data:
    print(entry["date"], entry["power"])

# Refresh data
client.oem_power.oem_pv_refresh()

Each record contains: sid, name, tz_name, date, pv_eq, consumption_eq, meter_c_eq, meter_location, capacitor, create_at, p2g, lfg, eq_hour.

oem_power_count — OEM aggregated totals

Aggregated PV and consumption energy totals for the active station over a date range (single API call, no pagination).

client.oem_power_count.set_day("2026-04-01", "2026-04-30")

print(client.oem_power_count.total_pv)           # "415.72" (kWh)
print(client.oem_power_count.total_consumption)   # "0" (kWh, or actual value)
print(client.oem_power_count.all_data)            # raw dict

# Refresh
client.oem_power_count.oem_power_refresh()

Error handling

All library errors inherit from MySolensoException:

from mysolenso import (
    MySolenso,
    MySolensoException,
    MySolensoAuthenticationException,
    MySolensoConnectionException,
)

try:
    client = MySolenso(username="jdoe", password="wrong_pass")
except MySolensoAuthenticationException as e:
    print("Bad credentials:", e)
except MySolensoConnectionException as e:
    print("Connection problem:", e)
except MySolensoException as e:
    print("General library error:", e)
Exception When raised
MySolensoException Base class — catches everything.
MySolensoConnectionException Invalid arguments (empty username, missing credentials) or network issue before the request.
MySolensoAuthenticationException API returned an error status, unexpected message, or token was absent from the response.

Running the tests

Tests require pytest. Install the package in editable mode first:

pip install -e ".[dev]"
# or just:
pip install pytest

PYTHONPATH=./src pytest tests/ -v

Test files:

File Covers
tests/test_00_solenso_api.py Authentication and core API
tests/test_10_service_me.py User profile service
tests/test_11_service_station.py Station list service
tests/test_12_service_stationdata.py Station data service
tests/test_13_service_stationcount.py Real-time counters
tests/test_14_service_dayofyear.py Daily production history
tests/test_15_service_powerbyday.py Intra-day power curve
tests/test_20_report_powerbystation.py Per-station power report
tests/test_21_report_oempower.py OEM daily list report
tests/test_22_report_oempowercount.py OEM aggregated totals

Example scripts

Generic example

PYTHONPATH=./src/ python3 example.py --username <USER> --password <PASSWORD_CRYPT>

See example.py for a full walkthrough of the basic services.

Report example

PYTHONPATH=./src/ python3 example_reports.py --username <USER> --password <PASSWORD_CRYPT>

See example_reports.py for OEM report usage.


Documentation

Full API documentation is available at thanatos-vf-2000.github.io/mysolenso.


Help

  • You must use your crypt password or a token, not your password directly. To do this, use the project pwdsolenso.

Contributing

Contributions of all kinds are welcome. Please read the contributing guide for development workflows and coding conventions.

Issues ➡️


Issues

You can create issues in this repository to plan, discuss, and track work. Issues can track bug reports, new features and ideas, and anything else you need to write down or discuss. ➡️ Go to issues ⬅️


License

Copyright 2026 @Franck VANHOUCKE

Licensed under the Apache License, Version 2.0.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mysolenso-1.1.0.tar.gz (56.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mysolenso-1.1.0-py3-none-any.whl (56.5 kB view details)

Uploaded Python 3

File details

Details for the file mysolenso-1.1.0.tar.gz.

File metadata

  • Download URL: mysolenso-1.1.0.tar.gz
  • Upload date:
  • Size: 56.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mysolenso-1.1.0.tar.gz
Algorithm Hash digest
SHA256 e549fb0ae57d5a69462464f622d565b44096d587b3f51ca61bc30e6450f6ef24
MD5 6b0b376342bb89403975f2cf30ee82f9
BLAKE2b-256 4095c5bb3b2bc896605afeae22fab103c0ded267496b06bb6771907420f74837

See more details on using hashes here.

Provenance

The following attestation bundles were made for mysolenso-1.1.0.tar.gz:

Publisher: publish-to-test-pypi.yml on thanatos-vf-2000/mysolenso

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mysolenso-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: mysolenso-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 56.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mysolenso-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d2e9c596468ab478ed58f980514cc50ef2582507c63ecb0b15588d535fea193f
MD5 5dd9aadee632e87e2dd4b53ba13bcac5
BLAKE2b-256 acdb34ddf383309fa79e55b9938411b0b8dfb8d183312e757a35038af19fe93e

See more details on using hashes here.

Provenance

The following attestation bundles were made for mysolenso-1.1.0-py3-none-any.whl:

Publisher: publish-to-test-pypi.yml on thanatos-vf-2000/mysolenso

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page