mysolenso.services.reports.oempowercount - OEM PV energy totals (count) report service
MySolenso OEM PV energy totals (count) report service.
Provides the MySolensoOEMPowerCount class, which queries the
/oem_count Solenso endpoint and returns aggregated PV and consumption
energy totals for a given station over a configurable date range.
Unlike MySolensoOEMPower,
which returns one record per day, this service returns a single
aggregated summary for the entire requested date range:
total_pv_eq- total PV energy produced (kWh, as a string).total_consumption_eq- total consumption energy (kWh, or"0"when no consumption meter is present).
By default the service queries today (or yesterday before 01:00).
Use set_day() to change the date range
and set_station() to switch the station.
This module is instantiated automatically by MySolenso
and is accessible via client.oem_power_count.
Example
client = MySolenso(username="user", token="tok")
client.oem_power_count.set_day("2026-04-01", "2026-04-30")
print(client.oem_power_count.total_pv) # e.g. "91.22"
print(client.oem_power_count.total_consumption) # e.g. "0"
print(client.oem_power_count.all_data) # raw dict
- class mysolenso.services.reports.oempowercount.MySolensoOEMPowerCount(parent)[source]
Bases:
objectAggregated OEM PV and consumption energy totals over a date range.
Queries the
/oem_countSolenso endpoint and exposes the total PV energy produced and total consumption energy for the active station over the configured date range.The date range defaults to today (or yesterday before 01:00 to avoid empty datasets at midnight). Call
set_day()to change it andset_station()to switch the monitored station.- Parameters:
parent – Instance of
MySolensoproviding access to theauthandstationsub-modules.- Raises:
MySolensoException – If
parent.station.station_idisNone.
- parent
Reference to the parent
MySolensoobject.
Note
Data is not fetched automatically at construction time. Call
set_day()(withrefresh=True, the default) or_get_oem_power_count()explicitly to load the first dataset.Example
client = MySolenso(username="admin", token="tok") count = client.oem_power_count count.set_day("2026-04-01", "2026-04-30") print(count.total_pv) # "415.72" print(count.total_consumption) # "0"
- set_station(id, refresh=True)[source]
Switch the active station and optionally reload power count data.
The provided
idis validated against the station list fromstations.- Parameters:
- Raises:
MySolensoException – If
idis not found in the account’s station list, or if the subsequent API call fails.- Return type:
Example
client.oem_power_count.set_station(43) print(client.oem_power_count.total_pv)
- set_day(day_min, day_max, refresh=True)[source]
Set the query date range and optionally reload the data.
Both
day_minandday_maxmust be validYYYY-MM-DDstrings within[1900-01-01, today], andday_minmust not be later thanday_max.- Parameters:
- Raises:
If either date string is not exactly 10 characters. - If either date is outside
[1900-01-01, today]. - Ifday_min > day_max. - If either date string cannot be parsed asYYYY-MM-DD.
- Return type:
-
client.oem_power_count.set_day("2026-01-01", "2026-03-31") print(client.oem_power_count.total_pv)
- oem_power_refresh()[source]
Re-fetch OEM power count data for the current station and range.
Convenience method that delegates to
_get_oem_power_count(). Call this after the underlying data may have changed (e.g. for intra-day monitoring).Example
client.oem_power_count.oem_power_refresh() print(client.oem_power_count.total_pv)
- Return type:
- property all_data: dict
Raw aggregated response dictionary from the API.
Returns the complete JSON object as returned by
/oem_count, without any post-processing.- Returns:
Aggregated energy totals for the active station and date range, typically containing:
"total_pv_eq"(str) - total PV energy in kWh."total_consumption_eq"(str) - total consumption in kWh.
- Return type:
Example
client.oem_power_count.set_day("2026-04-01", "2026-04-30") print(client.oem_power_count.all_data) # {"total_pv_eq": "91.22", "total_consumption_eq": "0"}
Data example:
{ "total_pv_eq": "91.22", "total_consumption_eq": "0" }
- property total_pv: str
Total PV energy produced over the queried date range (kWh).
- Returns:
PV energy total as a string (e.g.
"91.22"), orNoneif the field was absent from the API response.- Return type:
Example
client.oem_power_count.set_day("2026-04-01", "2026-04-30") print(client.oem_power_count.total_pv) # "91.22"
- property total_consumption: str
Total consumption energy over the queried date range (kWh).
- Returns:
Consumption energy total as a string (e.g.
"0"), orNoneif the field was absent from the API response. Returns"0"when no consumption meter is installed.- Return type:
Example
client.oem_power_count.set_day("2026-04-01", "2026-04-30") print(client.oem_power_count.total_consumption) # "0"