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

Aggregated OEM PV and consumption energy totals over a date range.

Queries the /oem_count Solenso 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 and set_station() to switch the monitored station.

Parameters:

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

Raises:

MySolensoException – If parent.station.station_id is None.

parent

Reference to the parent MySolenso object.

Note

Data is not fetched automatically at construction time. Call set_day() (with refresh=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 id is validated against the station list from stations.

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

  • refresh (bool) – If True (default), immediately calls _get_oem_power_count() to reload data for the new station. Set to False to defer the network call.

Raises:

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

Return type:

None

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_min and day_max must be valid YYYY-MM-DD strings within [1900-01-01, today], and day_min must not be later than day_max.

Parameters:
  • day_min (str) – Start of the date range (inclusive), in YYYY-MM-DD format.

  • day_max (str) – End of the date range (inclusive), in YYYY-MM-DD format.

  • refresh (bool) – If True (default), immediately calls _get_oem_power_count() to reload data for the new range. Set to False to defer the network call.

Raises:

MySolensoException

  • If either date string is not exactly 10 characters. - If either date is outside [1900-01-01, today]. - If day_min > day_max. - If either date string cannot be parsed as YYYY-MM-DD.

Return type:

None

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:

None

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:

dict

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"), or None if the field was absent from the API response.

Return type:

str

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"), or None if the field was absent from the API response. Returns "0" when no consumption meter is installed.

Return type:

str

Example

client.oem_power_count.set_day("2026-04-01", "2026-04-30")
print(client.oem_power_count.total_consumption)  # "0"