mysolenso.services.stationcount - Energy Counters

MySolenso station energy counters service.

Provides the MySolensoStationCount class, which queries the /data_count_station_real_data endpoint and exposes the cumulative and real-time energy production counters for a single PV station.

Returned metrics include today’s yield, monthly and yearly totals, lifetime production, current real power, CO₂ savings, equivalent trees planted, and timestamps for the latest data update.

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

Example

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

print(client.stationcount.today_eq)    # e.g. "12.34"  (kWh today)
print(client.stationcount.total_eq)    # e.g. "4521.0" (kWh lifetime)
print(client.stationcount.real_power)  # e.g. "2048"   (W, current)
print(client.stationcount.co2_emission_reduction)
print(client.stationcount.last_data_time)
class mysolenso.services.stationcount.MySolensoStationCount(parent)[source]

Bases: object

Real-time and cumulative energy counters for a single PV station.

Queries the /data_count_station_real_data Solenso endpoint and caches the response. All production metrics are exposed as read-only properties.

Parameters:

parent – Instance of MySolenso providing access to the auth and station sub-modules.

Raises:

MySolensoException – If parent.station.station_id is None, or if the API response is invalid.

parent

Reference to the parent MySolenso object.

Example

client = MySolenso(username="jdoe", token="tok")
sc = client.stationcount

print(sc.today_eq)               # today's yield in kWh
print(sc.month_eq)               # month-to-date yield in kWh
print(sc.year_eq)                # year-to-date yield in kWh
print(sc.total_eq)               # lifetime yield in kWh
print(sc.real_power)             # current AC output in W
print(sc.co2_emission_reduction) # CO₂ saved in kg
print(sc.plant_tree)             # equivalent trees planted
print(sc.data_time)              # data timestamp
print(sc.last_data_time)         # last measurement timestamp
print(sc.capacitor)              # installed capacity in kWp
set_station_count(id)[source]

Switch the active station and reload all counters from the API.

Parameters:

id (int) – Station ID to activate. Must exist in the account’s station list.

Raises:

MySolensoException – If id is not found in the account’s station list, or if the API call fails.

Return type:

None

Example

client.stationcount.set_station_count(43)
print(client.stationcount.today_eq)
get_station_refresh()[source]

Query the API for refresh station energy counters.

Sends a POST request to API_STATION_COUNT with the current station ID wrapped in the Solenso RAW payload format, then maps each response field onto a private attribute.

Raises:

MySolensoException – If the request fails, times out, or the JSON response is malformed.

Return type:

None

property all_data: dict

Full raw response returned by the /data_count_station_real_data endpoint.

Useful for accessing fields not exposed by the other properties.

Example

{

“is_null”: 0, “today_eq”: “17647.0”, “month_eq”: “241047”, “year_eq”: “1769064”, “total_eq”: “14685977”, “real_power”: “0”, “co2_emission_reduction”: “14641919.069”, “plant_tree”: “800”, “data_time”: “2026-05-22 21:20:06”, “last_data_time”: “2026-05-22 21:20:06”, “capacitor”: “5”, “is_balance”: 0, “is_reflux”: 0, “pv2”: 0, “clp”: 200

}

Returns:

Complete data dictionary from the API response.

Return type:

dict

property station_id: int

Identifier of the station currently loaded.

Returns:

Station ID used for the last API call.

Return type:

int

property today_eq: str

Energy produced today (Wh).

Returns:

today_eq field from the API response.

Return type:

str

property month_eq: str

Energy produced in the current calendar month (Wh).

Returns:

month_eq field from the API response.

Return type:

str

property year_eq: str

Energy produced in the current calendar year (Wh).

Returns:

year_eq field from the API response.

Return type:

str

property total_eq: str

Lifetime energy produced by the station (Wh).

Returns:

total_eq field from the API response.

Return type:

str

property real_power: str

Current AC output power of the station (W).

This value reflects the instantaneous grid injection measured at the time of the last data update.

Returns:

real_power field from the API response.

Return type:

str

property co2_emission_reduction: str

Cumulative CO₂ emissions avoided by the station (kg).

Calculated from lifetime production using a platform-defined carbon intensity factor.

Returns:

co2_emission_reduction field from the API response.

Return type:

str

property plant_tree: str

Equivalent number of trees planted, based on CO₂ savings.

A symbolic metric provided by the Solenso platform.

Returns:

plant_tree field from the API response.

Return type:

str

property data_time: str

Timestamp of the data record returned by the API.

Returns:

data_time field (format depends on API; typically YYYY-MM-DD HH:MM:SS or Unix epoch).

Return type:

str

property last_data_time: str

Timestamp of the most recent inverter measurement received.

Returns:

last_data_time field from the API response.

Return type:

str

property capacitor: str

Installed peak power of the station (kWp).

Returns:

capacitor field from the API response.

Return type:

str