SunPower PVS6 API Models

These Pydantic models are used to represent the request and response models for the SunPower PVS6 API.

Request and Response Models

These models may be used as types for the fields in other models on this page.

Devices

pydantic model sungazer.models.devices.BaseDeviceDetail[source]

Bases: BaseModel

Base model containing common fields for all device types in the system.

This model serves as the foundation for all device detail models, providing standard fields like identification information (serial, model), version data, operational status, and temporal information. All specific device types extend this model with additional specialized fields.

Show JSON schema
{
   "title": "BaseDeviceDetail",
   "description": "Base model containing common fields for all device types in the system.\n\nThis model serves as the foundation for all device detail models, providing\nstandard fields like identification information (serial, model), version data,\noperational status, and temporal information. All specific device types\nextend this model with additional specialized fields.",
   "type": "object",
   "properties": {
      "ISDETAIL": {
         "default": true,
         "description": "Details about the device",
         "examples": [
            true
         ],
         "title": "Isdetail",
         "type": "boolean"
      },
      "STATE": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "State of the device",
         "examples": [
            "working"
         ],
         "title": "State"
      },
      "STATEDESCR": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Description of the state",
         "examples": [
            "Working"
         ],
         "title": "Statedescr"
      },
      "SERIAL": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The serial number of the device",
         "examples": [
            "ZT112345678912A0069"
         ],
         "title": "Serial"
      },
      "MODEL": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The manufacturer's model of the device",
         "examples": [
            "PVS6M0400p"
         ],
         "title": "Model"
      },
      "HWVER": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The hardware version",
         "examples": [
            "6.02"
         ],
         "title": "Hwver"
      },
      "SWVER": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The software version  of the firmware",
         "examples": [
            "2021.9, Build 41001"
         ],
         "title": "Swver"
      },
      "DEVICE_TYPE": {
         "anyOf": [
            {
               "enum": [
                  "PVS",
                  "Power Meter",
                  "Inverter",
                  "PV Disconnect",
                  "Gateway",
                  "Storage Inverter",
                  "ESS BMS",
                  "Battery",
                  "Energy Storage System"
               ],
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Device Type"
      },
      "TYPE": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The detailed type of the device (usually includes the manufacturer)",
         "examples": [
            "PVS5-METER-P"
         ],
         "title": "Type"
      },
      "PORT": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The port the device is connected to",
         "examples": [
            "COM1"
         ],
         "title": "Port"
      },
      "DATATIME": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The time the data was recorded",
         "title": "Datatime"
      },
      "CURTIME": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The current time as reported by the device",
         "title": "Curtime"
      },
      "OPERATION": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Operation type",
         "examples": [
            "noop"
         ],
         "title": "Operation"
      },
      "origin": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Origin of this data",
         "examples": [
            "data_logger"
         ],
         "title": "Origin"
      },
      "panid": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "PAN ID is used to determine whether an MI is A) Un-associated (panid = 0),B) owned by 'me' (mi.panid == pvs.panid) or C) owned by someone else (mi.panid != 0 && mi.panid != pvs.panid)",
         "title": "Panid"
      }
   }
}

Fields:
Validators:
field CURTIME: datetime | None = None

The current time as reported by the device

Validated by:
field DATATIME: datetime | None = None

The time the data was recorded

Validated by:
field DEVICE_TYPE: Literal['PVS', 'Power Meter', 'Inverter', 'PV Disconnect', 'Gateway', 'Storage Inverter', 'ESS BMS', 'Battery', 'Energy Storage System'] | None = None

The device type

field HWVER: str | None = None

The hardware version

field ISDETAIL: bool = True

Details about the device

field MODEL: str | None = None

The manufacturer’s model of the device

field OPERATION: str | None = None

Operation type

field PORT: str | None = None

The port the device is connected to

field SERIAL: str | None = None

The serial number of the device

field STATE: str | None = None

State of the device

field STATEDESCR: str | None = None

Description of the state

field SWVER: str | None = None

The software version of the firmware

field TYPE: str | None = None

The detailed type of the device (usually includes the manufacturer)

field origin: str | None = None

Origin of this data

field panid: float | None = None

PAN ID is used to determine whether an MI is A) Un-associated (panid = 0),B) owned by ‘me’ (mi.panid == pvs.panid) or C) owned by someone else (mi.panid != 0 && mi.panid != pvs.panid)

classmethod construct(_fields_set: set[str] | None = None, **values: Any) Self
model_copy(*, update: Mapping[str, Any] | None = None, deep: bool = False) Self
!!! abstract “Usage Documentation”

[model_copy](../concepts/serialization.md#model_copy)

Returns a copy of the model.

!!! note

The underlying instance’s [__dict__][object.__dict__] attribute is copied. This might have unexpected side effects if you store anything in it, on top of the model fields (e.g. the value of [cached properties][functools.cached_property]).

Parameters:
  • update – Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data.

  • deep – Set to True to make a deep copy of the model.

Returns:

New model instance.

classmethod model_validate(obj: Any, *, strict: bool | None = None, from_attributes: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate a pydantic model instance.

Parameters:
  • obj – The object to validate.

  • strict – Whether to enforce types strictly.

  • from_attributes – Whether to extract data from object attributes.

  • context – Additional context to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Raises:

ValidationError – If the object could not be validated.

Returns:

The validated model instance.

classmethod model_validate_json(json_data: str | bytes | bytearray, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self
!!! abstract “Usage Documentation”

[JSON Parsing](../concepts/json.md#json-parsing)

Validate the given JSON data against the Pydantic model.

Parameters:
  • json_data – The JSON data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Raises:

ValidationError – If json_data is not a JSON string or the object could not be validated.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

classmethod parse_file(path: str | Path, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self
classmethod parse_obj(obj: Any) Self
classmethod parse_raw(b: str | bytes, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self
validator parse_timestamp  »  CURTIME, DATATIME[source]

Convert timestamp strings to datetime objects.

Handles various timestamp formats found in the API responses:

  • PVS6 comma-separated format: “2025,06,22,00,15,54”

  • Already parsed datetime objects

Parameters:

v – The timestamp value to parse, can be a string or datetime object.

Raises:

ValueError – If the timestamp format is invalid or cannot be parsed.

pydantic model sungazer.models.devices.Battery[source]

Bases: BaseDeviceDetail

Model representing a Battery device in the solar system.

This model extends the base device details with Battery-specific metrics including battery management capabilities, monitoring parameters, and operational status. Battery devices provide energy storage functionality for solar installations, storing excess energy for later use.

This device type appears in the device list when using Command=DeviceList if a Battery is connected to the PVS6 system.

Show JSON schema
{
   "title": "Battery",
   "description": "Model representing a Battery device in the solar system.\n\nThis model extends the base device details with Battery-specific\nmetrics including battery management capabilities, monitoring parameters,\nand operational status. Battery devices provide energy storage\nfunctionality for solar installations, storing excess energy for later use.\n\nThis device type appears in the device list when using ``Command=DeviceList``\nif a Battery is connected to the PVS6 system.",
   "type": "object",
   "properties": {
      "ISDETAIL": {
         "default": true,
         "description": "Details about the device",
         "examples": [
            true
         ],
         "title": "Isdetail",
         "type": "boolean"
      },
      "STATE": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "State of the device",
         "examples": [
            "working"
         ],
         "title": "State"
      },
      "STATEDESCR": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Description of the state",
         "examples": [
            "Working"
         ],
         "title": "Statedescr"
      },
      "SERIAL": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The serial number of the device",
         "examples": [
            "ZT112345678912A0069"
         ],
         "title": "Serial"
      },
      "MODEL": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The manufacturer's model of the device",
         "examples": [
            "PVS6M0400p"
         ],
         "title": "Model"
      },
      "HWVER": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The hardware version",
         "examples": [
            "6.02"
         ],
         "title": "Hwver"
      },
      "SWVER": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The software version  of the firmware",
         "examples": [
            "2021.9, Build 41001"
         ],
         "title": "Swver"
      },
      "DEVICE_TYPE": {
         "anyOf": [
            {
               "enum": [
                  "PVS",
                  "Power Meter",
                  "Inverter",
                  "PV Disconnect",
                  "Gateway",
                  "Storage Inverter",
                  "ESS BMS",
                  "Battery",
                  "Energy Storage System"
               ],
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Device Type"
      },
      "TYPE": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The detailed type of the device (usually includes the manufacturer)",
         "examples": [
            "PVS5-METER-P"
         ],
         "title": "Type"
      },
      "PORT": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The port the device is connected to",
         "examples": [
            "COM1"
         ],
         "title": "Port"
      },
      "DATATIME": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The time the data was recorded",
         "title": "Datatime"
      },
      "CURTIME": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The current time as reported by the device",
         "title": "Curtime"
      },
      "OPERATION": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Operation type",
         "examples": [
            "noop"
         ],
         "title": "Operation"
      },
      "origin": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Origin of this data",
         "examples": [
            "data_logger"
         ],
         "title": "Origin"
      },
      "panid": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "PAN ID is used to determine whether an MI is A) Un-associated (panid = 0),B) owned by 'me' (mi.panid == pvs.panid) or C) owned by someone else (mi.panid != 0 && mi.panid != pvs.panid)",
         "title": "Panid"
      },
      "interface": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The type of interface used by the battery",
         "examples": [
            "none"
         ],
         "title": "Interface"
      },
      "parent": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The parent device identifier",
         "examples": [
            11
         ],
         "title": "Parent"
      },
      "PARENT": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The parent device serial number",
         "examples": [
            "00001ABC1234_01234567890ABCDEF"
         ],
         "title": "Parent"
      },
      "hw_version": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The hardware version of the battery",
         "examples": [
            "4.34"
         ],
         "title": "Hw Version"
      },
      "DESCR": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Description of the battery",
         "examples": [
            "Battery M00122109A0355"
         ],
         "title": "Descr"
      }
   }
}

Fields:
Validators:
field CURTIME: datetime | None = None

The current time as reported by the device

Validated by:
field DATATIME: datetime | None = None

The time the data was recorded

Validated by:
field DESCR: str | None = None

Description of the battery

field DEVICE_TYPE: DeviceType | None = None

The device type

field HWVER: str | None = None

The hardware version

field ISDETAIL: bool = True

Details about the device

field MODEL: str | None = None

The manufacturer’s model of the device

field OPERATION: str | None = None

Operation type

field PARENT: str | None = None

The parent device serial number

field PORT: str | None = None

The port the device is connected to

field SERIAL: str | None = None

The serial number of the device

field STATE: str | None = None

State of the device

field STATEDESCR: str | None = None

Description of the state

field SWVER: str | None = None

The software version of the firmware

field TYPE: str | None = None

The detailed type of the device (usually includes the manufacturer)

field hw_version: str | None = None

The hardware version of the battery

field interface: str | None = None

The type of interface used by the battery

field origin: str | None = None

Origin of this data

field panid: float | None = None

PAN ID is used to determine whether an MI is A) Un-associated (panid = 0),B) owned by ‘me’ (mi.panid == pvs.panid) or C) owned by someone else (mi.panid != 0 && mi.panid != pvs.panid)

field parent: int | None = None

The parent device identifier

classmethod construct(_fields_set: set[str] | None = None, **values: Any) Self
model_copy(*, update: Mapping[str, Any] | None = None, deep: bool = False) Self
!!! abstract “Usage Documentation”

[model_copy](../concepts/serialization.md#model_copy)

Returns a copy of the model.

!!! note

The underlying instance’s [__dict__][object.__dict__] attribute is copied. This might have unexpected side effects if you store anything in it, on top of the model fields (e.g. the value of [cached properties][functools.cached_property]).

Parameters:
  • update – Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data.

  • deep – Set to True to make a deep copy of the model.

Returns:

New model instance.

classmethod model_validate(obj: Any, *, strict: bool | None = None, from_attributes: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate a pydantic model instance.

Parameters:
  • obj – The object to validate.

  • strict – Whether to enforce types strictly.

  • from_attributes – Whether to extract data from object attributes.

  • context – Additional context to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Raises:

ValidationError – If the object could not be validated.

Returns:

The validated model instance.

classmethod model_validate_json(json_data: str | bytes | bytearray, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self
!!! abstract “Usage Documentation”

[JSON Parsing](../concepts/json.md#json-parsing)

Validate the given JSON data against the Pydantic model.

Parameters:
  • json_data – The JSON data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Raises:

ValidationError – If json_data is not a JSON string or the object could not be validated.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

classmethod parse_file(path: str | Path, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self
classmethod parse_obj(obj: Any) Self
classmethod parse_raw(b: str | bytes, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self
validator parse_timestamp  »  DATATIME, CURTIME

Convert timestamp strings to datetime objects.

Handles various timestamp formats found in the API responses:

  • PVS6 comma-separated format: “2025,06,22,00,15,54”

  • Already parsed datetime objects

Parameters:

v – The timestamp value to parse, can be a string or datetime object.

Raises:

ValueError – If the timestamp format is invalid or cannot be parsed.

pydantic model sungazer.models.devices.ConsumptionPowerMeterDeviceDetail[source]

Bases: PowerMeterDeviceDetail

Model representing a consumption power meter that measures site power usage.

This model extends the production power meter details with consumption-specific metrics including multi-lead current and voltage readings, detailed phase measurements, and bidirectional energy flow accounting (import from and export to the utility grid).

Consumption meters monitor electricity used by the building, typically showing non-zero values even at night, and when solar production is insufficient to meet current demand.

This device type appears in the device list when using Command=DeviceList if a consumption power meter is connected to the PVS6.

Show JSON schema
{
   "title": "ConsumptionPowerMeterDeviceDetail",
   "description": "Model representing a consumption power meter that measures site power usage.\n\nThis model extends the production power meter details with\nconsumption-specific metrics including multi-lead current and voltage\nreadings, detailed phase measurements, and bidirectional energy flow\naccounting (import from and export to the utility grid).\n\nConsumption meters monitor electricity used by the building, typically\nshowing non-zero values even at night, and when solar production is\ninsufficient to meet current demand.\n\nThis device type appears in the device list when using\n``Command=DeviceList`` if a consumption power meter is connected to the\nPVS6.",
   "type": "object",
   "properties": {
      "ISDETAIL": {
         "default": true,
         "description": "Details about the device",
         "examples": [
            true
         ],
         "title": "Isdetail",
         "type": "boolean"
      },
      "STATE": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "State of the device",
         "examples": [
            "working"
         ],
         "title": "State"
      },
      "STATEDESCR": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Description of the state",
         "examples": [
            "Working"
         ],
         "title": "Statedescr"
      },
      "SERIAL": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The serial number of the device",
         "examples": [
            "ZT112345678912A0069"
         ],
         "title": "Serial"
      },
      "MODEL": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The manufacturer's model of the device",
         "examples": [
            "PVS6M0400p"
         ],
         "title": "Model"
      },
      "HWVER": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The hardware version",
         "examples": [
            "6.02"
         ],
         "title": "Hwver"
      },
      "SWVER": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The software version  of the firmware",
         "examples": [
            "2021.9, Build 41001"
         ],
         "title": "Swver"
      },
      "DEVICE_TYPE": {
         "anyOf": [
            {
               "enum": [
                  "PVS",
                  "Power Meter",
                  "Inverter",
                  "PV Disconnect",
                  "Gateway",
                  "Storage Inverter",
                  "ESS BMS",
                  "Battery",
                  "Energy Storage System"
               ],
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Device Type"
      },
      "TYPE": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The detailed type of the device (usually includes the manufacturer)",
         "examples": [
            "PVS5-METER-P"
         ],
         "title": "Type"
      },
      "PORT": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The port the device is connected to",
         "examples": [
            "COM1"
         ],
         "title": "Port"
      },
      "DATATIME": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The time the data was recorded",
         "title": "Datatime"
      },
      "CURTIME": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The current time as reported by the device",
         "title": "Curtime"
      },
      "OPERATION": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Operation type",
         "examples": [
            "noop"
         ],
         "title": "Operation"
      },
      "origin": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Origin of this data",
         "examples": [
            "data_logger"
         ],
         "title": "Origin"
      },
      "panid": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "PAN ID is used to determine whether an MI is A) Un-associated (panid = 0),B) owned by 'me' (mi.panid == pvs.panid) or C) owned by someone else (mi.panid != 0 && mi.panid != pvs.panid)",
         "title": "Panid"
      },
      "interface": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The type of interface used by the device",
         "examples": [
            "mime"
         ],
         "title": "Interface"
      },
      "subtype": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The subtype of meter",
         "examples": [
            "GROSS_PRODUCTION_SITE"
         ],
         "title": "Subtype"
      },
      "ct_scl_fctr": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Current capacity of the calibration-reference CT sensor in Amps.",
         "examples": [
            50
         ],
         "title": "Ct Scl Fctr"
      },
      "net_ltea_3phsum_kwh": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Net cumulative kWh, across all 3 phases",
         "examples": [
            198.92
         ],
         "title": "Net Ltea 3Phsum Kwh"
      },
      "p_3phsum_kw": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Average real power (kW)",
         "examples": [
            1.9867
         ],
         "title": "P 3Phsum Kw"
      },
      "q_3phsum_kvar": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Average reactive power (kVA) across all 3 phases",
         "examples": [
            0.1234
         ],
         "title": "Q 3Phsum Kvar"
      },
      "s_3phsum_kva": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Average apparent power (kVA) across all 3 phases",
         "examples": [
            2.0
         ],
         "title": "S 3Phsum Kva"
      },
      "tot_pf_rto": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Total power factor ratio, defined as real power (kW) divided by apparent (kVA)",
         "examples": [
            0.993
         ],
         "title": "Tot Pf Rto"
      },
      "freq_hz": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Operating Frequency in Hz",
         "examples": [
            60.0
         ],
         "title": "Freq Hz"
      },
      "CAL0": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The sensor's current capacity for the calibration-reference CT sensor.It will be 50 (50A) for the production meter and 100 or 200 for the consumption meter.",
         "examples": [
            50
         ],
         "title": "Cal0"
      },
      "v12_v": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Supply Voltage sum accross C1 and C2 leads (typically in the 220-140V range)",
         "examples": [
            208.0
         ],
         "title": "V12 V"
      },
      "consumption_subtype_enum": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The consumption subtype enum",
         "examples": [
            "NET_CONSUMPTION_LOADSIDE"
         ],
         "title": "Consumption Subtype Enum"
      },
      "i1_a": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The sensor's current capacity for the calibration-reference CT sensor.It will be 50 (50A) for the production meter and 100 or 200 for the consumption meter.",
         "examples": [
            1.2
         ],
         "title": "I1 A"
      },
      "i2_a": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Current in Amps on CT2 lead",
         "examples": [
            1.2
         ],
         "title": "I2 A"
      },
      "v1n_v": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Voltage in Volts on lead 1 to neutral",
         "examples": [
            120.0
         ],
         "title": "V1N V"
      },
      "v2n_v": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Voltage in Volts on lead 2 to neutral",
         "examples": [
            120.0
         ],
         "title": "V2N V"
      },
      "p1_kw": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Lead 1 average power in kW",
         "examples": [
            0.123
         ],
         "title": "P1 Kw"
      },
      "p2_kw": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Lead 2 average power in kW",
         "examples": [
            0.123
         ],
         "title": "P2 Kw"
      },
      "neg_ltea_3phsum_kwh": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Cumulative kWh imported from utility",
         "examples": [
            123.45
         ],
         "title": "Neg Ltea 3Phsum Kwh"
      },
      "pos_ltea_3phsum_kwh": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Cumulative kWh exported to utility",
         "examples": [
            234.56
         ],
         "title": "Pos Ltea 3Phsum Kwh"
      }
   }
}

Fields:
Validators:
field CAL0: int | None = None

The sensor’s current capacity for the calibration-reference CT sensor.It will be 50 (50A) for the production meter and 100 or 200 for the consumption meter.

field CURTIME: datetime | None = None

The current time as reported by the device

Validated by:
field DATATIME: datetime | None = None

The time the data was recorded

Validated by:
field DEVICE_TYPE: DeviceType | None = None

The device type

field HWVER: str | None = None

The hardware version

field ISDETAIL: bool = True

Details about the device

field MODEL: str | None = None

The manufacturer’s model of the device

field OPERATION: str | None = None

Operation type

field PORT: str | None = None

The port the device is connected to

field SERIAL: str | None = None

The serial number of the device

field STATE: str | None = None

State of the device

field STATEDESCR: str | None = None

Description of the state

field SWVER: str | None = None

The software version of the firmware

field TYPE: str | None = None

The detailed type of the device (usually includes the manufacturer)

field consumption_subtype_enum: str | None = None

The consumption subtype enum

field ct_scl_fctr: int | None = None

Current capacity of the calibration-reference CT sensor in Amps.

field freq_hz: float | None = None

Operating Frequency in Hz

field i1_a: float | None = None

The sensor’s current capacity for the calibration-reference CT sensor.It will be 50 (50A) for the production meter and 100 or 200 for the consumption meter.

field i2_a: float | None = None

Current in Amps on CT2 lead

field interface: str | None = None

The type of interface used by the device

field neg_ltea_3phsum_kwh: float | None = None

Cumulative kWh imported from utility

field net_ltea_3phsum_kwh: float | None = None

Net cumulative kWh, across all 3 phases

field origin: str | None = None

Origin of this data

field p1_kw: float | None = None

Lead 1 average power in kW

field p2_kw: float | None = None

Lead 2 average power in kW

field p_3phsum_kw: float | None = None

Average real power (kW)

field panid: float | None = None

PAN ID is used to determine whether an MI is A) Un-associated (panid = 0),B) owned by ‘me’ (mi.panid == pvs.panid) or C) owned by someone else (mi.panid != 0 && mi.panid != pvs.panid)

field pos_ltea_3phsum_kwh: float | None = None

Cumulative kWh exported to utility

field q_3phsum_kvar: float | None = None

Average reactive power (kVA) across all 3 phases

field s_3phsum_kva: float | None = None

Average apparent power (kVA) across all 3 phases

field subtype: str | None = None

The subtype of meter

field tot_pf_rto: float | None = None

Total power factor ratio, defined as real power (kW) divided by apparent (kVA)

field v12_v: float | None = None

Supply voltage sum accross C1 and C2 leads (typically in the 220-140V range)

Supply Voltage sum accross C1 and C2 leads (typically in the 220-140V range)

field v1n_v: float | None = None

Voltage in Volts on lead 1 to neutral

field v2n_v: float | None = None

Voltage in Volts on lead 2 to neutral

classmethod construct(_fields_set: set[str] | None = None, **values: Any) Self
model_copy(*, update: Mapping[str, Any] | None = None, deep: bool = False) Self
!!! abstract “Usage Documentation”

[model_copy](../concepts/serialization.md#model_copy)

Returns a copy of the model.

!!! note

The underlying instance’s [__dict__][object.__dict__] attribute is copied. This might have unexpected side effects if you store anything in it, on top of the model fields (e.g. the value of [cached properties][functools.cached_property]).

Parameters:
  • update – Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data.

  • deep – Set to True to make a deep copy of the model.

Returns:

New model instance.

classmethod model_validate(obj: Any, *, strict: bool | None = None, from_attributes: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate a pydantic model instance.

Parameters:
  • obj – The object to validate.

  • strict – Whether to enforce types strictly.

  • from_attributes – Whether to extract data from object attributes.

  • context – Additional context to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Raises:

ValidationError – If the object could not be validated.

Returns:

The validated model instance.

classmethod model_validate_json(json_data: str | bytes | bytearray, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self
!!! abstract “Usage Documentation”

[JSON Parsing](../concepts/json.md#json-parsing)

Validate the given JSON data against the Pydantic model.

Parameters:
  • json_data – The JSON data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Raises:

ValidationError – If json_data is not a JSON string or the object could not be validated.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

classmethod parse_file(path: str | Path, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self
classmethod parse_obj(obj: Any) Self
classmethod parse_raw(b: str | bytes, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self
validator parse_timestamp  »  CURTIME, DATATIME

Convert timestamp strings to datetime objects.

Handles various timestamp formats found in the API responses:

  • PVS6 comma-separated format: “2025,06,22,00,15,54”

  • Already parsed datetime objects

Parameters:

v – The timestamp value to parse, can be a string or datetime object.

Raises:

ValueError – If the timestamp format is invalid or cannot be parsed.

pydantic model sungazer.models.devices.DeviceDetailResponse[source]

Bases: BaseModel

Response model for the Command=DeviceList API endpoint.

This model provides a comprehensive inventory of all devices in the solar system, including the PVS controller, power meters (both production and consumption), and individual microinverters. It handles the heterogeneous nature of the device list by implementing custom parsing logic in the new() class method.

The response includes convenience properties to easily access specific device types (pvs, inverters, production_meter, consumption_meter) without having to filter the devices list manually.

Show JSON schema
{
   "title": "DeviceDetailResponse",
   "description": "Response model for the ``Command=DeviceList`` API endpoint.\n\nThis model provides a comprehensive inventory of all devices in the solar\nsystem, including the PVS controller, power meters (both production and\nconsumption), and individual microinverters. It handles the heterogeneous\nnature of the device list by implementing custom parsing logic in the new()\nclass method.\n\nThe response includes convenience properties to easily access specific\ndevice types (pvs, inverters, production_meter, consumption_meter) without\nhaving to filter the devices list manually.",
   "type": "object",
   "properties": {
      "devices": {
         "anyOf": [
            {
               "items": {
                  "anyOf": [
                     {
                        "$ref": "#/$defs/PVSDeviceDetail"
                     },
                     {
                        "$ref": "#/$defs/ProductionPowerMeterDeviceDetail"
                     },
                     {
                        "$ref": "#/$defs/ConsumptionPowerMeterDeviceDetail"
                     },
                     {
                        "$ref": "#/$defs/SolarBridgeDeviceDetail"
                     },
                     {
                        "$ref": "#/$defs/PVDisconnectDetail"
                     },
                     {
                        "$ref": "#/$defs/Gateway"
                     },
                     {
                        "$ref": "#/$defs/SchneiderXwPro"
                     },
                     {
                        "$ref": "#/$defs/EquinioxBMS"
                     },
                     {
                        "$ref": "#/$defs/Battery"
                     },
                     {
                        "$ref": "#/$defs/EquinoxESS"
                     }
                  ]
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Devices"
      },
      "result": {
         "examples": [
            "success"
         ],
         "title": "Result",
         "type": "string"
      }
   },
   "$defs": {
      "Battery": {
         "description": "Model representing a Battery device in the solar system.\n\nThis model extends the base device details with Battery-specific\nmetrics including battery management capabilities, monitoring parameters,\nand operational status. Battery devices provide energy storage\nfunctionality for solar installations, storing excess energy for later use.\n\nThis device type appears in the device list when using ``Command=DeviceList``\nif a Battery is connected to the PVS6 system.",
         "properties": {
            "ISDETAIL": {
               "default": true,
               "description": "Details about the device",
               "examples": [
                  true
               ],
               "title": "Isdetail",
               "type": "boolean"
            },
            "STATE": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "State of the device",
               "examples": [
                  "working"
               ],
               "title": "State"
            },
            "STATEDESCR": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Description of the state",
               "examples": [
                  "Working"
               ],
               "title": "Statedescr"
            },
            "SERIAL": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The serial number of the device",
               "examples": [
                  "ZT112345678912A0069"
               ],
               "title": "Serial"
            },
            "MODEL": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The manufacturer's model of the device",
               "examples": [
                  "PVS6M0400p"
               ],
               "title": "Model"
            },
            "HWVER": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The hardware version",
               "examples": [
                  "6.02"
               ],
               "title": "Hwver"
            },
            "SWVER": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The software version  of the firmware",
               "examples": [
                  "2021.9, Build 41001"
               ],
               "title": "Swver"
            },
            "DEVICE_TYPE": {
               "anyOf": [
                  {
                     "enum": [
                        "PVS",
                        "Power Meter",
                        "Inverter",
                        "PV Disconnect",
                        "Gateway",
                        "Storage Inverter",
                        "ESS BMS",
                        "Battery",
                        "Energy Storage System"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Device Type"
            },
            "TYPE": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The detailed type of the device (usually includes the manufacturer)",
               "examples": [
                  "PVS5-METER-P"
               ],
               "title": "Type"
            },
            "PORT": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The port the device is connected to",
               "examples": [
                  "COM1"
               ],
               "title": "Port"
            },
            "DATATIME": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The time the data was recorded",
               "title": "Datatime"
            },
            "CURTIME": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The current time as reported by the device",
               "title": "Curtime"
            },
            "OPERATION": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Operation type",
               "examples": [
                  "noop"
               ],
               "title": "Operation"
            },
            "origin": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Origin of this data",
               "examples": [
                  "data_logger"
               ],
               "title": "Origin"
            },
            "panid": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "PAN ID is used to determine whether an MI is A) Un-associated (panid = 0),B) owned by 'me' (mi.panid == pvs.panid) or C) owned by someone else (mi.panid != 0 && mi.panid != pvs.panid)",
               "title": "Panid"
            },
            "interface": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The type of interface used by the battery",
               "examples": [
                  "none"
               ],
               "title": "Interface"
            },
            "parent": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The parent device identifier",
               "examples": [
                  11
               ],
               "title": "Parent"
            },
            "PARENT": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The parent device serial number",
               "examples": [
                  "00001ABC1234_01234567890ABCDEF"
               ],
               "title": "Parent"
            },
            "hw_version": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The hardware version of the battery",
               "examples": [
                  "4.34"
               ],
               "title": "Hw Version"
            },
            "DESCR": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Description of the battery",
               "examples": [
                  "Battery M00122109A0355"
               ],
               "title": "Descr"
            }
         },
         "title": "Battery",
         "type": "object"
      },
      "ConsumptionPowerMeterDeviceDetail": {
         "description": "Model representing a consumption power meter that measures site power usage.\n\nThis model extends the production power meter details with\nconsumption-specific metrics including multi-lead current and voltage\nreadings, detailed phase measurements, and bidirectional energy flow\naccounting (import from and export to the utility grid).\n\nConsumption meters monitor electricity used by the building, typically\nshowing non-zero values even at night, and when solar production is\ninsufficient to meet current demand.\n\nThis device type appears in the device list when using\n``Command=DeviceList`` if a consumption power meter is connected to the\nPVS6.",
         "properties": {
            "ISDETAIL": {
               "default": true,
               "description": "Details about the device",
               "examples": [
                  true
               ],
               "title": "Isdetail",
               "type": "boolean"
            },
            "STATE": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "State of the device",
               "examples": [
                  "working"
               ],
               "title": "State"
            },
            "STATEDESCR": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Description of the state",
               "examples": [
                  "Working"
               ],
               "title": "Statedescr"
            },
            "SERIAL": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The serial number of the device",
               "examples": [
                  "ZT112345678912A0069"
               ],
               "title": "Serial"
            },
            "MODEL": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The manufacturer's model of the device",
               "examples": [
                  "PVS6M0400p"
               ],
               "title": "Model"
            },
            "HWVER": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The hardware version",
               "examples": [
                  "6.02"
               ],
               "title": "Hwver"
            },
            "SWVER": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The software version  of the firmware",
               "examples": [
                  "2021.9, Build 41001"
               ],
               "title": "Swver"
            },
            "DEVICE_TYPE": {
               "anyOf": [
                  {
                     "enum": [
                        "PVS",
                        "Power Meter",
                        "Inverter",
                        "PV Disconnect",
                        "Gateway",
                        "Storage Inverter",
                        "ESS BMS",
                        "Battery",
                        "Energy Storage System"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Device Type"
            },
            "TYPE": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The detailed type of the device (usually includes the manufacturer)",
               "examples": [
                  "PVS5-METER-P"
               ],
               "title": "Type"
            },
            "PORT": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The port the device is connected to",
               "examples": [
                  "COM1"
               ],
               "title": "Port"
            },
            "DATATIME": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The time the data was recorded",
               "title": "Datatime"
            },
            "CURTIME": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The current time as reported by the device",
               "title": "Curtime"
            },
            "OPERATION": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Operation type",
               "examples": [
                  "noop"
               ],
               "title": "Operation"
            },
            "origin": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Origin of this data",
               "examples": [
                  "data_logger"
               ],
               "title": "Origin"
            },
            "panid": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "PAN ID is used to determine whether an MI is A) Un-associated (panid = 0),B) owned by 'me' (mi.panid == pvs.panid) or C) owned by someone else (mi.panid != 0 && mi.panid != pvs.panid)",
               "title": "Panid"
            },
            "interface": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The type of interface used by the device",
               "examples": [
                  "mime"
               ],
               "title": "Interface"
            },
            "subtype": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The subtype of meter",
               "examples": [
                  "GROSS_PRODUCTION_SITE"
               ],
               "title": "Subtype"
            },
            "ct_scl_fctr": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Current capacity of the calibration-reference CT sensor in Amps.",
               "examples": [
                  50
               ],
               "title": "Ct Scl Fctr"
            },
            "net_ltea_3phsum_kwh": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Net cumulative kWh, across all 3 phases",
               "examples": [
                  198.92
               ],
               "title": "Net Ltea 3Phsum Kwh"
            },
            "p_3phsum_kw": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Average real power (kW)",
               "examples": [
                  1.9867
               ],
               "title": "P 3Phsum Kw"
            },
            "q_3phsum_kvar": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Average reactive power (kVA) across all 3 phases",
               "examples": [
                  0.1234
               ],
               "title": "Q 3Phsum Kvar"
            },
            "s_3phsum_kva": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Average apparent power (kVA) across all 3 phases",
               "examples": [
                  2.0
               ],
               "title": "S 3Phsum Kva"
            },
            "tot_pf_rto": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Total power factor ratio, defined as real power (kW) divided by apparent (kVA)",
               "examples": [
                  0.993
               ],
               "title": "Tot Pf Rto"
            },
            "freq_hz": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Operating Frequency in Hz",
               "examples": [
                  60.0
               ],
               "title": "Freq Hz"
            },
            "CAL0": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The sensor's current capacity for the calibration-reference CT sensor.It will be 50 (50A) for the production meter and 100 or 200 for the consumption meter.",
               "examples": [
                  50
               ],
               "title": "Cal0"
            },
            "v12_v": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Supply Voltage sum accross C1 and C2 leads (typically in the 220-140V range)",
               "examples": [
                  208.0
               ],
               "title": "V12 V"
            },
            "consumption_subtype_enum": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The consumption subtype enum",
               "examples": [
                  "NET_CONSUMPTION_LOADSIDE"
               ],
               "title": "Consumption Subtype Enum"
            },
            "i1_a": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The sensor's current capacity for the calibration-reference CT sensor.It will be 50 (50A) for the production meter and 100 or 200 for the consumption meter.",
               "examples": [
                  1.2
               ],
               "title": "I1 A"
            },
            "i2_a": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Current in Amps on CT2 lead",
               "examples": [
                  1.2
               ],
               "title": "I2 A"
            },
            "v1n_v": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Voltage in Volts on lead 1 to neutral",
               "examples": [
                  120.0
               ],
               "title": "V1N V"
            },
            "v2n_v": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Voltage in Volts on lead 2 to neutral",
               "examples": [
                  120.0
               ],
               "title": "V2N V"
            },
            "p1_kw": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Lead 1 average power in kW",
               "examples": [
                  0.123
               ],
               "title": "P1 Kw"
            },
            "p2_kw": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Lead 2 average power in kW",
               "examples": [
                  0.123
               ],
               "title": "P2 Kw"
            },
            "neg_ltea_3phsum_kwh": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Cumulative kWh imported from utility",
               "examples": [
                  123.45
               ],
               "title": "Neg Ltea 3Phsum Kwh"
            },
            "pos_ltea_3phsum_kwh": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Cumulative kWh exported to utility",
               "examples": [
                  234.56
               ],
               "title": "Pos Ltea 3Phsum Kwh"
            }
         },
         "title": "ConsumptionPowerMeterDeviceDetail",
         "type": "object"
      },
      "EquinioxBMS": {
         "description": "Model representing an Equiniox Battery Management System (BMS) in the solar system.\n\nThis model extends the base device details with Equiniox BMS-specific\nmetrics including battery management capabilities, monitoring parameters,\nand operational status. Equiniox BMS devices provide battery management\nfunctionality for energy storage systems, monitoring battery health,\nstate of charge, and safety parameters.\n\nThis device type appears in the device list when using ``Command=DeviceList``\nif an Equiniox BMS is connected to the PVS6 system.",
         "properties": {
            "ISDETAIL": {
               "default": true,
               "description": "Details about the device",
               "examples": [
                  true
               ],
               "title": "Isdetail",
               "type": "boolean"
            },
            "STATE": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "State of the device",
               "examples": [
                  "working"
               ],
               "title": "State"
            },
            "STATEDESCR": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Description of the state",
               "examples": [
                  "Working"
               ],
               "title": "Statedescr"
            },
            "SERIAL": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The serial number of the device",
               "examples": [
                  "ZT112345678912A0069"
               ],
               "title": "Serial"
            },
            "MODEL": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The manufacturer's model of the device",
               "examples": [
                  "PVS6M0400p"
               ],
               "title": "Model"
            },
            "HWVER": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The hardware version",
               "examples": [
                  "6.02"
               ],
               "title": "Hwver"
            },
            "SWVER": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The software version  of the firmware",
               "examples": [
                  "2021.9, Build 41001"
               ],
               "title": "Swver"
            },
            "DEVICE_TYPE": {
               "anyOf": [
                  {
                     "enum": [
                        "PVS",
                        "Power Meter",
                        "Inverter",
                        "PV Disconnect",
                        "Gateway",
                        "Storage Inverter",
                        "ESS BMS",
                        "Battery",
                        "Energy Storage System"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Device Type"
            },
            "TYPE": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The detailed type of the device (usually includes the manufacturer)",
               "examples": [
                  "PVS5-METER-P"
               ],
               "title": "Type"
            },
            "PORT": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The port the device is connected to",
               "examples": [
                  "COM1"
               ],
               "title": "Port"
            },
            "DATATIME": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The time the data was recorded",
               "title": "Datatime"
            },
            "CURTIME": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The current time as reported by the device",
               "title": "Curtime"
            },
            "OPERATION": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Operation type",
               "examples": [
                  "noop"
               ],
               "title": "Operation"
            },
            "origin": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Origin of this data",
               "examples": [
                  "data_logger"
               ],
               "title": "Origin"
            },
            "panid": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "PAN ID is used to determine whether an MI is A) Un-associated (panid = 0),B) owned by 'me' (mi.panid == pvs.panid) or C) owned by someone else (mi.panid != 0 && mi.panid != pvs.panid)",
               "title": "Panid"
            },
            "interface": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The type of interface used by the BMS",
               "examples": [
                  "sunspec"
               ],
               "title": "Interface"
            },
            "mac_address": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The MAC address of the BMS device",
               "examples": [
                  "d8:a9:ab:cd:12:34"
               ],
               "title": "Mac Address"
            },
            "parent": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The parent device identifier",
               "examples": [
                  11
               ],
               "title": "Parent"
            },
            "slave": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The slave number of the BMS device",
               "examples": [
                  230
               ],
               "title": "Slave"
            },
            "PARENT": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The parent device serial number",
               "examples": [
                  "00001ABC1234_01234567890ABCDEF"
               ],
               "title": "Parent"
            }
         },
         "title": "EquinioxBMS",
         "type": "object"
      },
      "EquinoxESS": {
         "description": "Model representing an Equinox Energy Storage System (ESS) device in the\nsolar system.\n\nThis model extends the base device details with ESS-specific metrics including\noperational status, hardware and software versions, and descriptive information.\nEquinox ESS devices provide energy storage functionality for solar installations.\n\nThis device type appears in the device list when using ``Command=DeviceList``\nif an Equinox ESS is connected to the PVS6 system.",
         "properties": {
            "ISDETAIL": {
               "default": true,
               "description": "Details about the device",
               "examples": [
                  true
               ],
               "title": "Isdetail",
               "type": "boolean"
            },
            "STATE": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "State of the device",
               "examples": [
                  "working"
               ],
               "title": "State"
            },
            "STATEDESCR": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Description of the state",
               "examples": [
                  "Working"
               ],
               "title": "Statedescr"
            },
            "SERIAL": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The serial number of the device",
               "examples": [
                  "ZT112345678912A0069"
               ],
               "title": "Serial"
            },
            "MODEL": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The manufacturer's model of the device",
               "examples": [
                  "PVS6M0400p"
               ],
               "title": "Model"
            },
            "HWVER": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The hardware version",
               "examples": [
                  "6.02"
               ],
               "title": "Hwver"
            },
            "SWVER": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The software version  of the firmware",
               "examples": [
                  "2021.9, Build 41001"
               ],
               "title": "Swver"
            },
            "DEVICE_TYPE": {
               "anyOf": [
                  {
                     "enum": [
                        "PVS",
                        "Power Meter",
                        "Inverter",
                        "PV Disconnect",
                        "Gateway",
                        "Storage Inverter",
                        "ESS BMS",
                        "Battery",
                        "Energy Storage System"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Device Type"
            },
            "TYPE": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The detailed type of the device (usually includes the manufacturer)",
               "examples": [
                  "PVS5-METER-P"
               ],
               "title": "Type"
            },
            "PORT": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The port the device is connected to",
               "examples": [
                  "COM1"
               ],
               "title": "Port"
            },
            "DATATIME": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The time the data was recorded",
               "title": "Datatime"
            },
            "CURTIME": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The current time as reported by the device",
               "title": "Curtime"
            },
            "OPERATION": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Operation type",
               "examples": [
                  "noop"
               ],
               "title": "Operation"
            },
            "origin": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Origin of this data",
               "examples": [
                  "data_logger"
               ],
               "title": "Origin"
            },
            "panid": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "PAN ID is used to determine whether an MI is A) Un-associated (panid = 0),B) owned by 'me' (mi.panid == pvs.panid) or C) owned by someone else (mi.panid != 0 && mi.panid != pvs.panid)",
               "title": "Panid"
            },
            "interface": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The type of interface used by the ESS",
               "examples": [
                  "none"
               ],
               "title": "Interface"
            },
            "hw_version": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The hardware version of the ESS",
               "examples": [
                  "0"
               ],
               "title": "Hw Version"
            },
            "DESCR": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Description of the ESS",
               "examples": [
                  "Energy Storage System 00001ABC1234_01234567890ABCDEF"
               ],
               "title": "Descr"
            }
         },
         "title": "EquinoxESS",
         "type": "object"
      },
      "Gateway": {
         "description": "Model representing a gateway device in the solar system.\n\nThis model extends the base device details with gateway-specific metrics\nincluding network interface information, communication protocols, and\noperational status. Gateway devices provide communication interfaces\nbetween the solar system and external networks or monitoring systems.\n\nThis device type appears in the device list when using ``Command=DeviceList``\nif a gateway device is connected to the PVS6 system.",
         "properties": {
            "ISDETAIL": {
               "default": true,
               "description": "Details about the device",
               "examples": [
                  true
               ],
               "title": "Isdetail",
               "type": "boolean"
            },
            "STATE": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "State of the device",
               "examples": [
                  "working"
               ],
               "title": "State"
            },
            "STATEDESCR": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Description of the state",
               "examples": [
                  "Working"
               ],
               "title": "Statedescr"
            },
            "SERIAL": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The serial number of the device",
               "examples": [
                  "ZT112345678912A0069"
               ],
               "title": "Serial"
            },
            "MODEL": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The manufacturer's model of the device",
               "examples": [
                  "PVS6M0400p"
               ],
               "title": "Model"
            },
            "HWVER": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The hardware version",
               "examples": [
                  "6.02"
               ],
               "title": "Hwver"
            },
            "SWVER": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The software version  of the firmware",
               "examples": [
                  "2021.9, Build 41001"
               ],
               "title": "Swver"
            },
            "DEVICE_TYPE": {
               "anyOf": [
                  {
                     "enum": [
                        "PVS",
                        "Power Meter",
                        "Inverter",
                        "PV Disconnect",
                        "Gateway",
                        "Storage Inverter",
                        "ESS BMS",
                        "Battery",
                        "Energy Storage System"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Device Type"
            },
            "TYPE": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The detailed type of the device (usually includes the manufacturer)",
               "examples": [
                  "PVS5-METER-P"
               ],
               "title": "Type"
            },
            "PORT": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The port the device is connected to",
               "examples": [
                  "COM1"
               ],
               "title": "Port"
            },
            "DATATIME": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The time the data was recorded",
               "title": "Datatime"
            },
            "CURTIME": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The current time as reported by the device",
               "title": "Curtime"
            },
            "OPERATION": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Operation type",
               "examples": [
                  "noop"
               ],
               "title": "Operation"
            },
            "origin": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Origin of this data",
               "examples": [
                  "data_logger"
               ],
               "title": "Origin"
            },
            "panid": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "PAN ID is used to determine whether an MI is A) Un-associated (panid = 0),B) owned by 'me' (mi.panid == pvs.panid) or C) owned by someone else (mi.panid != 0 && mi.panid != pvs.panid)",
               "title": "Panid"
            },
            "interface": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The type of interface used by the gateway",
               "examples": [
                  "sunspec"
               ],
               "title": "Interface"
            },
            "mac_address": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The MAC address of the gateway device",
               "examples": [
                  "d8:a9:ab:cd:12:34"
               ],
               "title": "Mac Address"
            },
            "slave": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The slave number",
               "examples": [
                  1
               ],
               "title": "Slave"
            }
         },
         "title": "Gateway",
         "type": "object"
      },
      "PVDisconnectDetail": {
         "description": "Model representing a PV disconnect device in the solar system.\n\nThis model extends the base device details with PV disconnect-specific metrics\nincluding switch status, control capabilities, and operational parameters.\nPV disconnect devices provide safety isolation between the solar array and\nthe rest of the electrical system, allowing for safe maintenance and emergency\nshutdown procedures.\n\nThis device type appears in the device list when using ``Command=DeviceList``\nif a PV disconnect device is connected to the PVS6 system.",
         "properties": {
            "ISDETAIL": {
               "default": true,
               "description": "Details about the device",
               "examples": [
                  true
               ],
               "title": "Isdetail",
               "type": "boolean"
            },
            "STATE": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "State of the device",
               "examples": [
                  "working"
               ],
               "title": "State"
            },
            "STATEDESCR": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Description of the state",
               "examples": [
                  "Working"
               ],
               "title": "Statedescr"
            },
            "SERIAL": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The serial number of the device",
               "examples": [
                  "ZT112345678912A0069"
               ],
               "title": "Serial"
            },
            "MODEL": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The manufacturer's model of the device",
               "examples": [
                  "PVS6M0400p"
               ],
               "title": "Model"
            },
            "HWVER": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The hardware version",
               "examples": [
                  "6.02"
               ],
               "title": "Hwver"
            },
            "SWVER": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The software version  of the firmware",
               "examples": [
                  "2021.9, Build 41001"
               ],
               "title": "Swver"
            },
            "DEVICE_TYPE": {
               "anyOf": [
                  {
                     "enum": [
                        "PVS",
                        "Power Meter",
                        "Inverter",
                        "PV Disconnect",
                        "Gateway",
                        "Storage Inverter",
                        "ESS BMS",
                        "Battery",
                        "Energy Storage System"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Device Type"
            },
            "TYPE": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The detailed type of the device (usually includes the manufacturer)",
               "examples": [
                  "PVS5-METER-P"
               ],
               "title": "Type"
            },
            "PORT": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The port the device is connected to",
               "examples": [
                  "COM1"
               ],
               "title": "Port"
            },
            "DATATIME": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The time the data was recorded",
               "title": "Datatime"
            },
            "CURTIME": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The current time as reported by the device",
               "title": "Curtime"
            },
            "OPERATION": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Operation type",
               "examples": [
                  "noop"
               ],
               "title": "Operation"
            },
            "origin": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Origin of this data",
               "examples": [
                  "data_logger"
               ],
               "title": "Origin"
            },
            "panid": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "PAN ID is used to determine whether an MI is A) Un-associated (panid = 0),B) owned by 'me' (mi.panid == pvs.panid) or C) owned by someone else (mi.panid != 0 && mi.panid != pvs.panid)",
               "title": "Panid"
            },
            "event_history": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Count of 'events' seen so far",
               "examples": [
                  32
               ],
               "title": "Event History"
            },
            "hw_version": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The hardware version",
               "examples": [
                  "0.2.0"
               ],
               "title": "Hw Version"
            },
            "interface": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The type of interface used by the panel",
               "examples": [
                  "ttymxc5"
               ],
               "title": "Interface"
            },
            "slave": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Slave number",
               "examples": [
                  230
               ],
               "title": "Slave"
            },
            "fw_error": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Error count for firmware operations",
               "examples": [
                  0,
                  1,
                  2
               ],
               "title": "Fw Error"
            },
            "relay_mode": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Indicates the relay mode of the disconnect",
               "examples": [
                  0,
                  1
               ],
               "title": "Relay Mode"
            },
            "relay1_state": {
               "anyOf": [
                  {
                     "enum": [
                        0,
                        1
                     ],
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "State of Relay 1, indicating operational status",
               "examples": [
                  0,
                  1
               ],
               "title": "Relay1 State"
            },
            "relay2_state": {
               "anyOf": [
                  {
                     "enum": [
                        0,
                        1
                     ],
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "State of Relay 2, indicating operational status",
               "examples": [
                  0,
                  1
               ],
               "title": "Relay2 State"
            },
            "relay1_error": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Error count for Relay 1",
               "examples": [
                  0,
                  1,
                  2
               ],
               "title": "Relay1 Error"
            },
            "relay2_error": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Error count for Relay 2",
               "examples": [
                  0,
                  1,
                  2
               ],
               "title": "Relay2 Error"
            },
            "v1n_grid_v": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Voltage differential between line and neutral at the disconnect in volts for phase 1",
               "examples": [
                  120.0
               ],
               "title": "V1N Grid V"
            },
            "v2n_grid_v": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Voltage differential between line and neutral at the disconnect in volts for phase 2",
               "examples": [
                  120.0
               ],
               "title": "V2N Grid V"
            },
            "v1n_pv_v": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Voltage differential between phase 1 neutral and the PV system in volts",
               "examples": [
                  120.0
               ],
               "title": "V1N Pv V"
            },
            "v2n_pv_v": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Voltage differential between phase 2 neutral and the PV system in volts",
               "examples": [
                  120.0
               ],
               "title": "V2N Pv V"
            }
         },
         "title": "PVDisconnectDetail",
         "type": "object"
      },
      "PVSDeviceDetail": {
         "description": "Model representing the PVS (Photovoltaic Supervisor) device itself.\n\nThis model extends the base device details with PVS-specific metrics\nincluding diagnostic information about communication errors, system resource\nutilization (CPU, memory, flash storage), and operational metrics like scan\nperformance and uptime.\n\nThis device type appears in the device list when using\n``Command=DeviceList`` and represents the central monitoring and control\nsystem for the solar installation.",
         "properties": {
            "ISDETAIL": {
               "default": true,
               "description": "Details about the device",
               "examples": [
                  true
               ],
               "title": "Isdetail",
               "type": "boolean"
            },
            "STATE": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "State of the device",
               "examples": [
                  "working"
               ],
               "title": "State"
            },
            "STATEDESCR": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Description of the state",
               "examples": [
                  "Working"
               ],
               "title": "Statedescr"
            },
            "SERIAL": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The serial number of the device",
               "examples": [
                  "ZT112345678912A0069"
               ],
               "title": "Serial"
            },
            "MODEL": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The manufacturer's model of the device",
               "examples": [
                  "PVS6M0400p"
               ],
               "title": "Model"
            },
            "HWVER": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The hardware version",
               "examples": [
                  "6.02"
               ],
               "title": "Hwver"
            },
            "SWVER": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The software version  of the firmware",
               "examples": [
                  "2021.9, Build 41001"
               ],
               "title": "Swver"
            },
            "DEVICE_TYPE": {
               "anyOf": [
                  {
                     "enum": [
                        "PVS",
                        "Power Meter",
                        "Inverter",
                        "PV Disconnect",
                        "Gateway",
                        "Storage Inverter",
                        "ESS BMS",
                        "Battery",
                        "Energy Storage System"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Device Type"
            },
            "TYPE": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The detailed type of the device (usually includes the manufacturer)",
               "examples": [
                  "PVS5-METER-P"
               ],
               "title": "Type"
            },
            "PORT": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The port the device is connected to",
               "examples": [
                  "COM1"
               ],
               "title": "Port"
            },
            "DATATIME": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The time the data was recorded",
               "title": "Datatime"
            },
            "CURTIME": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The current time as reported by the device",
               "title": "Curtime"
            },
            "OPERATION": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Operation type",
               "examples": [
                  "noop"
               ],
               "title": "Operation"
            },
            "origin": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Origin of this data",
               "examples": [
                  "data_logger"
               ],
               "title": "Origin"
            },
            "panid": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "PAN ID is used to determine whether an MI is A) Un-associated (panid = 0),B) owned by 'me' (mi.panid == pvs.panid) or C) owned by someone else (mi.panid != 0 && mi.panid != pvs.panid)",
               "title": "Panid"
            },
            "dl_error_count": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Number of comms errors detected since last report",
               "title": "Dl Error Count"
            },
            "dl_comm_err": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Number of comms errors",
               "title": "Dl Comm Err"
            },
            "dl_skipped_scans": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "This counts when the supervisor scans the PLC network for inverters and it decides it needs to skip a scan",
               "examples": [
                  0
               ],
               "title": "Dl Skipped Scans"
            },
            "dl_cpu_load": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The CPU load of the device",
               "examples": [
                  12.5
               ],
               "title": "Dl Cpu Load"
            },
            "dl_flash_avail": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "How much free flash memory is available",
               "examples": [
                  12234
               ],
               "title": "Dl Flash Avail"
            },
            "dl_mem_used": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "How much memory is used, probably in kB",
               "examples": [
                  23456
               ],
               "title": "Dl Mem Used"
            },
            "dl_scan_time": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "How long the last scan of the PLC network took, maybe in milliseconds",
               "examples": [
                  1234
               ],
               "title": "Dl Scan Time"
            },
            "dl_untransmitted": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Numbeer of not yet transmitted events/records?",
               "examples": [
                  0
               ],
               "title": "Dl Untransmitted"
            },
            "dl_uptime": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  123456
               ],
               "title": "Dl Uptime"
            }
         },
         "title": "PVSDeviceDetail",
         "type": "object"
      },
      "ProductionPowerMeterDeviceDetail": {
         "description": "Model representing a production power meter that measures solar energy\ngeneration.\n\nThis model extends the base power meter details with production-specific\nmetrics.  Production meters monitor the electricity generated by the solar\narray, reporting zero output at night and varying levels during daylight\nhours based on sunlight conditions and system capacity.\n\nThis device type appears in the device list when using\n``Command=DeviceList`` if a production power meter is connected to the PVS6.",
         "properties": {
            "ISDETAIL": {
               "default": true,
               "description": "Details about the device",
               "examples": [
                  true
               ],
               "title": "Isdetail",
               "type": "boolean"
            },
            "STATE": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "State of the device",
               "examples": [
                  "working"
               ],
               "title": "State"
            },
            "STATEDESCR": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Description of the state",
               "examples": [
                  "Working"
               ],
               "title": "Statedescr"
            },
            "SERIAL": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The serial number of the device",
               "examples": [
                  "ZT112345678912A0069"
               ],
               "title": "Serial"
            },
            "MODEL": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The manufacturer's model of the device",
               "examples": [
                  "PVS6M0400p"
               ],
               "title": "Model"
            },
            "HWVER": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The hardware version",
               "examples": [
                  "6.02"
               ],
               "title": "Hwver"
            },
            "SWVER": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The software version  of the firmware",
               "examples": [
                  "2021.9, Build 41001"
               ],
               "title": "Swver"
            },
            "DEVICE_TYPE": {
               "anyOf": [
                  {
                     "enum": [
                        "PVS",
                        "Power Meter",
                        "Inverter",
                        "PV Disconnect",
                        "Gateway",
                        "Storage Inverter",
                        "ESS BMS",
                        "Battery",
                        "Energy Storage System"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Device Type"
            },
            "TYPE": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The detailed type of the device (usually includes the manufacturer)",
               "examples": [
                  "PVS5-METER-P"
               ],
               "title": "Type"
            },
            "PORT": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The port the device is connected to",
               "examples": [
                  "COM1"
               ],
               "title": "Port"
            },
            "DATATIME": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The time the data was recorded",
               "title": "Datatime"
            },
            "CURTIME": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The current time as reported by the device",
               "title": "Curtime"
            },
            "OPERATION": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Operation type",
               "examples": [
                  "noop"
               ],
               "title": "Operation"
            },
            "origin": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Origin of this data",
               "examples": [
                  "data_logger"
               ],
               "title": "Origin"
            },
            "panid": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "PAN ID is used to determine whether an MI is A) Un-associated (panid = 0),B) owned by 'me' (mi.panid == pvs.panid) or C) owned by someone else (mi.panid != 0 && mi.panid != pvs.panid)",
               "title": "Panid"
            },
            "interface": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The type of interface used by the device",
               "examples": [
                  "mime"
               ],
               "title": "Interface"
            },
            "subtype": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The subtype of meter",
               "examples": [
                  "GROSS_PRODUCTION_SITE"
               ],
               "title": "Subtype"
            },
            "ct_scl_fctr": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Current capacity of the calibration-reference CT sensor in Amps.",
               "examples": [
                  50
               ],
               "title": "Ct Scl Fctr"
            },
            "net_ltea_3phsum_kwh": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Net cumulative kWh, across all 3 phases",
               "examples": [
                  198.92
               ],
               "title": "Net Ltea 3Phsum Kwh"
            },
            "p_3phsum_kw": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Average real power (kW)",
               "examples": [
                  1.9867
               ],
               "title": "P 3Phsum Kw"
            },
            "q_3phsum_kvar": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Average reactive power (kVA) across all 3 phases",
               "examples": [
                  0.1234
               ],
               "title": "Q 3Phsum Kvar"
            },
            "s_3phsum_kva": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Average apparent power (kVA) across all 3 phases",
               "examples": [
                  2.0
               ],
               "title": "S 3Phsum Kva"
            },
            "tot_pf_rto": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Total power factor ratio, defined as real power (kW) divided by apparent (kVA)",
               "examples": [
                  0.993
               ],
               "title": "Tot Pf Rto"
            },
            "freq_hz": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Operating Frequency in Hz",
               "examples": [
                  60.0
               ],
               "title": "Freq Hz"
            },
            "CAL0": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The sensor's current capacity for the calibration-reference CT sensor.It will be 50 (50A) for the production meter and 100 or 200 for the consumption meter.",
               "examples": [
                  50
               ],
               "title": "Cal0"
            },
            "v12_v": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Supply Voltage sum accross C1 and C2 leads (typically in the 220-140V range)",
               "examples": [
                  208.0
               ],
               "title": "V12 V"
            },
            "production_subtype_enum": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The production subtype enum",
               "examples": [
                  "GROSS_PRODUCTION_SITE"
               ],
               "title": "Production Subtype Enum"
            },
            "i_a": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Current in Amps",
               "examples": [
                  2.1122
               ],
               "title": "I A"
            }
         },
         "title": "ProductionPowerMeterDeviceDetail",
         "type": "object"
      },
      "SchneiderXwPro": {
         "description": "Model representing a Schneider XW Pro storage inverter in the solar system.\n\nThis model extends the base device details with Schneider XW Pro-specific\nmetrics including storage inverter capabilities, battery management, and\noperational parameters. Schneider XW Pro devices provide energy storage\nfunctionality, allowing for battery backup and energy management in solar\ninstallations.\n\nThis device type appears in the device list when using ``Command=DeviceList``\nif a Schneider XW Pro storage inverter is connected to the PVS6 system.",
         "properties": {
            "ISDETAIL": {
               "default": true,
               "description": "Details about the device",
               "examples": [
                  true
               ],
               "title": "Isdetail",
               "type": "boolean"
            },
            "STATE": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "State of the device",
               "examples": [
                  "working"
               ],
               "title": "State"
            },
            "STATEDESCR": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Description of the state",
               "examples": [
                  "Working"
               ],
               "title": "Statedescr"
            },
            "SERIAL": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The serial number of the device",
               "examples": [
                  "ZT112345678912A0069"
               ],
               "title": "Serial"
            },
            "MODEL": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The manufacturer's model of the device",
               "examples": [
                  "PVS6M0400p"
               ],
               "title": "Model"
            },
            "HWVER": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The hardware version",
               "examples": [
                  "6.02"
               ],
               "title": "Hwver"
            },
            "SWVER": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The software version  of the firmware",
               "examples": [
                  "2021.9, Build 41001"
               ],
               "title": "Swver"
            },
            "DEVICE_TYPE": {
               "anyOf": [
                  {
                     "enum": [
                        "PVS",
                        "Power Meter",
                        "Inverter",
                        "PV Disconnect",
                        "Gateway",
                        "Storage Inverter",
                        "ESS BMS",
                        "Battery",
                        "Energy Storage System"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Device Type"
            },
            "TYPE": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The detailed type of the device (usually includes the manufacturer)",
               "examples": [
                  "PVS5-METER-P"
               ],
               "title": "Type"
            },
            "PORT": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The port the device is connected to",
               "examples": [
                  "COM1"
               ],
               "title": "Port"
            },
            "DATATIME": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The time the data was recorded",
               "title": "Datatime"
            },
            "CURTIME": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The current time as reported by the device",
               "title": "Curtime"
            },
            "OPERATION": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Operation type",
               "examples": [
                  "noop"
               ],
               "title": "Operation"
            },
            "origin": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Origin of this data",
               "examples": [
                  "data_logger"
               ],
               "title": "Origin"
            },
            "panid": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "PAN ID is used to determine whether an MI is A) Un-associated (panid = 0),B) owned by 'me' (mi.panid == pvs.panid) or C) owned by someone else (mi.panid != 0 && mi.panid != pvs.panid)",
               "title": "Panid"
            },
            "interface": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The type of interface used by the storage inverter",
               "examples": [
                  "sunspec"
               ],
               "title": "Interface"
            },
            "mac_address": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The MAC address of the storage inverter device",
               "examples": [
                  "d8:a9:ab:cd:12:34"
               ],
               "title": "Mac Address"
            },
            "parent": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The parent device identifier",
               "examples": [
                  11
               ],
               "title": "Parent"
            },
            "slave": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The slave number for the storage inverter device",
               "examples": [
                  10
               ],
               "title": "Slave"
            },
            "PARENT": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The parent device serial number",
               "examples": [
                  "00001ABC1234_01234567890ABCDEF"
               ],
               "title": "Parent"
            }
         },
         "title": "SchneiderXwPro",
         "type": "object"
      },
      "SolarBridgeDeviceDetail": {
         "description": "Model representing a SolarBridge microinverter device in the solar array.\n\nThis model extends the base device details with microinverter-specific\nmetrics including AC output parameters (power, voltage, current), DC input\nmeasurements from the connected solar panel, thermal monitoring, and energy\nproduction data.\n\nMicroinverters convert DC power from individual solar panels to AC power for\nuse in the building or export to the grid. Each microinverter typically\nconnects to a single solar panel.\n\nThis device type appears in the device list when using\n``Command=DeviceList`` if SolarBridge microinverters are connected to the\nPVS6.",
         "properties": {
            "ISDETAIL": {
               "default": true,
               "description": "Details about the device",
               "examples": [
                  true
               ],
               "title": "Isdetail",
               "type": "boolean"
            },
            "STATE": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "State of the device",
               "examples": [
                  "working"
               ],
               "title": "State"
            },
            "STATEDESCR": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Description of the state",
               "examples": [
                  "Working"
               ],
               "title": "Statedescr"
            },
            "SERIAL": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The serial number of the device",
               "examples": [
                  "ZT112345678912A0069"
               ],
               "title": "Serial"
            },
            "MODEL": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The manufacturer's model of the device",
               "examples": [
                  "PVS6M0400p"
               ],
               "title": "Model"
            },
            "HWVER": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The hardware version",
               "examples": [
                  "6.02"
               ],
               "title": "Hwver"
            },
            "SWVER": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The software version  of the firmware",
               "examples": [
                  "2021.9, Build 41001"
               ],
               "title": "Swver"
            },
            "DEVICE_TYPE": {
               "anyOf": [
                  {
                     "enum": [
                        "PVS",
                        "Power Meter",
                        "Inverter",
                        "PV Disconnect",
                        "Gateway",
                        "Storage Inverter",
                        "ESS BMS",
                        "Battery",
                        "Energy Storage System"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Device Type"
            },
            "TYPE": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The detailed type of the device (usually includes the manufacturer)",
               "examples": [
                  "PVS5-METER-P"
               ],
               "title": "Type"
            },
            "PORT": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The port the device is connected to",
               "examples": [
                  "COM1"
               ],
               "title": "Port"
            },
            "DATATIME": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The time the data was recorded",
               "title": "Datatime"
            },
            "CURTIME": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The current time as reported by the device",
               "title": "Curtime"
            },
            "OPERATION": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Operation type",
               "examples": [
                  "noop"
               ],
               "title": "Operation"
            },
            "origin": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Origin of this data",
               "examples": [
                  "data_logger"
               ],
               "title": "Origin"
            },
            "panid": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "PAN ID is used to determine whether an MI is A) Un-associated (panid = 0),B) owned by 'me' (mi.panid == pvs.panid) or C) owned by someone else (mi.panid != 0 && mi.panid != pvs.panid)",
               "title": "Panid"
            },
            "interface": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The type of interface used by the panel?",
               "examples": [
                  "mime"
               ],
               "title": "Interface"
            },
            "hw_version": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Hardware version",
               "examples": [
                  "1.0"
               ],
               "title": "Hw Version"
            },
            "module_serial": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Serial number of the inverter module",
               "examples": [
                  "12345678901234"
               ],
               "title": "Module Serial"
            },
            "PANEL": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Model of the solar panel module",
               "examples": [
                  "SPR-A410-G-AC"
               ],
               "title": "Panel"
            },
            "slave": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Is this a slave device?",
               "examples": [
                  false
               ],
               "title": "Slave"
            },
            "MOD_SN": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Serial number of the microinverter",
               "examples": [
                  "12345678901234"
               ],
               "title": "Mod Sn"
            },
            "NMPLT_SKU": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "SKU of the microinverter",
               "examples": [
                  "SB250-1BD-US"
               ],
               "title": "Nmplt Sku"
            },
            "ltea_3phsum_kwh": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Total Energy in kWh",
               "examples": [
                  123.45
               ],
               "title": "Ltea 3Phsum Kwh"
            },
            "p_3phsum_kw": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "AC Power (kW)",
               "examples": [
                  0.0471
               ],
               "title": "P 3Phsum Kw"
            },
            "vln_3phsum_v": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "AC Voltage (V)",
               "examples": [
                  246.5
               ],
               "title": "Vln 3Phsum V"
            },
            "i_3phsum_a": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "AC Current (A)",
               "examples": [
                  0.19
               ],
               "title": "I 3Phsum A"
            },
            "p_mppt1_v": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "DC Power (kW) for MPTT (Maximum Power Point Tracking)",
               "examples": [
                  0.0502
               ],
               "title": "P Mppt1 V"
            },
            "v_mppt1_v": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "DC Voltage (V) for MPTT (Maximum Power Point Tracking)",
               "examples": [
                  54.5
               ],
               "title": "V Mppt1 V"
            },
            "i_mppt1_a": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "DC Current (A) for MPTT (Maximum Power Point Tracking)",
               "examples": [
                  0.92
               ],
               "title": "I Mppt1 A"
            },
            "p_mpptsum_kw": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Legacy? Seems replaced by p_mppt1_kw",
               "title": "P Mpptsum Kw"
            },
            "t_htsink_degc": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Heatsink temperature in degrees C",
               "examples": [
                  45.0
               ],
               "title": "T Htsink Degc"
            },
            "freq_hz": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Operating Frequency in Hz",
               "examples": [
                  60.0
               ],
               "title": "Freq Hz"
            },
            "stat_ind": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Status indicator?",
               "examples": [
                  0
               ],
               "title": "Stat Ind"
            }
         },
         "title": "SolarBridgeDeviceDetail",
         "type": "object"
      }
   },
   "required": [
      "result"
   ]
}

Fields:
field devices: list[Union[sungazer.models.devices.PVSDeviceDetail, sungazer.models.devices.ProductionPowerMeterDeviceDetail, sungazer.models.devices.ConsumptionPowerMeterDeviceDetail, sungazer.models.devices.SolarBridgeDeviceDetail, sungazer.models.devices.PVDisconnectDetail, sungazer.models.devices.Gateway, sungazer.models.devices.SchneiderXwPro, sungazer.models.devices.EquinioxBMS, sungazer.models.devices.Battery, sungazer.models.devices.EquinoxESS]] | None = None

The devices

field result: str [Required]

The result

classmethod construct(_fields_set: set[str] | None = None, **values: Any) Self
model_copy(*, update: Mapping[str, Any] | None = None, deep: bool = False) Self
!!! abstract “Usage Documentation”

[model_copy](../concepts/serialization.md#model_copy)

Returns a copy of the model.

!!! note

The underlying instance’s [__dict__][object.__dict__] attribute is copied. This might have unexpected side effects if you store anything in it, on top of the model fields (e.g. the value of [cached properties][functools.cached_property]).

Parameters:
  • update – Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data.

  • deep – Set to True to make a deep copy of the model.

Returns:

New model instance.

classmethod model_validate(obj: Any, *, strict: bool | None = None, from_attributes: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate a pydantic model instance.

Parameters:
  • obj – The object to validate.

  • strict – Whether to enforce types strictly.

  • from_attributes – Whether to extract data from object attributes.

  • context – Additional context to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Raises:

ValidationError – If the object could not be validated.

Returns:

The validated model instance.

classmethod model_validate_json(json_data: str | bytes | bytearray, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self
!!! abstract “Usage Documentation”

[JSON Parsing](../concepts/json.md#json-parsing)

Validate the given JSON data against the Pydantic model.

Parameters:
  • json_data – The JSON data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Raises:

ValidationError – If json_data is not a JSON string or the object could not be validated.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

classmethod new(obj: dict) DeviceDetailResponse[source]

Custom parsing to handle different device types from the payload returned by the PVS6 API for Command=DeviceList.

classmethod parse_file(path: str | Path, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self
classmethod parse_obj(obj: Any) Self
classmethod parse_raw(b: str | bytes, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self
property consumption_meter: ConsumptionPowerMeterDeviceDetail | None

Return a list of consumption power meters, or None if not found.

property inverters: list[sungazer.models.devices.SolarBridgeDeviceDetail]

Return a list of inverters (SolarBridge devices)

property production_meter: ProductionPowerMeterDeviceDetail | None

Return a list of production power meters, or None if not found.

property pvs: PVSDeviceDetail | None

Return The PVS device, or None if not found.

pydantic model sungazer.models.devices.EquinioxBMS[source]

Bases: BaseDeviceDetail

Model representing an Equiniox Battery Management System (BMS) in the solar system.

This model extends the base device details with Equiniox BMS-specific metrics including battery management capabilities, monitoring parameters, and operational status. Equiniox BMS devices provide battery management functionality for energy storage systems, monitoring battery health, state of charge, and safety parameters.

This device type appears in the device list when using Command=DeviceList if an Equiniox BMS is connected to the PVS6 system.

Show JSON schema
{
   "title": "EquinioxBMS",
   "description": "Model representing an Equiniox Battery Management System (BMS) in the solar system.\n\nThis model extends the base device details with Equiniox BMS-specific\nmetrics including battery management capabilities, monitoring parameters,\nand operational status. Equiniox BMS devices provide battery management\nfunctionality for energy storage systems, monitoring battery health,\nstate of charge, and safety parameters.\n\nThis device type appears in the device list when using ``Command=DeviceList``\nif an Equiniox BMS is connected to the PVS6 system.",
   "type": "object",
   "properties": {
      "ISDETAIL": {
         "default": true,
         "description": "Details about the device",
         "examples": [
            true
         ],
         "title": "Isdetail",
         "type": "boolean"
      },
      "STATE": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "State of the device",
         "examples": [
            "working"
         ],
         "title": "State"
      },
      "STATEDESCR": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Description of the state",
         "examples": [
            "Working"
         ],
         "title": "Statedescr"
      },
      "SERIAL": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The serial number of the device",
         "examples": [
            "ZT112345678912A0069"
         ],
         "title": "Serial"
      },
      "MODEL": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The manufacturer's model of the device",
         "examples": [
            "PVS6M0400p"
         ],
         "title": "Model"
      },
      "HWVER": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The hardware version",
         "examples": [
            "6.02"
         ],
         "title": "Hwver"
      },
      "SWVER": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The software version  of the firmware",
         "examples": [
            "2021.9, Build 41001"
         ],
         "title": "Swver"
      },
      "DEVICE_TYPE": {
         "anyOf": [
            {
               "enum": [
                  "PVS",
                  "Power Meter",
                  "Inverter",
                  "PV Disconnect",
                  "Gateway",
                  "Storage Inverter",
                  "ESS BMS",
                  "Battery",
                  "Energy Storage System"
               ],
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Device Type"
      },
      "TYPE": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The detailed type of the device (usually includes the manufacturer)",
         "examples": [
            "PVS5-METER-P"
         ],
         "title": "Type"
      },
      "PORT": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The port the device is connected to",
         "examples": [
            "COM1"
         ],
         "title": "Port"
      },
      "DATATIME": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The time the data was recorded",
         "title": "Datatime"
      },
      "CURTIME": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The current time as reported by the device",
         "title": "Curtime"
      },
      "OPERATION": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Operation type",
         "examples": [
            "noop"
         ],
         "title": "Operation"
      },
      "origin": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Origin of this data",
         "examples": [
            "data_logger"
         ],
         "title": "Origin"
      },
      "panid": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "PAN ID is used to determine whether an MI is A) Un-associated (panid = 0),B) owned by 'me' (mi.panid == pvs.panid) or C) owned by someone else (mi.panid != 0 && mi.panid != pvs.panid)",
         "title": "Panid"
      },
      "interface": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The type of interface used by the BMS",
         "examples": [
            "sunspec"
         ],
         "title": "Interface"
      },
      "mac_address": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The MAC address of the BMS device",
         "examples": [
            "d8:a9:ab:cd:12:34"
         ],
         "title": "Mac Address"
      },
      "parent": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The parent device identifier",
         "examples": [
            11
         ],
         "title": "Parent"
      },
      "slave": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The slave number of the BMS device",
         "examples": [
            230
         ],
         "title": "Slave"
      },
      "PARENT": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The parent device serial number",
         "examples": [
            "00001ABC1234_01234567890ABCDEF"
         ],
         "title": "Parent"
      }
   }
}

Fields:
Validators:
field CURTIME: datetime | None = None

The current time as reported by the device

Validated by:
field DATATIME: datetime | None = None

The time the data was recorded

Validated by:
field DEVICE_TYPE: DeviceType | None = None

The device type

field HWVER: str | None = None

The hardware version

field ISDETAIL: bool = True

Details about the device

field MODEL: str | None = None

The manufacturer’s model of the device

field OPERATION: str | None = None

Operation type

field PARENT: str | None = None

The parent device serial number

field PORT: str | None = None

The port the device is connected to

field SERIAL: str | None = None

The serial number of the device

field STATE: str | None = None

State of the device

field STATEDESCR: str | None = None

Description of the state

field SWVER: str | None = None

The software version of the firmware

field TYPE: str | None = None

The detailed type of the device (usually includes the manufacturer)

field interface: str | None = None

The type of interface used by the BMS

field mac_address: str | None = None

The MAC address of the BMS device

field origin: str | None = None

Origin of this data

field panid: float | None = None

PAN ID is used to determine whether an MI is A) Un-associated (panid = 0),B) owned by ‘me’ (mi.panid == pvs.panid) or C) owned by someone else (mi.panid != 0 && mi.panid != pvs.panid)

field parent: int | None = None

The parent device identifier

field slave: int | None = None

The slave number of the BMS device

classmethod construct(_fields_set: set[str] | None = None, **values: Any) Self
model_copy(*, update: Mapping[str, Any] | None = None, deep: bool = False) Self
!!! abstract “Usage Documentation”

[model_copy](../concepts/serialization.md#model_copy)

Returns a copy of the model.

!!! note

The underlying instance’s [__dict__][object.__dict__] attribute is copied. This might have unexpected side effects if you store anything in it, on top of the model fields (e.g. the value of [cached properties][functools.cached_property]).

Parameters:
  • update – Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data.

  • deep – Set to True to make a deep copy of the model.

Returns:

New model instance.

classmethod model_validate(obj: Any, *, strict: bool | None = None, from_attributes: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate a pydantic model instance.

Parameters:
  • obj – The object to validate.

  • strict – Whether to enforce types strictly.

  • from_attributes – Whether to extract data from object attributes.

  • context – Additional context to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Raises:

ValidationError – If the object could not be validated.

Returns:

The validated model instance.

classmethod model_validate_json(json_data: str | bytes | bytearray, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self
!!! abstract “Usage Documentation”

[JSON Parsing](../concepts/json.md#json-parsing)

Validate the given JSON data against the Pydantic model.

Parameters:
  • json_data – The JSON data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Raises:

ValidationError – If json_data is not a JSON string or the object could not be validated.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

classmethod parse_file(path: str | Path, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self
classmethod parse_obj(obj: Any) Self
classmethod parse_raw(b: str | bytes, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self
validator parse_timestamp  »  CURTIME, DATATIME

Convert timestamp strings to datetime objects.

Handles various timestamp formats found in the API responses:

  • PVS6 comma-separated format: “2025,06,22,00,15,54”

  • Already parsed datetime objects

Parameters:

v – The timestamp value to parse, can be a string or datetime object.

Raises:

ValueError – If the timestamp format is invalid or cannot be parsed.

pydantic model sungazer.models.devices.EquinoxESS[source]

Bases: BaseDeviceDetail

Model representing an Equinox Energy Storage System (ESS) device in the solar system.

This model extends the base device details with ESS-specific metrics including operational status, hardware and software versions, and descriptive information. Equinox ESS devices provide energy storage functionality for solar installations.

This device type appears in the device list when using Command=DeviceList if an Equinox ESS is connected to the PVS6 system.

Show JSON schema
{
   "title": "EquinoxESS",
   "description": "Model representing an Equinox Energy Storage System (ESS) device in the\nsolar system.\n\nThis model extends the base device details with ESS-specific metrics including\noperational status, hardware and software versions, and descriptive information.\nEquinox ESS devices provide energy storage functionality for solar installations.\n\nThis device type appears in the device list when using ``Command=DeviceList``\nif an Equinox ESS is connected to the PVS6 system.",
   "type": "object",
   "properties": {
      "ISDETAIL": {
         "default": true,
         "description": "Details about the device",
         "examples": [
            true
         ],
         "title": "Isdetail",
         "type": "boolean"
      },
      "STATE": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "State of the device",
         "examples": [
            "working"
         ],
         "title": "State"
      },
      "STATEDESCR": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Description of the state",
         "examples": [
            "Working"
         ],
         "title": "Statedescr"
      },
      "SERIAL": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The serial number of the device",
         "examples": [
            "ZT112345678912A0069"
         ],
         "title": "Serial"
      },
      "MODEL": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The manufacturer's model of the device",
         "examples": [
            "PVS6M0400p"
         ],
         "title": "Model"
      },
      "HWVER": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The hardware version",
         "examples": [
            "6.02"
         ],
         "title": "Hwver"
      },
      "SWVER": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The software version  of the firmware",
         "examples": [
            "2021.9, Build 41001"
         ],
         "title": "Swver"
      },
      "DEVICE_TYPE": {
         "anyOf": [
            {
               "enum": [
                  "PVS",
                  "Power Meter",
                  "Inverter",
                  "PV Disconnect",
                  "Gateway",
                  "Storage Inverter",
                  "ESS BMS",
                  "Battery",
                  "Energy Storage System"
               ],
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Device Type"
      },
      "TYPE": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The detailed type of the device (usually includes the manufacturer)",
         "examples": [
            "PVS5-METER-P"
         ],
         "title": "Type"
      },
      "PORT": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The port the device is connected to",
         "examples": [
            "COM1"
         ],
         "title": "Port"
      },
      "DATATIME": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The time the data was recorded",
         "title": "Datatime"
      },
      "CURTIME": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The current time as reported by the device",
         "title": "Curtime"
      },
      "OPERATION": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Operation type",
         "examples": [
            "noop"
         ],
         "title": "Operation"
      },
      "origin": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Origin of this data",
         "examples": [
            "data_logger"
         ],
         "title": "Origin"
      },
      "panid": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "PAN ID is used to determine whether an MI is A) Un-associated (panid = 0),B) owned by 'me' (mi.panid == pvs.panid) or C) owned by someone else (mi.panid != 0 && mi.panid != pvs.panid)",
         "title": "Panid"
      },
      "interface": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The type of interface used by the ESS",
         "examples": [
            "none"
         ],
         "title": "Interface"
      },
      "hw_version": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The hardware version of the ESS",
         "examples": [
            "0"
         ],
         "title": "Hw Version"
      },
      "DESCR": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Description of the ESS",
         "examples": [
            "Energy Storage System 00001ABC1234_01234567890ABCDEF"
         ],
         "title": "Descr"
      }
   }
}

Fields:
Validators:
field CURTIME: datetime | None = None

The current time as reported by the device

Validated by:
field DATATIME: datetime | None = None

The time the data was recorded

Validated by:
field DESCR: str | None = None

Description of the ESS

field DEVICE_TYPE: DeviceType | None = None

The device type

field HWVER: str | None = None

The hardware version

field ISDETAIL: bool = True

Details about the device

field MODEL: str | None = None

The manufacturer’s model of the device

field OPERATION: str | None = None

Operation type

field PORT: str | None = None

The port the device is connected to

field SERIAL: str | None = None

The serial number of the device

field STATE: str | None = None

State of the device

field STATEDESCR: str | None = None

Description of the state

field SWVER: str | None = None

The software version of the firmware

field TYPE: str | None = None

The detailed type of the device (usually includes the manufacturer)

field hw_version: str | None = None

The hardware version of the ESS

field interface: str | None = None

The type of interface used by the ESS

field origin: str | None = None

Origin of this data

field panid: float | None = None

PAN ID is used to determine whether an MI is A) Un-associated (panid = 0),B) owned by ‘me’ (mi.panid == pvs.panid) or C) owned by someone else (mi.panid != 0 && mi.panid != pvs.panid)

classmethod construct(_fields_set: set[str] | None = None, **values: Any) Self
model_copy(*, update: Mapping[str, Any] | None = None, deep: bool = False) Self
!!! abstract “Usage Documentation”

[model_copy](../concepts/serialization.md#model_copy)

Returns a copy of the model.

!!! note

The underlying instance’s [__dict__][object.__dict__] attribute is copied. This might have unexpected side effects if you store anything in it, on top of the model fields (e.g. the value of [cached properties][functools.cached_property]).

Parameters:
  • update – Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data.

  • deep – Set to True to make a deep copy of the model.

Returns:

New model instance.

classmethod model_validate(obj: Any, *, strict: bool | None = None, from_attributes: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate a pydantic model instance.

Parameters:
  • obj – The object to validate.

  • strict – Whether to enforce types strictly.

  • from_attributes – Whether to extract data from object attributes.

  • context – Additional context to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Raises:

ValidationError – If the object could not be validated.

Returns:

The validated model instance.

classmethod model_validate_json(json_data: str | bytes | bytearray, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self
!!! abstract “Usage Documentation”

[JSON Parsing](../concepts/json.md#json-parsing)

Validate the given JSON data against the Pydantic model.

Parameters:
  • json_data – The JSON data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Raises:

ValidationError – If json_data is not a JSON string or the object could not be validated.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

classmethod parse_file(path: str | Path, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self
classmethod parse_obj(obj: Any) Self
classmethod parse_raw(b: str | bytes, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self
validator parse_timestamp  »  DATATIME, CURTIME

Convert timestamp strings to datetime objects.

Handles various timestamp formats found in the API responses:

  • PVS6 comma-separated format: “2025,06,22,00,15,54”

  • Already parsed datetime objects

Parameters:

v – The timestamp value to parse, can be a string or datetime object.

Raises:

ValueError – If the timestamp format is invalid or cannot be parsed.

pydantic model sungazer.models.devices.Gateway[source]

Bases: BaseDeviceDetail

Model representing a gateway device in the solar system.

This model extends the base device details with gateway-specific metrics including network interface information, communication protocols, and operational status. Gateway devices provide communication interfaces between the solar system and external networks or monitoring systems.

This device type appears in the device list when using Command=DeviceList if a gateway device is connected to the PVS6 system.

Show JSON schema
{
   "title": "Gateway",
   "description": "Model representing a gateway device in the solar system.\n\nThis model extends the base device details with gateway-specific metrics\nincluding network interface information, communication protocols, and\noperational status. Gateway devices provide communication interfaces\nbetween the solar system and external networks or monitoring systems.\n\nThis device type appears in the device list when using ``Command=DeviceList``\nif a gateway device is connected to the PVS6 system.",
   "type": "object",
   "properties": {
      "ISDETAIL": {
         "default": true,
         "description": "Details about the device",
         "examples": [
            true
         ],
         "title": "Isdetail",
         "type": "boolean"
      },
      "STATE": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "State of the device",
         "examples": [
            "working"
         ],
         "title": "State"
      },
      "STATEDESCR": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Description of the state",
         "examples": [
            "Working"
         ],
         "title": "Statedescr"
      },
      "SERIAL": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The serial number of the device",
         "examples": [
            "ZT112345678912A0069"
         ],
         "title": "Serial"
      },
      "MODEL": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The manufacturer's model of the device",
         "examples": [
            "PVS6M0400p"
         ],
         "title": "Model"
      },
      "HWVER": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The hardware version",
         "examples": [
            "6.02"
         ],
         "title": "Hwver"
      },
      "SWVER": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The software version  of the firmware",
         "examples": [
            "2021.9, Build 41001"
         ],
         "title": "Swver"
      },
      "DEVICE_TYPE": {
         "anyOf": [
            {
               "enum": [
                  "PVS",
                  "Power Meter",
                  "Inverter",
                  "PV Disconnect",
                  "Gateway",
                  "Storage Inverter",
                  "ESS BMS",
                  "Battery",
                  "Energy Storage System"
               ],
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Device Type"
      },
      "TYPE": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The detailed type of the device (usually includes the manufacturer)",
         "examples": [
            "PVS5-METER-P"
         ],
         "title": "Type"
      },
      "PORT": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The port the device is connected to",
         "examples": [
            "COM1"
         ],
         "title": "Port"
      },
      "DATATIME": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The time the data was recorded",
         "title": "Datatime"
      },
      "CURTIME": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The current time as reported by the device",
         "title": "Curtime"
      },
      "OPERATION": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Operation type",
         "examples": [
            "noop"
         ],
         "title": "Operation"
      },
      "origin": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Origin of this data",
         "examples": [
            "data_logger"
         ],
         "title": "Origin"
      },
      "panid": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "PAN ID is used to determine whether an MI is A) Un-associated (panid = 0),B) owned by 'me' (mi.panid == pvs.panid) or C) owned by someone else (mi.panid != 0 && mi.panid != pvs.panid)",
         "title": "Panid"
      },
      "interface": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The type of interface used by the gateway",
         "examples": [
            "sunspec"
         ],
         "title": "Interface"
      },
      "mac_address": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The MAC address of the gateway device",
         "examples": [
            "d8:a9:ab:cd:12:34"
         ],
         "title": "Mac Address"
      },
      "slave": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The slave number",
         "examples": [
            1
         ],
         "title": "Slave"
      }
   }
}

Fields:
Validators:
field CURTIME: datetime | None = None

The current time as reported by the device

Validated by:
field DATATIME: datetime | None = None

The time the data was recorded

Validated by:
field DEVICE_TYPE: DeviceType | None = None

The device type

field HWVER: str | None = None

The hardware version

field ISDETAIL: bool = True

Details about the device

field MODEL: str | None = None

The manufacturer’s model of the device

field OPERATION: str | None = None

Operation type

field PORT: str | None = None

The port the device is connected to

field SERIAL: str | None = None

The serial number of the device

field STATE: str | None = None

State of the device

field STATEDESCR: str | None = None

Description of the state

field SWVER: str | None = None

The software version of the firmware

field TYPE: str | None = None

The detailed type of the device (usually includes the manufacturer)

field interface: str | None = None

The type of interface used by the gateway

field mac_address: str | None = None

The MAC address of the gateway device

field origin: str | None = None

Origin of this data

field panid: float | None = None

PAN ID is used to determine whether an MI is A) Un-associated (panid = 0),B) owned by ‘me’ (mi.panid == pvs.panid) or C) owned by someone else (mi.panid != 0 && mi.panid != pvs.panid)

field slave: int | None = None

The slave number

classmethod construct(_fields_set: set[str] | None = None, **values: Any) Self
model_copy(*, update: Mapping[str, Any] | None = None, deep: bool = False) Self
!!! abstract “Usage Documentation”

[model_copy](../concepts/serialization.md#model_copy)

Returns a copy of the model.

!!! note

The underlying instance’s [__dict__][object.__dict__] attribute is copied. This might have unexpected side effects if you store anything in it, on top of the model fields (e.g. the value of [cached properties][functools.cached_property]).

Parameters:
  • update – Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data.

  • deep – Set to True to make a deep copy of the model.

Returns:

New model instance.

classmethod model_validate(obj: Any, *, strict: bool | None = None, from_attributes: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate a pydantic model instance.

Parameters:
  • obj – The object to validate.

  • strict – Whether to enforce types strictly.

  • from_attributes – Whether to extract data from object attributes.

  • context – Additional context to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Raises:

ValidationError – If the object could not be validated.

Returns:

The validated model instance.

classmethod model_validate_json(json_data: str | bytes | bytearray, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self
!!! abstract “Usage Documentation”

[JSON Parsing](../concepts/json.md#json-parsing)

Validate the given JSON data against the Pydantic model.

Parameters:
  • json_data – The JSON data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Raises:

ValidationError – If json_data is not a JSON string or the object could not be validated.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

classmethod parse_file(path: str | Path, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self
classmethod parse_obj(obj: Any) Self
classmethod parse_raw(b: str | bytes, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self
validator parse_timestamp  »  DATATIME, CURTIME

Convert timestamp strings to datetime objects.

Handles various timestamp formats found in the API responses:

  • PVS6 comma-separated format: “2025,06,22,00,15,54”

  • Already parsed datetime objects

Parameters:

v – The timestamp value to parse, can be a string or datetime object.

Raises:

ValueError – If the timestamp format is invalid or cannot be parsed.

pydantic model sungazer.models.devices.PVDisconnectDetail[source]

Bases: BaseDeviceDetail

Model representing a PV disconnect device in the solar system.

This model extends the base device details with PV disconnect-specific metrics including switch status, control capabilities, and operational parameters. PV disconnect devices provide safety isolation between the solar array and the rest of the electrical system, allowing for safe maintenance and emergency shutdown procedures.

This device type appears in the device list when using Command=DeviceList if a PV disconnect device is connected to the PVS6 system.

Show JSON schema
{
   "title": "PVDisconnectDetail",
   "description": "Model representing a PV disconnect device in the solar system.\n\nThis model extends the base device details with PV disconnect-specific metrics\nincluding switch status, control capabilities, and operational parameters.\nPV disconnect devices provide safety isolation between the solar array and\nthe rest of the electrical system, allowing for safe maintenance and emergency\nshutdown procedures.\n\nThis device type appears in the device list when using ``Command=DeviceList``\nif a PV disconnect device is connected to the PVS6 system.",
   "type": "object",
   "properties": {
      "ISDETAIL": {
         "default": true,
         "description": "Details about the device",
         "examples": [
            true
         ],
         "title": "Isdetail",
         "type": "boolean"
      },
      "STATE": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "State of the device",
         "examples": [
            "working"
         ],
         "title": "State"
      },
      "STATEDESCR": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Description of the state",
         "examples": [
            "Working"
         ],
         "title": "Statedescr"
      },
      "SERIAL": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The serial number of the device",
         "examples": [
            "ZT112345678912A0069"
         ],
         "title": "Serial"
      },
      "MODEL": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The manufacturer's model of the device",
         "examples": [
            "PVS6M0400p"
         ],
         "title": "Model"
      },
      "HWVER": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The hardware version",
         "examples": [
            "6.02"
         ],
         "title": "Hwver"
      },
      "SWVER": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The software version  of the firmware",
         "examples": [
            "2021.9, Build 41001"
         ],
         "title": "Swver"
      },
      "DEVICE_TYPE": {
         "anyOf": [
            {
               "enum": [
                  "PVS",
                  "Power Meter",
                  "Inverter",
                  "PV Disconnect",
                  "Gateway",
                  "Storage Inverter",
                  "ESS BMS",
                  "Battery",
                  "Energy Storage System"
               ],
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Device Type"
      },
      "TYPE": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The detailed type of the device (usually includes the manufacturer)",
         "examples": [
            "PVS5-METER-P"
         ],
         "title": "Type"
      },
      "PORT": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The port the device is connected to",
         "examples": [
            "COM1"
         ],
         "title": "Port"
      },
      "DATATIME": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The time the data was recorded",
         "title": "Datatime"
      },
      "CURTIME": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The current time as reported by the device",
         "title": "Curtime"
      },
      "OPERATION": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Operation type",
         "examples": [
            "noop"
         ],
         "title": "Operation"
      },
      "origin": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Origin of this data",
         "examples": [
            "data_logger"
         ],
         "title": "Origin"
      },
      "panid": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "PAN ID is used to determine whether an MI is A) Un-associated (panid = 0),B) owned by 'me' (mi.panid == pvs.panid) or C) owned by someone else (mi.panid != 0 && mi.panid != pvs.panid)",
         "title": "Panid"
      },
      "event_history": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Count of 'events' seen so far",
         "examples": [
            32
         ],
         "title": "Event History"
      },
      "hw_version": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The hardware version",
         "examples": [
            "0.2.0"
         ],
         "title": "Hw Version"
      },
      "interface": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The type of interface used by the panel",
         "examples": [
            "ttymxc5"
         ],
         "title": "Interface"
      },
      "slave": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Slave number",
         "examples": [
            230
         ],
         "title": "Slave"
      },
      "fw_error": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Error count for firmware operations",
         "examples": [
            0,
            1,
            2
         ],
         "title": "Fw Error"
      },
      "relay_mode": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Indicates the relay mode of the disconnect",
         "examples": [
            0,
            1
         ],
         "title": "Relay Mode"
      },
      "relay1_state": {
         "anyOf": [
            {
               "enum": [
                  0,
                  1
               ],
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "State of Relay 1, indicating operational status",
         "examples": [
            0,
            1
         ],
         "title": "Relay1 State"
      },
      "relay2_state": {
         "anyOf": [
            {
               "enum": [
                  0,
                  1
               ],
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "State of Relay 2, indicating operational status",
         "examples": [
            0,
            1
         ],
         "title": "Relay2 State"
      },
      "relay1_error": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Error count for Relay 1",
         "examples": [
            0,
            1,
            2
         ],
         "title": "Relay1 Error"
      },
      "relay2_error": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Error count for Relay 2",
         "examples": [
            0,
            1,
            2
         ],
         "title": "Relay2 Error"
      },
      "v1n_grid_v": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Voltage differential between line and neutral at the disconnect in volts for phase 1",
         "examples": [
            120.0
         ],
         "title": "V1N Grid V"
      },
      "v2n_grid_v": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Voltage differential between line and neutral at the disconnect in volts for phase 2",
         "examples": [
            120.0
         ],
         "title": "V2N Grid V"
      },
      "v1n_pv_v": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Voltage differential between phase 1 neutral and the PV system in volts",
         "examples": [
            120.0
         ],
         "title": "V1N Pv V"
      },
      "v2n_pv_v": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Voltage differential between phase 2 neutral and the PV system in volts",
         "examples": [
            120.0
         ],
         "title": "V2N Pv V"
      }
   }
}

Fields:
Validators:
field CURTIME: datetime | None = None

The current time as reported by the device

Validated by:
field DATATIME: datetime | None = None

The time the data was recorded

Validated by:
field DEVICE_TYPE: DeviceType | None = None

The device type

field HWVER: str | None = None

The hardware version

field ISDETAIL: bool = True

Details about the device

field MODEL: str | None = None

The manufacturer’s model of the device

field OPERATION: str | None = None

Operation type

field PORT: str | None = None

The port the device is connected to

field SERIAL: str | None = None

The serial number of the device

field STATE: str | None = None

State of the device

field STATEDESCR: str | None = None

Description of the state

field SWVER: str | None = None

The software version of the firmware

field TYPE: str | None = None

The detailed type of the device (usually includes the manufacturer)

field event_history: int | None = None

Count of ‘events’ seen so far

Validated by:
field fw_error: int | None = None

Error count for firmware operations

Validated by:
field hw_version: str | None = None

The hardware version

field interface: str | None = None

The type of interface used by the panel

field origin: str | None = None

Origin of this data

field panid: float | None = None

PAN ID is used to determine whether an MI is A) Un-associated (panid = 0),B) owned by ‘me’ (mi.panid == pvs.panid) or C) owned by someone else (mi.panid != 0 && mi.panid != pvs.panid)

field relay1_error: int | None = None

Error count for Relay 1

Validated by:
field relay1_state: Literal[0, 1] | None = None

State of Relay 1, indicating operational status

Validated by:
field relay2_error: int | None = None

Error count for Relay 2

Validated by:
field relay2_state: Literal[0, 1] | None = None

State of Relay 2, indicating operational status

Validated by:
field relay_mode: int | None = None

Indicates the relay mode of the disconnect

Validated by:
field slave: int | None = None

Slave number

field v1n_grid_v: float | None = None

Voltage differential between line and neutral at the disconnect in volts for phase 1

field v1n_pv_v: float | None = None

Voltage differential between phase 1 neutral and the PV system in volts

field v2n_grid_v: float | None = None

Voltage differential between line and neutral at the disconnect in volts for phase 2

field v2n_pv_v: float | None = None

Voltage differential between phase 2 neutral and the PV system in volts

classmethod construct(_fields_set: set[str] | None = None, **values: Any) Self
model_copy(*, update: Mapping[str, Any] | None = None, deep: bool = False) Self
!!! abstract “Usage Documentation”

[model_copy](../concepts/serialization.md#model_copy)

Returns a copy of the model.

!!! note

The underlying instance’s [__dict__][object.__dict__] attribute is copied. This might have unexpected side effects if you store anything in it, on top of the model fields (e.g. the value of [cached properties][functools.cached_property]).

Parameters:
  • update – Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data.

  • deep – Set to True to make a deep copy of the model.

Returns:

New model instance.

classmethod model_validate(obj: Any, *, strict: bool | None = None, from_attributes: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate a pydantic model instance.

Parameters:
  • obj – The object to validate.

  • strict – Whether to enforce types strictly.

  • from_attributes – Whether to extract data from object attributes.

  • context – Additional context to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Raises:

ValidationError – If the object could not be validated.

Returns:

The validated model instance.

classmethod model_validate_json(json_data: str | bytes | bytearray, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self
!!! abstract “Usage Documentation”

[JSON Parsing](../concepts/json.md#json-parsing)

Validate the given JSON data against the Pydantic model.

Parameters:
  • json_data – The JSON data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Raises:

ValidationError – If json_data is not a JSON string or the object could not be validated.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

classmethod parse_file(path: str | Path, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self
validator parse_integer_fields  »  relay1_error, fw_error, event_history, relay2_error, relay2_state, relay1_state, relay_mode[source]

Convert string values to integers for fields that come from the API as strings.

Parameters:

v – The value to parse, can be a string, integer, or None.

Returns:

The parsed integer value, or None if the input was None.

Raises:

ValueError – If the value cannot be converted to an integer.

classmethod parse_obj(obj: Any) Self
classmethod parse_raw(b: str | bytes, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self
validator parse_timestamp  »  DATATIME, CURTIME

Convert timestamp strings to datetime objects.

Handles various timestamp formats found in the API responses:

  • PVS6 comma-separated format: “2025,06,22,00,15,54”

  • Already parsed datetime objects

Parameters:

v – The timestamp value to parse, can be a string or datetime object.

Raises:

ValueError – If the timestamp format is invalid or cannot be parsed.

pydantic model sungazer.models.devices.PVSDeviceDetail[source]

Bases: BaseDeviceDetail

Model representing the PVS (Photovoltaic Supervisor) device itself.

This model extends the base device details with PVS-specific metrics including diagnostic information about communication errors, system resource utilization (CPU, memory, flash storage), and operational metrics like scan performance and uptime.

This device type appears in the device list when using Command=DeviceList and represents the central monitoring and control system for the solar installation.

Show JSON schema
{
   "title": "PVSDeviceDetail",
   "description": "Model representing the PVS (Photovoltaic Supervisor) device itself.\n\nThis model extends the base device details with PVS-specific metrics\nincluding diagnostic information about communication errors, system resource\nutilization (CPU, memory, flash storage), and operational metrics like scan\nperformance and uptime.\n\nThis device type appears in the device list when using\n``Command=DeviceList`` and represents the central monitoring and control\nsystem for the solar installation.",
   "type": "object",
   "properties": {
      "ISDETAIL": {
         "default": true,
         "description": "Details about the device",
         "examples": [
            true
         ],
         "title": "Isdetail",
         "type": "boolean"
      },
      "STATE": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "State of the device",
         "examples": [
            "working"
         ],
         "title": "State"
      },
      "STATEDESCR": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Description of the state",
         "examples": [
            "Working"
         ],
         "title": "Statedescr"
      },
      "SERIAL": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The serial number of the device",
         "examples": [
            "ZT112345678912A0069"
         ],
         "title": "Serial"
      },
      "MODEL": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The manufacturer's model of the device",
         "examples": [
            "PVS6M0400p"
         ],
         "title": "Model"
      },
      "HWVER": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The hardware version",
         "examples": [
            "6.02"
         ],
         "title": "Hwver"
      },
      "SWVER": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The software version  of the firmware",
         "examples": [
            "2021.9, Build 41001"
         ],
         "title": "Swver"
      },
      "DEVICE_TYPE": {
         "anyOf": [
            {
               "enum": [
                  "PVS",
                  "Power Meter",
                  "Inverter",
                  "PV Disconnect",
                  "Gateway",
                  "Storage Inverter",
                  "ESS BMS",
                  "Battery",
                  "Energy Storage System"
               ],
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Device Type"
      },
      "TYPE": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The detailed type of the device (usually includes the manufacturer)",
         "examples": [
            "PVS5-METER-P"
         ],
         "title": "Type"
      },
      "PORT": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The port the device is connected to",
         "examples": [
            "COM1"
         ],
         "title": "Port"
      },
      "DATATIME": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The time the data was recorded",
         "title": "Datatime"
      },
      "CURTIME": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The current time as reported by the device",
         "title": "Curtime"
      },
      "OPERATION": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Operation type",
         "examples": [
            "noop"
         ],
         "title": "Operation"
      },
      "origin": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Origin of this data",
         "examples": [
            "data_logger"
         ],
         "title": "Origin"
      },
      "panid": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "PAN ID is used to determine whether an MI is A) Un-associated (panid = 0),B) owned by 'me' (mi.panid == pvs.panid) or C) owned by someone else (mi.panid != 0 && mi.panid != pvs.panid)",
         "title": "Panid"
      },
      "dl_error_count": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Number of comms errors detected since last report",
         "title": "Dl Error Count"
      },
      "dl_comm_err": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Number of comms errors",
         "title": "Dl Comm Err"
      },
      "dl_skipped_scans": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "This counts when the supervisor scans the PLC network for inverters and it decides it needs to skip a scan",
         "examples": [
            0
         ],
         "title": "Dl Skipped Scans"
      },
      "dl_cpu_load": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The CPU load of the device",
         "examples": [
            12.5
         ],
         "title": "Dl Cpu Load"
      },
      "dl_flash_avail": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "How much free flash memory is available",
         "examples": [
            12234
         ],
         "title": "Dl Flash Avail"
      },
      "dl_mem_used": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "How much memory is used, probably in kB",
         "examples": [
            23456
         ],
         "title": "Dl Mem Used"
      },
      "dl_scan_time": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "How long the last scan of the PLC network took, maybe in milliseconds",
         "examples": [
            1234
         ],
         "title": "Dl Scan Time"
      },
      "dl_untransmitted": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Numbeer of not yet transmitted events/records?",
         "examples": [
            0
         ],
         "title": "Dl Untransmitted"
      },
      "dl_uptime": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            123456
         ],
         "title": "Dl Uptime"
      }
   }
}

Fields:
Validators:
field CURTIME: datetime | None = None

The current time as reported by the device

Validated by:
field DATATIME: datetime | None = None

The time the data was recorded

Validated by:
field DEVICE_TYPE: DeviceType | None = None

The device type

field HWVER: str | None = None

The hardware version

field ISDETAIL: bool = True

Details about the device

field MODEL: str | None = None

The manufacturer’s model of the device

field OPERATION: str | None = None

Operation type

field PORT: str | None = None

The port the device is connected to

field SERIAL: str | None = None

The serial number of the device

field STATE: str | None = None

State of the device

field STATEDESCR: str | None = None

Description of the state

field SWVER: str | None = None

The software version of the firmware

field TYPE: str | None = None

The detailed type of the device (usually includes the manufacturer)

field dl_comm_err: int | None = None

Number of comms errors

field dl_cpu_load: float | None = None

The CPU load of the device

field dl_error_count: int | None = None

Number of comms errors detected since last report

field dl_flash_avail: int | None = None

How much free flash memory is available

field dl_mem_used: int | None = None

How much memory is used, probably in kB

field dl_scan_time: int | None = None

How long the last scan of the PLC network took, maybe in milliseconds

field dl_skipped_scans: int | None = None

This counts when the supervisor scans the PLC network for inverters and it decides it needs to skip a scan

field dl_untransmitted: int | None = None

Numbeer of not yet transmitted events/records?

field dl_uptime: int | None = None

The uptime of the data logger in seconds (PVS only). It has been observed to be lower after 24hrs, so either there can be restarts for power reasons or perhaps the device itself restarts itself periodically (to clear memory leaks?)

field origin: str | None = None

Origin of this data

field panid: float | None = None

PAN ID is used to determine whether an MI is A) Un-associated (panid = 0),B) owned by ‘me’ (mi.panid == pvs.panid) or C) owned by someone else (mi.panid != 0 && mi.panid != pvs.panid)

classmethod construct(_fields_set: set[str] | None = None, **values: Any) Self
model_copy(*, update: Mapping[str, Any] | None = None, deep: bool = False) Self
!!! abstract “Usage Documentation”

[model_copy](../concepts/serialization.md#model_copy)

Returns a copy of the model.

!!! note

The underlying instance’s [__dict__][object.__dict__] attribute is copied. This might have unexpected side effects if you store anything in it, on top of the model fields (e.g. the value of [cached properties][functools.cached_property]).

Parameters:
  • update – Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data.

  • deep – Set to True to make a deep copy of the model.

Returns:

New model instance.

classmethod model_validate(obj: Any, *, strict: bool | None = None, from_attributes: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate a pydantic model instance.

Parameters:
  • obj – The object to validate.

  • strict – Whether to enforce types strictly.

  • from_attributes – Whether to extract data from object attributes.

  • context – Additional context to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Raises:

ValidationError – If the object could not be validated.

Returns:

The validated model instance.

classmethod model_validate_json(json_data: str | bytes | bytearray, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self
!!! abstract “Usage Documentation”

[JSON Parsing](../concepts/json.md#json-parsing)

Validate the given JSON data against the Pydantic model.

Parameters:
  • json_data – The JSON data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Raises:

ValidationError – If json_data is not a JSON string or the object could not be validated.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

classmethod parse_file(path: str | Path, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self
classmethod parse_obj(obj: Any) Self
classmethod parse_raw(b: str | bytes, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self
validator parse_timestamp  »  DATATIME, CURTIME

Convert timestamp strings to datetime objects.

Handles various timestamp formats found in the API responses:

  • PVS6 comma-separated format: “2025,06,22,00,15,54”

  • Already parsed datetime objects

Parameters:

v – The timestamp value to parse, can be a string or datetime object.

Raises:

ValueError – If the timestamp format is invalid or cannot be parsed.

property last_restart_time: datetime | None

Calculate when the data logger last restarted in UTC.

Uses the current time (CURTIME) and subtracts the uptime (dl_uptime) to determine when the system was last restarted.

Returns:

The UTC timestamp when the data logger last restarted,

or None if insufficient data is available.

Return type:

datetime

pydantic model sungazer.models.devices.PowerMeterDeviceDetail[source]

Bases: BaseDeviceDetail

Common base model for all power metering devices in the system.

This model contains fields relevant to any power meter, whether measuring production or consumption. It includes power metrics (real, reactive, and apparent power), energy measurements, power factor calculations, and operational parameters like frequency and current sensor calibration.

Power meters track electrical energy flow at key points in the solar system and building electrical infrastructure.

Show JSON schema
{
   "title": "PowerMeterDeviceDetail",
   "description": "Common base model for all power metering devices in the system.\n\nThis model contains fields relevant to any power meter, whether measuring\nproduction or consumption. It includes power metrics (real, reactive, and\napparent power), energy measurements, power factor calculations, and\noperational parameters like frequency and current sensor calibration.\n\nPower meters track electrical energy flow at key points in the solar system\nand building electrical infrastructure.",
   "type": "object",
   "properties": {
      "ISDETAIL": {
         "default": true,
         "description": "Details about the device",
         "examples": [
            true
         ],
         "title": "Isdetail",
         "type": "boolean"
      },
      "STATE": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "State of the device",
         "examples": [
            "working"
         ],
         "title": "State"
      },
      "STATEDESCR": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Description of the state",
         "examples": [
            "Working"
         ],
         "title": "Statedescr"
      },
      "SERIAL": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The serial number of the device",
         "examples": [
            "ZT112345678912A0069"
         ],
         "title": "Serial"
      },
      "MODEL": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The manufacturer's model of the device",
         "examples": [
            "PVS6M0400p"
         ],
         "title": "Model"
      },
      "HWVER": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The hardware version",
         "examples": [
            "6.02"
         ],
         "title": "Hwver"
      },
      "SWVER": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The software version  of the firmware",
         "examples": [
            "2021.9, Build 41001"
         ],
         "title": "Swver"
      },
      "DEVICE_TYPE": {
         "anyOf": [
            {
               "enum": [
                  "PVS",
                  "Power Meter",
                  "Inverter",
                  "PV Disconnect",
                  "Gateway",
                  "Storage Inverter",
                  "ESS BMS",
                  "Battery",
                  "Energy Storage System"
               ],
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Device Type"
      },
      "TYPE": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The detailed type of the device (usually includes the manufacturer)",
         "examples": [
            "PVS5-METER-P"
         ],
         "title": "Type"
      },
      "PORT": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The port the device is connected to",
         "examples": [
            "COM1"
         ],
         "title": "Port"
      },
      "DATATIME": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The time the data was recorded",
         "title": "Datatime"
      },
      "CURTIME": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The current time as reported by the device",
         "title": "Curtime"
      },
      "OPERATION": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Operation type",
         "examples": [
            "noop"
         ],
         "title": "Operation"
      },
      "origin": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Origin of this data",
         "examples": [
            "data_logger"
         ],
         "title": "Origin"
      },
      "panid": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "PAN ID is used to determine whether an MI is A) Un-associated (panid = 0),B) owned by 'me' (mi.panid == pvs.panid) or C) owned by someone else (mi.panid != 0 && mi.panid != pvs.panid)",
         "title": "Panid"
      },
      "interface": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The type of interface used by the device",
         "examples": [
            "mime"
         ],
         "title": "Interface"
      },
      "subtype": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The subtype of meter",
         "examples": [
            "GROSS_PRODUCTION_SITE"
         ],
         "title": "Subtype"
      },
      "ct_scl_fctr": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Current capacity of the calibration-reference CT sensor in Amps.",
         "examples": [
            50
         ],
         "title": "Ct Scl Fctr"
      },
      "net_ltea_3phsum_kwh": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Net cumulative kWh, across all 3 phases",
         "examples": [
            198.92
         ],
         "title": "Net Ltea 3Phsum Kwh"
      },
      "p_3phsum_kw": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Average real power (kW)",
         "examples": [
            1.9867
         ],
         "title": "P 3Phsum Kw"
      },
      "q_3phsum_kvar": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Average reactive power (kVA) across all 3 phases",
         "examples": [
            0.1234
         ],
         "title": "Q 3Phsum Kvar"
      },
      "s_3phsum_kva": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Average apparent power (kVA) across all 3 phases",
         "examples": [
            2.0
         ],
         "title": "S 3Phsum Kva"
      },
      "tot_pf_rto": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Total power factor ratio, defined as real power (kW) divided by apparent (kVA)",
         "examples": [
            0.993
         ],
         "title": "Tot Pf Rto"
      },
      "freq_hz": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Operating Frequency in Hz",
         "examples": [
            60.0
         ],
         "title": "Freq Hz"
      },
      "CAL0": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The sensor's current capacity for the calibration-reference CT sensor.It will be 50 (50A) for the production meter and 100 or 200 for the consumption meter.",
         "examples": [
            50
         ],
         "title": "Cal0"
      },
      "v12_v": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Supply Voltage sum accross C1 and C2 leads (typically in the 220-140V range)",
         "examples": [
            208.0
         ],
         "title": "V12 V"
      }
   }
}

Fields:
Validators:
field CAL0: int | None = None

The sensor’s current capacity for the calibration-reference CT sensor.It will be 50 (50A) for the production meter and 100 or 200 for the consumption meter.

field CURTIME: datetime | None = None

The current time as reported by the device

Validated by:
field DATATIME: datetime | None = None

The time the data was recorded

Validated by:
field DEVICE_TYPE: DeviceType | None = None

The device type

field HWVER: str | None = None

The hardware version

field ISDETAIL: bool = True

Details about the device

field MODEL: str | None = None

The manufacturer’s model of the device

field OPERATION: str | None = None

Operation type

field PORT: str | None = None

The port the device is connected to

field SERIAL: str | None = None

The serial number of the device

field STATE: str | None = None

State of the device

field STATEDESCR: str | None = None

Description of the state

field SWVER: str | None = None

The software version of the firmware

field TYPE: str | None = None

The detailed type of the device (usually includes the manufacturer)

field ct_scl_fctr: int | None = None

Current capacity of the calibration-reference CT sensor in Amps.

field freq_hz: float | None = None

Operating Frequency in Hz

field interface: str | None = None

The type of interface used by the device

field net_ltea_3phsum_kwh: float | None = None

Net cumulative kWh, across all 3 phases

field origin: str | None = None

Origin of this data

field p_3phsum_kw: float | None = None

Average real power (kW)

field panid: float | None = None

PAN ID is used to determine whether an MI is A) Un-associated (panid = 0),B) owned by ‘me’ (mi.panid == pvs.panid) or C) owned by someone else (mi.panid != 0 && mi.panid != pvs.panid)

field q_3phsum_kvar: float | None = None

Average reactive power (kVA) across all 3 phases

field s_3phsum_kva: float | None = None

Average apparent power (kVA) across all 3 phases

field subtype: str | None = None

The subtype of meter

field tot_pf_rto: float | None = None

Total power factor ratio, defined as real power (kW) divided by apparent (kVA)

field v12_v: float | None = None

Supply voltage sum accross C1 and C2 leads (typically in the 220-140V range)

Supply Voltage sum accross C1 and C2 leads (typically in the 220-140V range)

classmethod construct(_fields_set: set[str] | None = None, **values: Any) Self
model_copy(*, update: Mapping[str, Any] | None = None, deep: bool = False) Self
!!! abstract “Usage Documentation”

[model_copy](../concepts/serialization.md#model_copy)

Returns a copy of the model.

!!! note

The underlying instance’s [__dict__][object.__dict__] attribute is copied. This might have unexpected side effects if you store anything in it, on top of the model fields (e.g. the value of [cached properties][functools.cached_property]).

Parameters:
  • update – Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data.

  • deep – Set to True to make a deep copy of the model.

Returns:

New model instance.

classmethod model_validate(obj: Any, *, strict: bool | None = None, from_attributes: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate a pydantic model instance.

Parameters:
  • obj – The object to validate.

  • strict – Whether to enforce types strictly.

  • from_attributes – Whether to extract data from object attributes.

  • context – Additional context to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Raises:

ValidationError – If the object could not be validated.

Returns:

The validated model instance.

classmethod model_validate_json(json_data: str | bytes | bytearray, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self
!!! abstract “Usage Documentation”

[JSON Parsing](../concepts/json.md#json-parsing)

Validate the given JSON data against the Pydantic model.

Parameters:
  • json_data – The JSON data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Raises:

ValidationError – If json_data is not a JSON string or the object could not be validated.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

classmethod parse_file(path: str | Path, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self
classmethod parse_obj(obj: Any) Self
classmethod parse_raw(b: str | bytes, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self
validator parse_timestamp  »  DATATIME, CURTIME

Convert timestamp strings to datetime objects.

Handles various timestamp formats found in the API responses:

  • PVS6 comma-separated format: “2025,06,22,00,15,54”

  • Already parsed datetime objects

Parameters:

v – The timestamp value to parse, can be a string or datetime object.

Raises:

ValueError – If the timestamp format is invalid or cannot be parsed.

pydantic model sungazer.models.devices.ProductionPowerMeterDeviceDetail[source]

Bases: PowerMeterDeviceDetail

Model representing a production power meter that measures solar energy generation.

This model extends the base power meter details with production-specific metrics. Production meters monitor the electricity generated by the solar array, reporting zero output at night and varying levels during daylight hours based on sunlight conditions and system capacity.

This device type appears in the device list when using Command=DeviceList if a production power meter is connected to the PVS6.

Show JSON schema
{
   "title": "ProductionPowerMeterDeviceDetail",
   "description": "Model representing a production power meter that measures solar energy\ngeneration.\n\nThis model extends the base power meter details with production-specific\nmetrics.  Production meters monitor the electricity generated by the solar\narray, reporting zero output at night and varying levels during daylight\nhours based on sunlight conditions and system capacity.\n\nThis device type appears in the device list when using\n``Command=DeviceList`` if a production power meter is connected to the PVS6.",
   "type": "object",
   "properties": {
      "ISDETAIL": {
         "default": true,
         "description": "Details about the device",
         "examples": [
            true
         ],
         "title": "Isdetail",
         "type": "boolean"
      },
      "STATE": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "State of the device",
         "examples": [
            "working"
         ],
         "title": "State"
      },
      "STATEDESCR": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Description of the state",
         "examples": [
            "Working"
         ],
         "title": "Statedescr"
      },
      "SERIAL": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The serial number of the device",
         "examples": [
            "ZT112345678912A0069"
         ],
         "title": "Serial"
      },
      "MODEL": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The manufacturer's model of the device",
         "examples": [
            "PVS6M0400p"
         ],
         "title": "Model"
      },
      "HWVER": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The hardware version",
         "examples": [
            "6.02"
         ],
         "title": "Hwver"
      },
      "SWVER": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The software version  of the firmware",
         "examples": [
            "2021.9, Build 41001"
         ],
         "title": "Swver"
      },
      "DEVICE_TYPE": {
         "anyOf": [
            {
               "enum": [
                  "PVS",
                  "Power Meter",
                  "Inverter",
                  "PV Disconnect",
                  "Gateway",
                  "Storage Inverter",
                  "ESS BMS",
                  "Battery",
                  "Energy Storage System"
               ],
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Device Type"
      },
      "TYPE": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The detailed type of the device (usually includes the manufacturer)",
         "examples": [
            "PVS5-METER-P"
         ],
         "title": "Type"
      },
      "PORT": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The port the device is connected to",
         "examples": [
            "COM1"
         ],
         "title": "Port"
      },
      "DATATIME": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The time the data was recorded",
         "title": "Datatime"
      },
      "CURTIME": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The current time as reported by the device",
         "title": "Curtime"
      },
      "OPERATION": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Operation type",
         "examples": [
            "noop"
         ],
         "title": "Operation"
      },
      "origin": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Origin of this data",
         "examples": [
            "data_logger"
         ],
         "title": "Origin"
      },
      "panid": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "PAN ID is used to determine whether an MI is A) Un-associated (panid = 0),B) owned by 'me' (mi.panid == pvs.panid) or C) owned by someone else (mi.panid != 0 && mi.panid != pvs.panid)",
         "title": "Panid"
      },
      "interface": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The type of interface used by the device",
         "examples": [
            "mime"
         ],
         "title": "Interface"
      },
      "subtype": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The subtype of meter",
         "examples": [
            "GROSS_PRODUCTION_SITE"
         ],
         "title": "Subtype"
      },
      "ct_scl_fctr": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Current capacity of the calibration-reference CT sensor in Amps.",
         "examples": [
            50
         ],
         "title": "Ct Scl Fctr"
      },
      "net_ltea_3phsum_kwh": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Net cumulative kWh, across all 3 phases",
         "examples": [
            198.92
         ],
         "title": "Net Ltea 3Phsum Kwh"
      },
      "p_3phsum_kw": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Average real power (kW)",
         "examples": [
            1.9867
         ],
         "title": "P 3Phsum Kw"
      },
      "q_3phsum_kvar": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Average reactive power (kVA) across all 3 phases",
         "examples": [
            0.1234
         ],
         "title": "Q 3Phsum Kvar"
      },
      "s_3phsum_kva": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Average apparent power (kVA) across all 3 phases",
         "examples": [
            2.0
         ],
         "title": "S 3Phsum Kva"
      },
      "tot_pf_rto": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Total power factor ratio, defined as real power (kW) divided by apparent (kVA)",
         "examples": [
            0.993
         ],
         "title": "Tot Pf Rto"
      },
      "freq_hz": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Operating Frequency in Hz",
         "examples": [
            60.0
         ],
         "title": "Freq Hz"
      },
      "CAL0": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The sensor's current capacity for the calibration-reference CT sensor.It will be 50 (50A) for the production meter and 100 or 200 for the consumption meter.",
         "examples": [
            50
         ],
         "title": "Cal0"
      },
      "v12_v": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Supply Voltage sum accross C1 and C2 leads (typically in the 220-140V range)",
         "examples": [
            208.0
         ],
         "title": "V12 V"
      },
      "production_subtype_enum": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The production subtype enum",
         "examples": [
            "GROSS_PRODUCTION_SITE"
         ],
         "title": "Production Subtype Enum"
      },
      "i_a": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Current in Amps",
         "examples": [
            2.1122
         ],
         "title": "I A"
      }
   }
}

Fields:
Validators:
field CAL0: int | None = None

The sensor’s current capacity for the calibration-reference CT sensor.It will be 50 (50A) for the production meter and 100 or 200 for the consumption meter.

field CURTIME: datetime | None = None

The current time as reported by the device

Validated by:
field DATATIME: datetime | None = None

The time the data was recorded

Validated by:
field DEVICE_TYPE: DeviceType | None = None

The device type

field HWVER: str | None = None

The hardware version

field ISDETAIL: bool = True

Details about the device

field MODEL: str | None = None

The manufacturer’s model of the device

field OPERATION: str | None = None

Operation type

field PORT: str | None = None

The port the device is connected to

field SERIAL: str | None = None

The serial number of the device

field STATE: str | None = None

State of the device

field STATEDESCR: str | None = None

Description of the state

field SWVER: str | None = None

The software version of the firmware

field TYPE: str | None = None

The detailed type of the device (usually includes the manufacturer)

field ct_scl_fctr: int | None = None

Current capacity of the calibration-reference CT sensor in Amps.

field freq_hz: float | None = None

Operating Frequency in Hz

field i_a: float | None = None

Current in Amps

field interface: str | None = None

The type of interface used by the device

field net_ltea_3phsum_kwh: float | None = None

Net cumulative kWh, across all 3 phases

field origin: str | None = None

Origin of this data

field p_3phsum_kw: float | None = None

Average real power (kW)

field panid: float | None = None

PAN ID is used to determine whether an MI is A) Un-associated (panid = 0),B) owned by ‘me’ (mi.panid == pvs.panid) or C) owned by someone else (mi.panid != 0 && mi.panid != pvs.panid)

field production_subtype_enum: str | None = None

The production meter subtype enum

The production subtype enum

field q_3phsum_kvar: float | None = None

Average reactive power (kVA) across all 3 phases

field s_3phsum_kva: float | None = None

Average apparent power (kVA) across all 3 phases

field subtype: str | None = None

The subtype of meter

field tot_pf_rto: float | None = None

Total power factor ratio, defined as real power (kW) divided by apparent (kVA)

field v12_v: float | None = None

Supply voltage sum accross C1 and C2 leads (typically in the 220-140V range)

Supply Voltage sum accross C1 and C2 leads (typically in the 220-140V range)

classmethod construct(_fields_set: set[str] | None = None, **values: Any) Self
model_copy(*, update: Mapping[str, Any] | None = None, deep: bool = False) Self
!!! abstract “Usage Documentation”

[model_copy](../concepts/serialization.md#model_copy)

Returns a copy of the model.

!!! note

The underlying instance’s [__dict__][object.__dict__] attribute is copied. This might have unexpected side effects if you store anything in it, on top of the model fields (e.g. the value of [cached properties][functools.cached_property]).

Parameters:
  • update – Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data.

  • deep – Set to True to make a deep copy of the model.

Returns:

New model instance.

classmethod model_validate(obj: Any, *, strict: bool | None = None, from_attributes: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate a pydantic model instance.

Parameters:
  • obj – The object to validate.

  • strict – Whether to enforce types strictly.

  • from_attributes – Whether to extract data from object attributes.

  • context – Additional context to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Raises:

ValidationError – If the object could not be validated.

Returns:

The validated model instance.

classmethod model_validate_json(json_data: str | bytes | bytearray, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self
!!! abstract “Usage Documentation”

[JSON Parsing](../concepts/json.md#json-parsing)

Validate the given JSON data against the Pydantic model.

Parameters:
  • json_data – The JSON data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Raises:

ValidationError – If json_data is not a JSON string or the object could not be validated.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

classmethod parse_file(path: str | Path, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self
classmethod parse_obj(obj: Any) Self
classmethod parse_raw(b: str | bytes, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self
validator parse_timestamp  »  CURTIME, DATATIME

Convert timestamp strings to datetime objects.

Handles various timestamp formats found in the API responses:

  • PVS6 comma-separated format: “2025,06,22,00,15,54”

  • Already parsed datetime objects

Parameters:

v – The timestamp value to parse, can be a string or datetime object.

Raises:

ValueError – If the timestamp format is invalid or cannot be parsed.

pydantic model sungazer.models.devices.SchneiderXwPro[source]

Bases: BaseDeviceDetail

Model representing a Schneider XW Pro storage inverter in the solar system.

This model extends the base device details with Schneider XW Pro-specific metrics including storage inverter capabilities, battery management, and operational parameters. Schneider XW Pro devices provide energy storage functionality, allowing for battery backup and energy management in solar installations.

This device type appears in the device list when using Command=DeviceList if a Schneider XW Pro storage inverter is connected to the PVS6 system.

Show JSON schema
{
   "title": "SchneiderXwPro",
   "description": "Model representing a Schneider XW Pro storage inverter in the solar system.\n\nThis model extends the base device details with Schneider XW Pro-specific\nmetrics including storage inverter capabilities, battery management, and\noperational parameters. Schneider XW Pro devices provide energy storage\nfunctionality, allowing for battery backup and energy management in solar\ninstallations.\n\nThis device type appears in the device list when using ``Command=DeviceList``\nif a Schneider XW Pro storage inverter is connected to the PVS6 system.",
   "type": "object",
   "properties": {
      "ISDETAIL": {
         "default": true,
         "description": "Details about the device",
         "examples": [
            true
         ],
         "title": "Isdetail",
         "type": "boolean"
      },
      "STATE": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "State of the device",
         "examples": [
            "working"
         ],
         "title": "State"
      },
      "STATEDESCR": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Description of the state",
         "examples": [
            "Working"
         ],
         "title": "Statedescr"
      },
      "SERIAL": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The serial number of the device",
         "examples": [
            "ZT112345678912A0069"
         ],
         "title": "Serial"
      },
      "MODEL": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The manufacturer's model of the device",
         "examples": [
            "PVS6M0400p"
         ],
         "title": "Model"
      },
      "HWVER": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The hardware version",
         "examples": [
            "6.02"
         ],
         "title": "Hwver"
      },
      "SWVER": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The software version  of the firmware",
         "examples": [
            "2021.9, Build 41001"
         ],
         "title": "Swver"
      },
      "DEVICE_TYPE": {
         "anyOf": [
            {
               "enum": [
                  "PVS",
                  "Power Meter",
                  "Inverter",
                  "PV Disconnect",
                  "Gateway",
                  "Storage Inverter",
                  "ESS BMS",
                  "Battery",
                  "Energy Storage System"
               ],
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Device Type"
      },
      "TYPE": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The detailed type of the device (usually includes the manufacturer)",
         "examples": [
            "PVS5-METER-P"
         ],
         "title": "Type"
      },
      "PORT": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The port the device is connected to",
         "examples": [
            "COM1"
         ],
         "title": "Port"
      },
      "DATATIME": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The time the data was recorded",
         "title": "Datatime"
      },
      "CURTIME": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The current time as reported by the device",
         "title": "Curtime"
      },
      "OPERATION": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Operation type",
         "examples": [
            "noop"
         ],
         "title": "Operation"
      },
      "origin": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Origin of this data",
         "examples": [
            "data_logger"
         ],
         "title": "Origin"
      },
      "panid": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "PAN ID is used to determine whether an MI is A) Un-associated (panid = 0),B) owned by 'me' (mi.panid == pvs.panid) or C) owned by someone else (mi.panid != 0 && mi.panid != pvs.panid)",
         "title": "Panid"
      },
      "interface": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The type of interface used by the storage inverter",
         "examples": [
            "sunspec"
         ],
         "title": "Interface"
      },
      "mac_address": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The MAC address of the storage inverter device",
         "examples": [
            "d8:a9:ab:cd:12:34"
         ],
         "title": "Mac Address"
      },
      "parent": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The parent device identifier",
         "examples": [
            11
         ],
         "title": "Parent"
      },
      "slave": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The slave number for the storage inverter device",
         "examples": [
            10
         ],
         "title": "Slave"
      },
      "PARENT": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The parent device serial number",
         "examples": [
            "00001ABC1234_01234567890ABCDEF"
         ],
         "title": "Parent"
      }
   }
}

Fields:
Validators:
field CURTIME: datetime | None = None

The current time as reported by the device

Validated by:
field DATATIME: datetime | None = None

The time the data was recorded

Validated by:
field DEVICE_TYPE: DeviceType | None = None

The device type

field HWVER: str | None = None

The hardware version

field ISDETAIL: bool = True

Details about the device

field MODEL: str | None = None

The manufacturer’s model of the device

field OPERATION: str | None = None

Operation type

field PARENT: str | None = None

The parent device serial number

field PORT: str | None = None

The port the device is connected to

field SERIAL: str | None = None

The serial number of the device

field STATE: str | None = None

State of the device

field STATEDESCR: str | None = None

Description of the state

field SWVER: str | None = None

The software version of the firmware

field TYPE: str | None = None

The detailed type of the device (usually includes the manufacturer)

field interface: str | None = None

The type of interface used by the storage inverter

field mac_address: str | None = None

The MAC address of the storage inverter device

field origin: str | None = None

Origin of this data

field panid: float | None = None

PAN ID is used to determine whether an MI is A) Un-associated (panid = 0),B) owned by ‘me’ (mi.panid == pvs.panid) or C) owned by someone else (mi.panid != 0 && mi.panid != pvs.panid)

field parent: int | None = None

The parent device identifier

field slave: int | None = None

The slave number for the storage inverter device

classmethod construct(_fields_set: set[str] | None = None, **values: Any) Self
model_copy(*, update: Mapping[str, Any] | None = None, deep: bool = False) Self
!!! abstract “Usage Documentation”

[model_copy](../concepts/serialization.md#model_copy)

Returns a copy of the model.

!!! note

The underlying instance’s [__dict__][object.__dict__] attribute is copied. This might have unexpected side effects if you store anything in it, on top of the model fields (e.g. the value of [cached properties][functools.cached_property]).

Parameters:
  • update – Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data.

  • deep – Set to True to make a deep copy of the model.

Returns:

New model instance.

classmethod model_validate(obj: Any, *, strict: bool | None = None, from_attributes: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate a pydantic model instance.

Parameters:
  • obj – The object to validate.

  • strict – Whether to enforce types strictly.

  • from_attributes – Whether to extract data from object attributes.

  • context – Additional context to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Raises:

ValidationError – If the object could not be validated.

Returns:

The validated model instance.

classmethod model_validate_json(json_data: str | bytes | bytearray, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self
!!! abstract “Usage Documentation”

[JSON Parsing](../concepts/json.md#json-parsing)

Validate the given JSON data against the Pydantic model.

Parameters:
  • json_data – The JSON data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Raises:

ValidationError – If json_data is not a JSON string or the object could not be validated.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

classmethod parse_file(path: str | Path, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self
classmethod parse_obj(obj: Any) Self
classmethod parse_raw(b: str | bytes, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self
validator parse_timestamp  »  CURTIME, DATATIME

Convert timestamp strings to datetime objects.

Handles various timestamp formats found in the API responses:

  • PVS6 comma-separated format: “2025,06,22,00,15,54”

  • Already parsed datetime objects

Parameters:

v – The timestamp value to parse, can be a string or datetime object.

Raises:

ValueError – If the timestamp format is invalid or cannot be parsed.

pydantic model sungazer.models.devices.SolarBridgeDeviceDetail[source]

Bases: BaseDeviceDetail

Model representing a SolarBridge microinverter device in the solar array.

This model extends the base device details with microinverter-specific metrics including AC output parameters (power, voltage, current), DC input measurements from the connected solar panel, thermal monitoring, and energy production data.

Microinverters convert DC power from individual solar panels to AC power for use in the building or export to the grid. Each microinverter typically connects to a single solar panel.

This device type appears in the device list when using Command=DeviceList if SolarBridge microinverters are connected to the PVS6.

Show JSON schema
{
   "title": "SolarBridgeDeviceDetail",
   "description": "Model representing a SolarBridge microinverter device in the solar array.\n\nThis model extends the base device details with microinverter-specific\nmetrics including AC output parameters (power, voltage, current), DC input\nmeasurements from the connected solar panel, thermal monitoring, and energy\nproduction data.\n\nMicroinverters convert DC power from individual solar panels to AC power for\nuse in the building or export to the grid. Each microinverter typically\nconnects to a single solar panel.\n\nThis device type appears in the device list when using\n``Command=DeviceList`` if SolarBridge microinverters are connected to the\nPVS6.",
   "type": "object",
   "properties": {
      "ISDETAIL": {
         "default": true,
         "description": "Details about the device",
         "examples": [
            true
         ],
         "title": "Isdetail",
         "type": "boolean"
      },
      "STATE": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "State of the device",
         "examples": [
            "working"
         ],
         "title": "State"
      },
      "STATEDESCR": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Description of the state",
         "examples": [
            "Working"
         ],
         "title": "Statedescr"
      },
      "SERIAL": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The serial number of the device",
         "examples": [
            "ZT112345678912A0069"
         ],
         "title": "Serial"
      },
      "MODEL": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The manufacturer's model of the device",
         "examples": [
            "PVS6M0400p"
         ],
         "title": "Model"
      },
      "HWVER": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The hardware version",
         "examples": [
            "6.02"
         ],
         "title": "Hwver"
      },
      "SWVER": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The software version  of the firmware",
         "examples": [
            "2021.9, Build 41001"
         ],
         "title": "Swver"
      },
      "DEVICE_TYPE": {
         "anyOf": [
            {
               "enum": [
                  "PVS",
                  "Power Meter",
                  "Inverter",
                  "PV Disconnect",
                  "Gateway",
                  "Storage Inverter",
                  "ESS BMS",
                  "Battery",
                  "Energy Storage System"
               ],
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Device Type"
      },
      "TYPE": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The detailed type of the device (usually includes the manufacturer)",
         "examples": [
            "PVS5-METER-P"
         ],
         "title": "Type"
      },
      "PORT": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The port the device is connected to",
         "examples": [
            "COM1"
         ],
         "title": "Port"
      },
      "DATATIME": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The time the data was recorded",
         "title": "Datatime"
      },
      "CURTIME": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The current time as reported by the device",
         "title": "Curtime"
      },
      "OPERATION": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Operation type",
         "examples": [
            "noop"
         ],
         "title": "Operation"
      },
      "origin": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Origin of this data",
         "examples": [
            "data_logger"
         ],
         "title": "Origin"
      },
      "panid": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "PAN ID is used to determine whether an MI is A) Un-associated (panid = 0),B) owned by 'me' (mi.panid == pvs.panid) or C) owned by someone else (mi.panid != 0 && mi.panid != pvs.panid)",
         "title": "Panid"
      },
      "interface": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The type of interface used by the panel?",
         "examples": [
            "mime"
         ],
         "title": "Interface"
      },
      "hw_version": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Hardware version",
         "examples": [
            "1.0"
         ],
         "title": "Hw Version"
      },
      "module_serial": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Serial number of the inverter module",
         "examples": [
            "12345678901234"
         ],
         "title": "Module Serial"
      },
      "PANEL": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Model of the solar panel module",
         "examples": [
            "SPR-A410-G-AC"
         ],
         "title": "Panel"
      },
      "slave": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Is this a slave device?",
         "examples": [
            false
         ],
         "title": "Slave"
      },
      "MOD_SN": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Serial number of the microinverter",
         "examples": [
            "12345678901234"
         ],
         "title": "Mod Sn"
      },
      "NMPLT_SKU": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "SKU of the microinverter",
         "examples": [
            "SB250-1BD-US"
         ],
         "title": "Nmplt Sku"
      },
      "ltea_3phsum_kwh": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Total Energy in kWh",
         "examples": [
            123.45
         ],
         "title": "Ltea 3Phsum Kwh"
      },
      "p_3phsum_kw": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "AC Power (kW)",
         "examples": [
            0.0471
         ],
         "title": "P 3Phsum Kw"
      },
      "vln_3phsum_v": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "AC Voltage (V)",
         "examples": [
            246.5
         ],
         "title": "Vln 3Phsum V"
      },
      "i_3phsum_a": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "AC Current (A)",
         "examples": [
            0.19
         ],
         "title": "I 3Phsum A"
      },
      "p_mppt1_v": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "DC Power (kW) for MPTT (Maximum Power Point Tracking)",
         "examples": [
            0.0502
         ],
         "title": "P Mppt1 V"
      },
      "v_mppt1_v": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "DC Voltage (V) for MPTT (Maximum Power Point Tracking)",
         "examples": [
            54.5
         ],
         "title": "V Mppt1 V"
      },
      "i_mppt1_a": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "DC Current (A) for MPTT (Maximum Power Point Tracking)",
         "examples": [
            0.92
         ],
         "title": "I Mppt1 A"
      },
      "p_mpptsum_kw": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Legacy? Seems replaced by p_mppt1_kw",
         "title": "P Mpptsum Kw"
      },
      "t_htsink_degc": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Heatsink temperature in degrees C",
         "examples": [
            45.0
         ],
         "title": "T Htsink Degc"
      },
      "freq_hz": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Operating Frequency in Hz",
         "examples": [
            60.0
         ],
         "title": "Freq Hz"
      },
      "stat_ind": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Status indicator?",
         "examples": [
            0
         ],
         "title": "Stat Ind"
      }
   }
}

Fields:
Validators:
field CURTIME: datetime | None = None

The current time as reported by the device

Validated by:
field DATATIME: datetime | None = None

The time the data was recorded

Validated by:
field DEVICE_TYPE: DeviceType | None = None

The device type

field HWVER: str | None = None

The hardware version

field ISDETAIL: bool = True

Details about the device

field MODEL: str | None = None

The manufacturer’s model of the device

field MOD_SN: str | None = None

Serial number of the microinverter

field NMPLT_SKU: str | None = None

SKU of the microinverter

field OPERATION: str | None = None

Operation type

field PANEL: str | None = None

Model of the solar panel module

field PORT: str | None = None

The port the device is connected to

field SERIAL: str | None = None

The serial number of the device

field STATE: str | None = None

State of the device

field STATEDESCR: str | None = None

Description of the state

field SWVER: str | None = None

The software version of the firmware

field TYPE: str | None = None

The detailed type of the device (usually includes the manufacturer)

field freq_hz: float | None = None

Operating Frequency in Hz

field hw_version: str | None = None

Hardware version

field i_3phsum_a: float | None = None

AC Current (A)

field i_mppt1_a: float | None = None

DC Current (A) for MPTT (Maximum Power Point Tracking)

field interface: str | None = None

The type of interface used by the panel?

field ltea_3phsum_kwh: float | None = None

Total Energy in kWh

field module_serial: str | None = None

Serial number of the inverter module

field origin: str | None = None

Origin of this data

field p_3phsum_kw: float | None = None

AC Power (kW)

field p_mppt1_v: float | None = None

DC Power (kW) for MPTT (Maximum Power Point Tracking)

field p_mpptsum_kw: float | None = None

Legacy? Seems replaced by p_mppt1_kw

field panid: float | None = None

PAN ID is used to determine whether an MI is A) Un-associated (panid = 0),B) owned by ‘me’ (mi.panid == pvs.panid) or C) owned by someone else (mi.panid != 0 && mi.panid != pvs.panid)

field slave: bool | None = None

Is this a slave device?

field stat_ind: int | None = None

Status indicator?

field t_htsink_degc: float | None = None

Heatsink temperature in degrees C

field v_mppt1_v: float | None = None

DC Voltage (V) for MPTT (Maximum Power Point Tracking)

field vln_3phsum_v: float | None = None

AC Voltage (V)

classmethod construct(_fields_set: set[str] | None = None, **values: Any) Self
model_copy(*, update: Mapping[str, Any] | None = None, deep: bool = False) Self
!!! abstract “Usage Documentation”

[model_copy](../concepts/serialization.md#model_copy)

Returns a copy of the model.

!!! note

The underlying instance’s [__dict__][object.__dict__] attribute is copied. This might have unexpected side effects if you store anything in it, on top of the model fields (e.g. the value of [cached properties][functools.cached_property]).

Parameters:
  • update – Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data.

  • deep – Set to True to make a deep copy of the model.

Returns:

New model instance.

classmethod model_validate(obj: Any, *, strict: bool | None = None, from_attributes: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate a pydantic model instance.

Parameters:
  • obj – The object to validate.

  • strict – Whether to enforce types strictly.

  • from_attributes – Whether to extract data from object attributes.

  • context – Additional context to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Raises:

ValidationError – If the object could not be validated.

Returns:

The validated model instance.

classmethod model_validate_json(json_data: str | bytes | bytearray, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self
!!! abstract “Usage Documentation”

[JSON Parsing](../concepts/json.md#json-parsing)

Validate the given JSON data against the Pydantic model.

Parameters:
  • json_data – The JSON data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Raises:

ValidationError – If json_data is not a JSON string or the object could not be validated.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

classmethod parse_file(path: str | Path, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self
classmethod parse_obj(obj: Any) Self
classmethod parse_raw(b: str | bytes, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self
validator parse_timestamp  »  CURTIME, DATATIME

Convert timestamp strings to datetime objects.

Handles various timestamp formats found in the API responses:

  • PVS6 comma-separated format: “2025,06,22,00,15,54”

  • Already parsed datetime objects

Parameters:

v – The timestamp value to parse, can be a string or datetime object.

Raises:

ValueError – If the timestamp format is invalid or cannot be parsed.

sungazer.models.devices.DeviceClass

A helper type for all possible device details

alias of Union[PVSDeviceDetail, ProductionPowerMeterDeviceDetail, ConsumptionPowerMeterDeviceDetail, SolarBridgeDeviceDetail, PVDisconnectDetail, Gateway, SchneiderXwPro, EquinioxBMS, Battery, EquinoxESS]

Firmware

pydantic model sungazer.models.firmware.CheckFWResponse[source]

Bases: BaseModel

Response model for the Command=CheckFW API endpoint.

This model provides information about available firmware updates for the system. It includes a URL to download the firmware update if one is available, or indicates that no updates are available.

Show JSON schema
{
   "title": "CheckFWResponse",
   "description": "Response model for the ``Command=CheckFW`` API endpoint.\n\nThis model provides information about available firmware updates for the\nsystem.  It includes a URL to download the firmware update if one is\navailable, or indicates that no updates are available.",
   "type": "object",
   "properties": {
      "url": {
         "anyOf": [
            {
               "format": "uri",
               "minLength": 1,
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            "none"
         ],
         "title": "Url"
      }
   }
}

Fields:
Validators:
field url: AnyUrl | None = None

The result

Validated by:
classmethod construct(_fields_set: set[str] | None = None, **values: Any) Self
classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

model_copy(*, update: Mapping[str, Any] | None = None, deep: bool = False) Self
!!! abstract “Usage Documentation”

[model_copy](../concepts/serialization.md#model_copy)

Returns a copy of the model.

!!! note

The underlying instance’s [__dict__][object.__dict__] attribute is copied. This might have unexpected side effects if you store anything in it, on top of the model fields (e.g. the value of [cached properties][functools.cached_property]).

Parameters:
  • update – Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data.

  • deep – Set to True to make a deep copy of the model.

Returns:

New model instance.

model_dump(*, mode: Literal['json', 'python'] | str = 'python', include: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, exclude: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, context: Any | None = None, by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, round_trip: bool = False, warnings: bool | Literal['none', 'warn', 'error'] = True, fallback: Callable[[Any], Any] | None = None, serialize_as_any: bool = False) dict[str, Any]
!!! abstract “Usage Documentation”

[model_dump](../concepts/serialization.md#modelmodel_dump)

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Parameters:
  • mode – The mode in which to_python should run. If mode is ‘json’, the output will only contain JSON serializable types. If mode is ‘python’, the output may contain non-JSON-serializable Python objects.

  • include – A set of fields to include in the output.

  • exclude – A set of fields to exclude from the output.

  • context – Additional context to pass to the serializer.

  • by_alias – Whether to use the field’s alias in the dictionary key if defined.

  • exclude_unset – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults – Whether to exclude fields that are set to their default value.

  • exclude_none – Whether to exclude fields that have a value of None.

  • round_trip – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any – Whether to serialize fields with duck-typing serialization behavior.

Returns:

A dictionary representation of the model.

model_dump_json(*, indent: int | None = None, include: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, exclude: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, context: Any | None = None, by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, round_trip: bool = False, warnings: bool | Literal['none', 'warn', 'error'] = True, fallback: Callable[[Any], Any] | None = None, serialize_as_any: bool = False) str
!!! abstract “Usage Documentation”

[model_dump_json](../concepts/serialization.md#modelmodel_dump_json)

Generates a JSON representation of the model using Pydantic’s to_json method.

Parameters:
  • indent – Indentation to use in the JSON output. If None is passed, the output will be compact.

  • include – Field(s) to include in the JSON output.

  • exclude – Field(s) to exclude from the JSON output.

  • context – Additional context to pass to the serializer.

  • by_alias – Whether to serialize using field aliases.

  • exclude_unset – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults – Whether to exclude fields that are set to their default value.

  • exclude_none – Whether to exclude fields that have a value of None.

  • round_trip – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any – Whether to serialize fields with duck-typing serialization behavior.

Returns:

A JSON string representation of the model.

classmethod model_validate(obj: Any, *, strict: bool | None = None, from_attributes: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate a pydantic model instance.

Parameters:
  • obj – The object to validate.

  • strict – Whether to enforce types strictly.

  • from_attributes – Whether to extract data from object attributes.

  • context – Additional context to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Raises:

ValidationError – If the object could not be validated.

Returns:

The validated model instance.

classmethod model_validate_json(json_data: str | bytes | bytearray, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self
!!! abstract “Usage Documentation”

[JSON Parsing](../concepts/json.md#json-parsing)

Validate the given JSON data against the Pydantic model.

Parameters:
  • json_data – The JSON data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Raises:

ValidationError – If json_data is not a JSON string or the object could not be validated.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

classmethod parse_file(path: str | Path, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self
classmethod parse_obj(obj: Any) Self
classmethod parse_raw(b: str | bytes, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self
validator parse_url  »  url[source]

Convert string URL to AnyUrl type, handling special “none” case.

Handles various input formats:

  • Valid URL strings (converted to AnyUrl)

  • The string “none” (converted to None)

  • Already parsed AnyUrl objects

  • None values (returned as None)

Parameters:

v – The URL value to parse, can be a string, AnyUrl, or None.

Returns:

The parsed AnyUrl object, or None if the input was “none” or None.

Raises:

ValueError – If the string cannot be converted to a valid URL.

Grid

pydantic model sungazer.models.grid.GridProfile[source]

Bases: BaseModel

Model representing a grid profile configuration option for the system.

Grid profiles define how the solar system interacts with the utility grid, establishing parameters for compliance with local utility regulations and requirements. Each profile has a unique identifier, name, and may have geographical applicability constraints expressed through ZIP code ranges.

The profile may also indicate special capabilities like self-supply operation, and whether it’s the default profile for new installations.

Show JSON schema
{
   "title": "GridProfile",
   "description": "Model representing a grid profile configuration option for the system.\n\nGrid profiles define how the solar system interacts with the utility grid,\nestablishing parameters for compliance with local utility regulations and\nrequirements. Each profile has a unique identifier, name, and may have\ngeographical applicability constraints expressed through ZIP code ranges.\n\nThe profile may also indicate special capabilities like self-supply\noperation, and whether it's the default profile for new installations.",
   "type": "object",
   "properties": {
      "default": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Default"
      },
      "filename": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            "8c9c4170.meta"
         ],
         "title": "Filename"
      },
      "id": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            "8c9c4170457c88f6dcee7216357681d580a3b9bd"
         ],
         "title": "Id"
      },
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            "HECO OMH R14H (Legacy)"
         ],
         "title": "Name"
      },
      "selfsupply": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Selfsupply"
      },
      "zipcodes": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/Zipcode"
               },
               "type": "array"
            },
            {
               "items": {
                  "type": "integer"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Zipcodes"
      }
   },
   "$defs": {
      "Zipcode": {
         "description": "Model representing a range of ZIP codes for grid profile geographical\napplicability.\n\nThis model defines the minimum and maximum ZIP code values within which a\nparticular grid profile is valid. This is used to determine which grid\nprofiles are appropriate for a system based on its installation location.",
         "properties": {
            "max": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  96898
               ],
               "title": "Max"
            },
            "min": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  96701
               ],
               "title": "Min"
            }
         },
         "title": "Zipcode",
         "type": "object"
      }
   }
}

Fields:
field default: bool | None = None

Whether this profile is the default profile for new installations.

field filename: str | None = None

The filename of the grid profile metadata file.

field id: str | None = None

The unique identifier for the grid profile.

field name: str | None = None

The human-readable name of the grid profile.

field selfsupply: bool | None = None

Whether this profile supports self-supply operation.

field zipcodes: list[sungazer.models.grid.Zipcode] | list[int] | None = None

List of ZIP code ranges where this profile is applicable.

classmethod construct(_fields_set: set[str] | None = None, **values: Any) Self
classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

model_copy(*, update: Mapping[str, Any] | None = None, deep: bool = False) Self
!!! abstract “Usage Documentation”

[model_copy](../concepts/serialization.md#model_copy)

Returns a copy of the model.

!!! note

The underlying instance’s [__dict__][object.__dict__] attribute is copied. This might have unexpected side effects if you store anything in it, on top of the model fields (e.g. the value of [cached properties][functools.cached_property]).

Parameters:
  • update – Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data.

  • deep – Set to True to make a deep copy of the model.

Returns:

New model instance.

model_dump(*, mode: Literal['json', 'python'] | str = 'python', include: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, exclude: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, context: Any | None = None, by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, round_trip: bool = False, warnings: bool | Literal['none', 'warn', 'error'] = True, fallback: Callable[[Any], Any] | None = None, serialize_as_any: bool = False) dict[str, Any]
!!! abstract “Usage Documentation”

[model_dump](../concepts/serialization.md#modelmodel_dump)

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Parameters:
  • mode – The mode in which to_python should run. If mode is ‘json’, the output will only contain JSON serializable types. If mode is ‘python’, the output may contain non-JSON-serializable Python objects.

  • include – A set of fields to include in the output.

  • exclude – A set of fields to exclude from the output.

  • context – Additional context to pass to the serializer.

  • by_alias – Whether to use the field’s alias in the dictionary key if defined.

  • exclude_unset – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults – Whether to exclude fields that are set to their default value.

  • exclude_none – Whether to exclude fields that have a value of None.

  • round_trip – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any – Whether to serialize fields with duck-typing serialization behavior.

Returns:

A dictionary representation of the model.

model_dump_json(*, indent: int | None = None, include: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, exclude: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, context: Any | None = None, by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, round_trip: bool = False, warnings: bool | Literal['none', 'warn', 'error'] = True, fallback: Callable[[Any], Any] | None = None, serialize_as_any: bool = False) str
!!! abstract “Usage Documentation”

[model_dump_json](../concepts/serialization.md#modelmodel_dump_json)

Generates a JSON representation of the model using Pydantic’s to_json method.

Parameters:
  • indent – Indentation to use in the JSON output. If None is passed, the output will be compact.

  • include – Field(s) to include in the JSON output.

  • exclude – Field(s) to exclude from the JSON output.

  • context – Additional context to pass to the serializer.

  • by_alias – Whether to serialize using field aliases.

  • exclude_unset – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults – Whether to exclude fields that are set to their default value.

  • exclude_none – Whether to exclude fields that have a value of None.

  • round_trip – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any – Whether to serialize fields with duck-typing serialization behavior.

Returns:

A JSON string representation of the model.

classmethod model_validate(obj: Any, *, strict: bool | None = None, from_attributes: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate a pydantic model instance.

Parameters:
  • obj – The object to validate.

  • strict – Whether to enforce types strictly.

  • from_attributes – Whether to extract data from object attributes.

  • context – Additional context to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Raises:

ValidationError – If the object could not be validated.

Returns:

The validated model instance.

classmethod model_validate_json(json_data: str | bytes | bytearray, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self
!!! abstract “Usage Documentation”

[JSON Parsing](../concepts/json.md#json-parsing)

Validate the given JSON data against the Pydantic model.

Parameters:
  • json_data – The JSON data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Raises:

ValidationError – If json_data is not a JSON string or the object could not be validated.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

classmethod parse_file(path: str | Path, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self
classmethod parse_obj(obj: Any) Self
classmethod parse_raw(b: str | bytes, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self
pydantic model sungazer.models.grid.GridProfileGetResponse[source]

Bases: BaseModel

Response model for the Command=GridProfileGet API endpoint.

This model provides information about the currently active and pending grid profiles on the system, including their names, IDs, completion percentage, and support status.

Show JSON schema
{
   "title": "GridProfileGetResponse",
   "description": "Response model for the ``Command=GridProfileGet`` API endpoint.\n\nThis model provides information about the currently active and pending grid\nprofiles on the system, including their names, IDs, completion percentage,\nand support status.",
   "type": "object",
   "properties": {
      "result": {
         "examples": [
            "succeed"
         ],
         "title": "Result",
         "type": "string"
      },
      "active_name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            "IEEE-1547a-2014 + 2020 CA Rule21"
         ],
         "title": "Active Name"
      },
      "active_id": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            "816bf3302d337a42680b996227ddbc46abf9cd05"
         ],
         "title": "Active Id"
      },
      "pending_name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            "IEEE-1547a-2014 + 2020 CA Rule21"
         ],
         "title": "Pending Name"
      },
      "pending_id": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            "816bf3302d337a42680b996227ddbc46abf9cd05"
         ],
         "title": "Pending Id"
      },
      "percent": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            100
         ],
         "title": "Percent"
      },
      "supported_by": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            "ALL"
         ],
         "title": "Supported By"
      },
      "status": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            "success"
         ],
         "title": "Status"
      }
   },
   "required": [
      "result"
   ]
}

Fields:
field active_id: str | None = None

The unique identifier of the currently active grid profile.

field active_name: str | None = None

The name of the currently active grid profile.

field pending_id: str | None = None

The unique identifier of the pending grid profile (if any).

field pending_name: str | None = None

The name of the pending grid profile (if any).

field percent: int | None = None

Not sure what this is, but it’s always 100% for me

field result: str [Required]

The result status of the grid profile get operation.

field status: str | None = None

The overall status of the grid profile operation.

field supported_by: str | None = None

Indicates which components support the grid profile.

classmethod construct(_fields_set: set[str] | None = None, **values: Any) Self
classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

model_copy(*, update: Mapping[str, Any] | None = None, deep: bool = False) Self
!!! abstract “Usage Documentation”

[model_copy](../concepts/serialization.md#model_copy)

Returns a copy of the model.

!!! note

The underlying instance’s [__dict__][object.__dict__] attribute is copied. This might have unexpected side effects if you store anything in it, on top of the model fields (e.g. the value of [cached properties][functools.cached_property]).

Parameters:
  • update – Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data.

  • deep – Set to True to make a deep copy of the model.

Returns:

New model instance.

model_dump(*, mode: Literal['json', 'python'] | str = 'python', include: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, exclude: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, context: Any | None = None, by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, round_trip: bool = False, warnings: bool | Literal['none', 'warn', 'error'] = True, fallback: Callable[[Any], Any] | None = None, serialize_as_any: bool = False) dict[str, Any]
!!! abstract “Usage Documentation”

[model_dump](../concepts/serialization.md#modelmodel_dump)

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Parameters:
  • mode – The mode in which to_python should run. If mode is ‘json’, the output will only contain JSON serializable types. If mode is ‘python’, the output may contain non-JSON-serializable Python objects.

  • include – A set of fields to include in the output.

  • exclude – A set of fields to exclude from the output.

  • context – Additional context to pass to the serializer.

  • by_alias – Whether to use the field’s alias in the dictionary key if defined.

  • exclude_unset – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults – Whether to exclude fields that are set to their default value.

  • exclude_none – Whether to exclude fields that have a value of None.

  • round_trip – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any – Whether to serialize fields with duck-typing serialization behavior.

Returns:

A dictionary representation of the model.

model_dump_json(*, indent: int | None = None, include: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, exclude: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, context: Any | None = None, by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, round_trip: bool = False, warnings: bool | Literal['none', 'warn', 'error'] = True, fallback: Callable[[Any], Any] | None = None, serialize_as_any: bool = False) str
!!! abstract “Usage Documentation”

[model_dump_json](../concepts/serialization.md#modelmodel_dump_json)

Generates a JSON representation of the model using Pydantic’s to_json method.

Parameters:
  • indent – Indentation to use in the JSON output. If None is passed, the output will be compact.

  • include – Field(s) to include in the JSON output.

  • exclude – Field(s) to exclude from the JSON output.

  • context – Additional context to pass to the serializer.

  • by_alias – Whether to serialize using field aliases.

  • exclude_unset – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults – Whether to exclude fields that are set to their default value.

  • exclude_none – Whether to exclude fields that have a value of None.

  • round_trip – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any – Whether to serialize fields with duck-typing serialization behavior.

Returns:

A JSON string representation of the model.

classmethod model_validate(obj: Any, *, strict: bool | None = None, from_attributes: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate a pydantic model instance.

Parameters:
  • obj – The object to validate.

  • strict – Whether to enforce types strictly.

  • from_attributes – Whether to extract data from object attributes.

  • context – Additional context to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Raises:

ValidationError – If the object could not be validated.

Returns:

The validated model instance.

classmethod model_validate_json(json_data: str | bytes | bytearray, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self
!!! abstract “Usage Documentation”

[JSON Parsing](../concepts/json.md#json-parsing)

Validate the given JSON data against the Pydantic model.

Parameters:
  • json_data – The JSON data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Raises:

ValidationError – If json_data is not a JSON string or the object could not be validated.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

classmethod parse_file(path: str | Path, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self
classmethod parse_obj(obj: Any) Self
classmethod parse_raw(b: str | bytes, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self
pydantic model sungazer.models.grid.GridProfileRefreshResponse[source]

Bases: BaseModel

Response model for the Command=GridProfileRefresh API endpoint.

This model contains the result of a grid profile refresh operation, including success status, creation timestamp, and the list of available grid profiles that can be applied to the system.

Show JSON schema
{
   "title": "GridProfileRefreshResponse",
   "description": "Response model for the ``Command=GridProfileRefresh`` API endpoint.\n\nThis model contains the result of a grid profile refresh operation,\nincluding success status, creation timestamp, and the list of available\ngrid profiles that can be applied to the system.",
   "type": "object",
   "properties": {
      "result": {
         "examples": [
            "succeed"
         ],
         "title": "Result",
         "type": "string"
      },
      "success": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": true,
         "examples": [
            true
         ],
         "title": "Success"
      },
      "creation": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Creation"
      },
      "profiles": {
         "items": {
            "$ref": "#/$defs/GridProfile"
         },
         "title": "Profiles",
         "type": "array"
      }
   },
   "$defs": {
      "GridProfile": {
         "description": "Model representing a grid profile configuration option for the system.\n\nGrid profiles define how the solar system interacts with the utility grid,\nestablishing parameters for compliance with local utility regulations and\nrequirements. Each profile has a unique identifier, name, and may have\ngeographical applicability constraints expressed through ZIP code ranges.\n\nThe profile may also indicate special capabilities like self-supply\noperation, and whether it's the default profile for new installations.",
         "properties": {
            "default": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Default"
            },
            "filename": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  "8c9c4170.meta"
               ],
               "title": "Filename"
            },
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  "8c9c4170457c88f6dcee7216357681d580a3b9bd"
               ],
               "title": "Id"
            },
            "name": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  "HECO OMH R14H (Legacy)"
               ],
               "title": "Name"
            },
            "selfsupply": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Selfsupply"
            },
            "zipcodes": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Zipcode"
                     },
                     "type": "array"
                  },
                  {
                     "items": {
                        "type": "integer"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Zipcodes"
            }
         },
         "title": "GridProfile",
         "type": "object"
      },
      "Zipcode": {
         "description": "Model representing a range of ZIP codes for grid profile geographical\napplicability.\n\nThis model defines the minimum and maximum ZIP code values within which a\nparticular grid profile is valid. This is used to determine which grid\nprofiles are appropriate for a system based on its installation location.",
         "properties": {
            "max": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  96898
               ],
               "title": "Max"
            },
            "min": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  96701
               ],
               "title": "Min"
            }
         },
         "title": "Zipcode",
         "type": "object"
      }
   },
   "required": [
      "result"
   ]
}

Fields:
Validators:
field creation: datetime | None = None

Unix timestamp when the grid profile list was created or last updated.

Validated by:
field profiles: list[sungazer.models.grid.GridProfile] [Optional]

List of available grid profiles that can be applied to the system.

field result: str [Required]

The result status of the grid profile refresh operation.

field success: bool | None = True

Whether the grid profile refresh operation was successful.

classmethod construct(_fields_set: set[str] | None = None, **values: Any) Self
classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

model_copy(*, update: Mapping[str, Any] | None = None, deep: bool = False) Self
!!! abstract “Usage Documentation”

[model_copy](../concepts/serialization.md#model_copy)

Returns a copy of the model.

!!! note

The underlying instance’s [__dict__][object.__dict__] attribute is copied. This might have unexpected side effects if you store anything in it, on top of the model fields (e.g. the value of [cached properties][functools.cached_property]).

Parameters:
  • update – Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data.

  • deep – Set to True to make a deep copy of the model.

Returns:

New model instance.

model_dump(*, mode: Literal['json', 'python'] | str = 'python', include: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, exclude: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, context: Any | None = None, by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, round_trip: bool = False, warnings: bool | Literal['none', 'warn', 'error'] = True, fallback: Callable[[Any], Any] | None = None, serialize_as_any: bool = False) dict[str, Any]
!!! abstract “Usage Documentation”

[model_dump](../concepts/serialization.md#modelmodel_dump)

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Parameters:
  • mode – The mode in which to_python should run. If mode is ‘json’, the output will only contain JSON serializable types. If mode is ‘python’, the output may contain non-JSON-serializable Python objects.

  • include – A set of fields to include in the output.

  • exclude – A set of fields to exclude from the output.

  • context – Additional context to pass to the serializer.

  • by_alias – Whether to use the field’s alias in the dictionary key if defined.

  • exclude_unset – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults – Whether to exclude fields that are set to their default value.

  • exclude_none – Whether to exclude fields that have a value of None.

  • round_trip – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any – Whether to serialize fields with duck-typing serialization behavior.

Returns:

A dictionary representation of the model.

model_dump_json(*, indent: int | None = None, include: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, exclude: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, context: Any | None = None, by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, round_trip: bool = False, warnings: bool | Literal['none', 'warn', 'error'] = True, fallback: Callable[[Any], Any] | None = None, serialize_as_any: bool = False) str
!!! abstract “Usage Documentation”

[model_dump_json](../concepts/serialization.md#modelmodel_dump_json)

Generates a JSON representation of the model using Pydantic’s to_json method.

Parameters:
  • indent – Indentation to use in the JSON output. If None is passed, the output will be compact.

  • include – Field(s) to include in the JSON output.

  • exclude – Field(s) to exclude from the JSON output.

  • context – Additional context to pass to the serializer.

  • by_alias – Whether to serialize using field aliases.

  • exclude_unset – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults – Whether to exclude fields that are set to their default value.

  • exclude_none – Whether to exclude fields that have a value of None.

  • round_trip – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any – Whether to serialize fields with duck-typing serialization behavior.

Returns:

A JSON string representation of the model.

classmethod model_validate(obj: Any, *, strict: bool | None = None, from_attributes: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate a pydantic model instance.

Parameters:
  • obj – The object to validate.

  • strict – Whether to enforce types strictly.

  • from_attributes – Whether to extract data from object attributes.

  • context – Additional context to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Raises:

ValidationError – If the object could not be validated.

Returns:

The validated model instance.

classmethod model_validate_json(json_data: str | bytes | bytearray, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self
!!! abstract “Usage Documentation”

[JSON Parsing](../concepts/json.md#json-parsing)

Validate the given JSON data against the Pydantic model.

Parameters:
  • json_data – The JSON data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Raises:

ValidationError – If json_data is not a JSON string or the object could not be validated.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

validator parse_creation_timestamp  »  creation[source]

Convert Unix epoch timestamp to datetime object.

Handles various input formats:

  • Unix epoch timestamp as string (e.g., “1600704253”)

  • Unix epoch timestamp as integer (e.g., 1600704253)

  • Already parsed datetime objects

  • None values (returned as None)

Parameters:
  • v – The timestamp value to parse, can be a string, integer, datetime,

  • None. (or) –

Returns:

The parsed datetime object, or None if the input was None.

Raises:

ValueError – If the string/integer cannot be converted to a valid timestamp.

classmethod parse_file(path: str | Path, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self
classmethod parse_obj(obj: Any) Self
classmethod parse_raw(b: str | bytes, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self
pydantic model sungazer.models.grid.Zipcode[source]

Bases: BaseModel

Model representing a range of ZIP codes for grid profile geographical applicability.

This model defines the minimum and maximum ZIP code values within which a particular grid profile is valid. This is used to determine which grid profiles are appropriate for a system based on its installation location.

Show JSON schema
{
   "title": "Zipcode",
   "description": "Model representing a range of ZIP codes for grid profile geographical\napplicability.\n\nThis model defines the minimum and maximum ZIP code values within which a\nparticular grid profile is valid. This is used to determine which grid\nprofiles are appropriate for a system based on its installation location.",
   "type": "object",
   "properties": {
      "max": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            96898
         ],
         "title": "Max"
      },
      "min": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            96701
         ],
         "title": "Min"
      }
   }
}

Fields:
field max: float | None = None

The maximum ZIP code value in the range (inclusive).

field min: float | None = None

The minimum ZIP code value in the range (inclusive).

classmethod construct(_fields_set: set[str] | None = None, **values: Any) Self
classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

model_copy(*, update: Mapping[str, Any] | None = None, deep: bool = False) Self
!!! abstract “Usage Documentation”

[model_copy](../concepts/serialization.md#model_copy)

Returns a copy of the model.

!!! note

The underlying instance’s [__dict__][object.__dict__] attribute is copied. This might have unexpected side effects if you store anything in it, on top of the model fields (e.g. the value of [cached properties][functools.cached_property]).

Parameters:
  • update – Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data.

  • deep – Set to True to make a deep copy of the model.

Returns:

New model instance.

model_dump(*, mode: Literal['json', 'python'] | str = 'python', include: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, exclude: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, context: Any | None = None, by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, round_trip: bool = False, warnings: bool | Literal['none', 'warn', 'error'] = True, fallback: Callable[[Any], Any] | None = None, serialize_as_any: bool = False) dict[str, Any]
!!! abstract “Usage Documentation”

[model_dump](../concepts/serialization.md#modelmodel_dump)

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Parameters:
  • mode – The mode in which to_python should run. If mode is ‘json’, the output will only contain JSON serializable types. If mode is ‘python’, the output may contain non-JSON-serializable Python objects.

  • include – A set of fields to include in the output.

  • exclude – A set of fields to exclude from the output.

  • context – Additional context to pass to the serializer.

  • by_alias – Whether to use the field’s alias in the dictionary key if defined.

  • exclude_unset – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults – Whether to exclude fields that are set to their default value.

  • exclude_none – Whether to exclude fields that have a value of None.

  • round_trip – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any – Whether to serialize fields with duck-typing serialization behavior.

Returns:

A dictionary representation of the model.

model_dump_json(*, indent: int | None = None, include: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, exclude: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, context: Any | None = None, by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, round_trip: bool = False, warnings: bool | Literal['none', 'warn', 'error'] = True, fallback: Callable[[Any], Any] | None = None, serialize_as_any: bool = False) str
!!! abstract “Usage Documentation”

[model_dump_json](../concepts/serialization.md#modelmodel_dump_json)

Generates a JSON representation of the model using Pydantic’s to_json method.

Parameters:
  • indent – Indentation to use in the JSON output. If None is passed, the output will be compact.

  • include – Field(s) to include in the JSON output.

  • exclude – Field(s) to exclude from the JSON output.

  • context – Additional context to pass to the serializer.

  • by_alias – Whether to serialize using field aliases.

  • exclude_unset – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults – Whether to exclude fields that are set to their default value.

  • exclude_none – Whether to exclude fields that have a value of None.

  • round_trip – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any – Whether to serialize fields with duck-typing serialization behavior.

Returns:

A JSON string representation of the model.

classmethod model_validate(obj: Any, *, strict: bool | None = None, from_attributes: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate a pydantic model instance.

Parameters:
  • obj – The object to validate.

  • strict – Whether to enforce types strictly.

  • from_attributes – Whether to extract data from object attributes.

  • context – Additional context to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Raises:

ValidationError – If the object could not be validated.

Returns:

The validated model instance.

classmethod model_validate_json(json_data: str | bytes | bytearray, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self
!!! abstract “Usage Documentation”

[JSON Parsing](../concepts/json.md#json-parsing)

Validate the given JSON data against the Pydantic model.

Parameters:
  • json_data – The JSON data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Raises:

ValidationError – If json_data is not a JSON string or the object could not be validated.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

classmethod parse_file(path: str | Path, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self
classmethod parse_obj(obj: Any) Self
classmethod parse_raw(b: str | bytes, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self

Network

pydantic model sungazer.models.network.GetCommResponse[source]

Bases: BaseModel

Response model for the Command=Get_Comm API endpoint.

This model encapsulates information about all network interfaces in the system, the overall system connectivity status, and a timestamp for when the information was collected.

Show JSON schema
{
   "title": "GetCommResponse",
   "description": "Response model for the ``Command=Get_Comm`` API endpoint.\n\nThis model encapsulates information about all network interfaces in the system,\nthe overall system connectivity status, and a timestamp for when the information\nwas collected.",
   "type": "object",
   "properties": {
      "result": {
         "examples": [
            "success"
         ],
         "title": "Result",
         "type": "string"
      },
      "networkstatus": {
         "$ref": "#/$defs/NetworkStatus"
      }
   },
   "$defs": {
      "Interface": {
         "description": "Network interface model representing a communication interface in the system.\n\nThis model captures details about network interfaces such as WiFi, cellular,\nor Ethernet connections. It includes connectivity status, addressing information,\nand interface-specific details like signal strength and operational state.\n\nThis is part of the ``Command=Get_Comm`` response in :py:class:`GetCommResponse`.",
         "properties": {
            "ssid": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  "Laneakea"
               ],
               "title": "Ssid"
            },
            "status": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  "not registered"
               ],
               "title": "Status"
            },
            "pairing": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  "unpaired"
               ],
               "title": "Pairing"
            },
            "speed": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  5
               ],
               "title": "Speed"
            },
            "is_primary": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "this is the primary interface, only shows for cell interface",
               "examples": [
                  true
               ],
               "title": "Is Primary"
            },
            "is_always_on": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": false,
               "description": "this interface is always on, only shows for cell interface",
               "examples": [
                  true
               ],
               "title": "Is Always On"
            },
            "provider": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  "Verizon"
               ],
               "title": "Provider"
            },
            "sim": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  "SIM_READY"
               ],
               "title": "Sim"
            },
            "link": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  "connected"
               ],
               "title": "Link"
            },
            "interface": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  "wan"
               ],
               "title": "Interface"
            },
            "internet": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  "up"
               ],
               "title": "Internet"
            },
            "ipaddr": {
               "anyOf": [
                  {
                     "format": "ipv4",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  "192.168.0.125"
               ],
               "title": "Ipaddr"
            },
            "mode": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  "wan"
               ],
               "title": "Mode"
            },
            "modem": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  "MODEM_OK"
               ],
               "title": "Modem"
            },
            "sms": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  "reachable"
               ],
               "title": "Sms"
            },
            "state": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  "up"
               ],
               "title": "State"
            }
         },
         "title": "Interface",
         "type": "object"
      },
      "NetworkStatus": {
         "properties": {
            "interfaces": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Interface"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Interfaces"
            },
            "system": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/System"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "ts": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "the system timestamp",
               "examples": [
                  "1575501242"
               ],
               "title": "Ts"
            }
         },
         "title": "NetworkStatus",
         "type": "object"
      },
      "System": {
         "description": "System model representing overall system connectivity status.\n\nThis model provides a high-level view of the system's network connectivity,\nincluding internet access status and SMS communication capabilities.\n\nThis is part of the ``Command=Get_Comm`` response in :py:class:`GetCommResponse`.",
         "properties": {
            "interface": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "the name of an interface",
               "examples": [
                  "wan"
               ],
               "title": "Interface"
            },
            "internet": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "internet status",
               "examples": [
                  "up"
               ],
               "title": "Internet"
            },
            "sms": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "sms status",
               "examples": [
                  "reachable"
               ],
               "title": "Sms"
            }
         },
         "title": "System",
         "type": "object"
      }
   },
   "required": [
      "result",
      "networkstatus"
   ]
}

Fields:
field networkstatus: NetworkStatus [Required]
field result: str [Required]
classmethod construct(_fields_set: set[str] | None = None, **values: Any) Self
classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

model_copy(*, update: Mapping[str, Any] | None = None, deep: bool = False) Self
!!! abstract “Usage Documentation”

[model_copy](../concepts/serialization.md#model_copy)

Returns a copy of the model.

!!! note

The underlying instance’s [__dict__][object.__dict__] attribute is copied. This might have unexpected side effects if you store anything in it, on top of the model fields (e.g. the value of [cached properties][functools.cached_property]).

Parameters:
  • update – Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data.

  • deep – Set to True to make a deep copy of the model.

Returns:

New model instance.

model_dump(*, mode: Literal['json', 'python'] | str = 'python', include: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, exclude: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, context: Any | None = None, by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, round_trip: bool = False, warnings: bool | Literal['none', 'warn', 'error'] = True, fallback: Callable[[Any], Any] | None = None, serialize_as_any: bool = False) dict[str, Any]
!!! abstract “Usage Documentation”

[model_dump](../concepts/serialization.md#modelmodel_dump)

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Parameters:
  • mode – The mode in which to_python should run. If mode is ‘json’, the output will only contain JSON serializable types. If mode is ‘python’, the output may contain non-JSON-serializable Python objects.

  • include – A set of fields to include in the output.

  • exclude – A set of fields to exclude from the output.

  • context – Additional context to pass to the serializer.

  • by_alias – Whether to use the field’s alias in the dictionary key if defined.

  • exclude_unset – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults – Whether to exclude fields that are set to their default value.

  • exclude_none – Whether to exclude fields that have a value of None.

  • round_trip – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any – Whether to serialize fields with duck-typing serialization behavior.

Returns:

A dictionary representation of the model.

model_dump_json(*, indent: int | None = None, include: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, exclude: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, context: Any | None = None, by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, round_trip: bool = False, warnings: bool | Literal['none', 'warn', 'error'] = True, fallback: Callable[[Any], Any] | None = None, serialize_as_any: bool = False) str
!!! abstract “Usage Documentation”

[model_dump_json](../concepts/serialization.md#modelmodel_dump_json)

Generates a JSON representation of the model using Pydantic’s to_json method.

Parameters:
  • indent – Indentation to use in the JSON output. If None is passed, the output will be compact.

  • include – Field(s) to include in the JSON output.

  • exclude – Field(s) to exclude from the JSON output.

  • context – Additional context to pass to the serializer.

  • by_alias – Whether to serialize using field aliases.

  • exclude_unset – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults – Whether to exclude fields that are set to their default value.

  • exclude_none – Whether to exclude fields that have a value of None.

  • round_trip – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any – Whether to serialize fields with duck-typing serialization behavior.

Returns:

A JSON string representation of the model.

classmethod model_validate(obj: Any, *, strict: bool | None = None, from_attributes: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate a pydantic model instance.

Parameters:
  • obj – The object to validate.

  • strict – Whether to enforce types strictly.

  • from_attributes – Whether to extract data from object attributes.

  • context – Additional context to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Raises:

ValidationError – If the object could not be validated.

Returns:

The validated model instance.

classmethod model_validate_json(json_data: str | bytes | bytearray, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self
!!! abstract “Usage Documentation”

[JSON Parsing](../concepts/json.md#json-parsing)

Validate the given JSON data against the Pydantic model.

Parameters:
  • json_data – The JSON data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Raises:

ValidationError – If json_data is not a JSON string or the object could not be validated.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

classmethod parse_file(path: str | Path, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self
classmethod parse_obj(obj: Any) Self
classmethod parse_raw(b: str | bytes, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self
pydantic model sungazer.models.network.Interface[source]

Bases: BaseModel

Network interface model representing a communication interface in the system.

This model captures details about network interfaces such as WiFi, cellular, or Ethernet connections. It includes connectivity status, addressing information, and interface-specific details like signal strength and operational state.

This is part of the Command=Get_Comm response in GetCommResponse.

Show JSON schema
{
   "title": "Interface",
   "description": "Network interface model representing a communication interface in the system.\n\nThis model captures details about network interfaces such as WiFi, cellular,\nor Ethernet connections. It includes connectivity status, addressing information,\nand interface-specific details like signal strength and operational state.\n\nThis is part of the ``Command=Get_Comm`` response in :py:class:`GetCommResponse`.",
   "type": "object",
   "properties": {
      "ssid": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            "Laneakea"
         ],
         "title": "Ssid"
      },
      "status": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            "not registered"
         ],
         "title": "Status"
      },
      "pairing": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            "unpaired"
         ],
         "title": "Pairing"
      },
      "speed": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            5
         ],
         "title": "Speed"
      },
      "is_primary": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "this is the primary interface, only shows for cell interface",
         "examples": [
            true
         ],
         "title": "Is Primary"
      },
      "is_always_on": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": false,
         "description": "this interface is always on, only shows for cell interface",
         "examples": [
            true
         ],
         "title": "Is Always On"
      },
      "provider": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            "Verizon"
         ],
         "title": "Provider"
      },
      "sim": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            "SIM_READY"
         ],
         "title": "Sim"
      },
      "link": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            "connected"
         ],
         "title": "Link"
      },
      "interface": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            "wan"
         ],
         "title": "Interface"
      },
      "internet": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            "up"
         ],
         "title": "Internet"
      },
      "ipaddr": {
         "anyOf": [
            {
               "format": "ipv4",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            "192.168.0.125"
         ],
         "title": "Ipaddr"
      },
      "mode": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            "wan"
         ],
         "title": "Mode"
      },
      "modem": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            "MODEM_OK"
         ],
         "title": "Modem"
      },
      "sms": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            "reachable"
         ],
         "title": "Sms"
      },
      "state": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            "up"
         ],
         "title": "State"
      }
   }
}

Fields:
Validators:
field interface: str | None = None

The name of the interface.

field internet: str | None = None

If the interface is up or down

field ipaddr: IPv4Address | None = None

The IP address of the interface.

Validated by:
field is_always_on: bool | None = False

this interface is always on, only shows for cell interface

field is_primary: bool | None = None

this is the primary interface, only shows for cell interface

Whether the interface is connected

field mode: str | None = None

The mode of the interface, e.g. wan, lan, etc.

field modem: str | None = None

For cellular interfaces, whether the modem is ready

field pairing: str | None = None

If the interface is paired

field provider: str | None = None

Provider name for cellular interfaces

field sim: str | None = None

The SIM status for cellular interfaces

field sms: str | None = None

Whether SMS is reachable for cellular interfaces

field speed: int | None = None

The speed of the interface.

field ssid: str | None = None

The WiFi SSID.

field state: str | None = None

THe state of the interface, e.g. up, down, etc.

field status: str | None = None

The status of the interface.

classmethod construct(_fields_set: set[str] | None = None, **values: Any) Self
classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

model_copy(*, update: Mapping[str, Any] | None = None, deep: bool = False) Self
!!! abstract “Usage Documentation”

[model_copy](../concepts/serialization.md#model_copy)

Returns a copy of the model.

!!! note

The underlying instance’s [__dict__][object.__dict__] attribute is copied. This might have unexpected side effects if you store anything in it, on top of the model fields (e.g. the value of [cached properties][functools.cached_property]).

Parameters:
  • update – Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data.

  • deep – Set to True to make a deep copy of the model.

Returns:

New model instance.

model_dump(*, mode: Literal['json', 'python'] | str = 'python', include: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, exclude: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, context: Any | None = None, by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, round_trip: bool = False, warnings: bool | Literal['none', 'warn', 'error'] = True, fallback: Callable[[Any], Any] | None = None, serialize_as_any: bool = False) dict[str, Any]
!!! abstract “Usage Documentation”

[model_dump](../concepts/serialization.md#modelmodel_dump)

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Parameters:
  • mode – The mode in which to_python should run. If mode is ‘json’, the output will only contain JSON serializable types. If mode is ‘python’, the output may contain non-JSON-serializable Python objects.

  • include – A set of fields to include in the output.

  • exclude – A set of fields to exclude from the output.

  • context – Additional context to pass to the serializer.

  • by_alias – Whether to use the field’s alias in the dictionary key if defined.

  • exclude_unset – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults – Whether to exclude fields that are set to their default value.

  • exclude_none – Whether to exclude fields that have a value of None.

  • round_trip – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any – Whether to serialize fields with duck-typing serialization behavior.

Returns:

A dictionary representation of the model.

model_dump_json(*, indent: int | None = None, include: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, exclude: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, context: Any | None = None, by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, round_trip: bool = False, warnings: bool | Literal['none', 'warn', 'error'] = True, fallback: Callable[[Any], Any] | None = None, serialize_as_any: bool = False) str
!!! abstract “Usage Documentation”

[model_dump_json](../concepts/serialization.md#modelmodel_dump_json)

Generates a JSON representation of the model using Pydantic’s to_json method.

Parameters:
  • indent – Indentation to use in the JSON output. If None is passed, the output will be compact.

  • include – Field(s) to include in the JSON output.

  • exclude – Field(s) to exclude from the JSON output.

  • context – Additional context to pass to the serializer.

  • by_alias – Whether to serialize using field aliases.

  • exclude_unset – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults – Whether to exclude fields that are set to their default value.

  • exclude_none – Whether to exclude fields that have a value of None.

  • round_trip – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any – Whether to serialize fields with duck-typing serialization behavior.

Returns:

A JSON string representation of the model.

classmethod model_validate(obj: Any, *, strict: bool | None = None, from_attributes: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate a pydantic model instance.

Parameters:
  • obj – The object to validate.

  • strict – Whether to enforce types strictly.

  • from_attributes – Whether to extract data from object attributes.

  • context – Additional context to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Raises:

ValidationError – If the object could not be validated.

Returns:

The validated model instance.

classmethod model_validate_json(json_data: str | bytes | bytearray, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self
!!! abstract “Usage Documentation”

[JSON Parsing](../concepts/json.md#json-parsing)

Validate the given JSON data against the Pydantic model.

Parameters:
  • json_data – The JSON data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Raises:

ValidationError – If json_data is not a JSON string or the object could not be validated.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

classmethod parse_file(path: str | Path, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self
validator parse_ipaddr  »  ipaddr[source]

Convert string values to IPv4Address objects.

Handles various input formats:

  • Valid IPv4 address strings (e.g., “192.168.1.1”)

  • Empty strings (converted to None)

  • None values (returned as None)

  • Already parsed IPv4Address objects

Parameters:

v – The IP address value to parse, can be a string, IPv4Address, or None.

Returns:

The parsed IPv4Address object, or None if the input was empty/None.

Raises:

ValueError – If the string cannot be converted to a valid IPv4 address.

classmethod parse_obj(obj: Any) Self
classmethod parse_raw(b: str | bytes, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self
pydantic model sungazer.models.network.NetworkStatus[source]

Bases: BaseModel

Show JSON schema
{
   "title": "NetworkStatus",
   "type": "object",
   "properties": {
      "interfaces": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/Interface"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Interfaces"
      },
      "system": {
         "anyOf": [
            {
               "$ref": "#/$defs/System"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      },
      "ts": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "the system timestamp",
         "examples": [
            "1575501242"
         ],
         "title": "Ts"
      }
   },
   "$defs": {
      "Interface": {
         "description": "Network interface model representing a communication interface in the system.\n\nThis model captures details about network interfaces such as WiFi, cellular,\nor Ethernet connections. It includes connectivity status, addressing information,\nand interface-specific details like signal strength and operational state.\n\nThis is part of the ``Command=Get_Comm`` response in :py:class:`GetCommResponse`.",
         "properties": {
            "ssid": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  "Laneakea"
               ],
               "title": "Ssid"
            },
            "status": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  "not registered"
               ],
               "title": "Status"
            },
            "pairing": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  "unpaired"
               ],
               "title": "Pairing"
            },
            "speed": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  5
               ],
               "title": "Speed"
            },
            "is_primary": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "this is the primary interface, only shows for cell interface",
               "examples": [
                  true
               ],
               "title": "Is Primary"
            },
            "is_always_on": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": false,
               "description": "this interface is always on, only shows for cell interface",
               "examples": [
                  true
               ],
               "title": "Is Always On"
            },
            "provider": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  "Verizon"
               ],
               "title": "Provider"
            },
            "sim": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  "SIM_READY"
               ],
               "title": "Sim"
            },
            "link": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  "connected"
               ],
               "title": "Link"
            },
            "interface": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  "wan"
               ],
               "title": "Interface"
            },
            "internet": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  "up"
               ],
               "title": "Internet"
            },
            "ipaddr": {
               "anyOf": [
                  {
                     "format": "ipv4",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  "192.168.0.125"
               ],
               "title": "Ipaddr"
            },
            "mode": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  "wan"
               ],
               "title": "Mode"
            },
            "modem": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  "MODEM_OK"
               ],
               "title": "Modem"
            },
            "sms": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  "reachable"
               ],
               "title": "Sms"
            },
            "state": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  "up"
               ],
               "title": "State"
            }
         },
         "title": "Interface",
         "type": "object"
      },
      "System": {
         "description": "System model representing overall system connectivity status.\n\nThis model provides a high-level view of the system's network connectivity,\nincluding internet access status and SMS communication capabilities.\n\nThis is part of the ``Command=Get_Comm`` response in :py:class:`GetCommResponse`.",
         "properties": {
            "interface": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "the name of an interface",
               "examples": [
                  "wan"
               ],
               "title": "Interface"
            },
            "internet": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "internet status",
               "examples": [
                  "up"
               ],
               "title": "Internet"
            },
            "sms": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "sms status",
               "examples": [
                  "reachable"
               ],
               "title": "Sms"
            }
         },
         "title": "System",
         "type": "object"
      }
   }
}

Fields:
field interfaces: list[sungazer.models.network.Interface] | None = None

The list of network interfaces.

field system: System | None = None

The system information.

field ts: str | None = None

the system timestamp

classmethod construct(_fields_set: set[str] | None = None, **values: Any) Self
classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

model_copy(*, update: Mapping[str, Any] | None = None, deep: bool = False) Self
!!! abstract “Usage Documentation”

[model_copy](../concepts/serialization.md#model_copy)

Returns a copy of the model.

!!! note

The underlying instance’s [__dict__][object.__dict__] attribute is copied. This might have unexpected side effects if you store anything in it, on top of the model fields (e.g. the value of [cached properties][functools.cached_property]).

Parameters:
  • update – Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data.

  • deep – Set to True to make a deep copy of the model.

Returns:

New model instance.

model_dump(*, mode: Literal['json', 'python'] | str = 'python', include: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, exclude: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, context: Any | None = None, by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, round_trip: bool = False, warnings: bool | Literal['none', 'warn', 'error'] = True, fallback: Callable[[Any], Any] | None = None, serialize_as_any: bool = False) dict[str, Any]
!!! abstract “Usage Documentation”

[model_dump](../concepts/serialization.md#modelmodel_dump)

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Parameters:
  • mode – The mode in which to_python should run. If mode is ‘json’, the output will only contain JSON serializable types. If mode is ‘python’, the output may contain non-JSON-serializable Python objects.

  • include – A set of fields to include in the output.

  • exclude – A set of fields to exclude from the output.

  • context – Additional context to pass to the serializer.

  • by_alias – Whether to use the field’s alias in the dictionary key if defined.

  • exclude_unset – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults – Whether to exclude fields that are set to their default value.

  • exclude_none – Whether to exclude fields that have a value of None.

  • round_trip – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any – Whether to serialize fields with duck-typing serialization behavior.

Returns:

A dictionary representation of the model.

model_dump_json(*, indent: int | None = None, include: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, exclude: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, context: Any | None = None, by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, round_trip: bool = False, warnings: bool | Literal['none', 'warn', 'error'] = True, fallback: Callable[[Any], Any] | None = None, serialize_as_any: bool = False) str
!!! abstract “Usage Documentation”

[model_dump_json](../concepts/serialization.md#modelmodel_dump_json)

Generates a JSON representation of the model using Pydantic’s to_json method.

Parameters:
  • indent – Indentation to use in the JSON output. If None is passed, the output will be compact.

  • include – Field(s) to include in the JSON output.

  • exclude – Field(s) to exclude from the JSON output.

  • context – Additional context to pass to the serializer.

  • by_alias – Whether to serialize using field aliases.

  • exclude_unset – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults – Whether to exclude fields that are set to their default value.

  • exclude_none – Whether to exclude fields that have a value of None.

  • round_trip – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any – Whether to serialize fields with duck-typing serialization behavior.

Returns:

A JSON string representation of the model.

classmethod model_validate(obj: Any, *, strict: bool | None = None, from_attributes: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate a pydantic model instance.

Parameters:
  • obj – The object to validate.

  • strict – Whether to enforce types strictly.

  • from_attributes – Whether to extract data from object attributes.

  • context – Additional context to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Raises:

ValidationError – If the object could not be validated.

Returns:

The validated model instance.

classmethod model_validate_json(json_data: str | bytes | bytearray, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self
!!! abstract “Usage Documentation”

[JSON Parsing](../concepts/json.md#json-parsing)

Validate the given JSON data against the Pydantic model.

Parameters:
  • json_data – The JSON data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Raises:

ValidationError – If json_data is not a JSON string or the object could not be validated.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

classmethod parse_file(path: str | Path, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self
classmethod parse_obj(obj: Any) Self
classmethod parse_raw(b: str | bytes, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self
pydantic model sungazer.models.network.System[source]

Bases: BaseModel

System model representing overall system connectivity status.

This model provides a high-level view of the system’s network connectivity, including internet access status and SMS communication capabilities.

This is part of the Command=Get_Comm response in GetCommResponse.

Show JSON schema
{
   "title": "System",
   "description": "System model representing overall system connectivity status.\n\nThis model provides a high-level view of the system's network connectivity,\nincluding internet access status and SMS communication capabilities.\n\nThis is part of the ``Command=Get_Comm`` response in :py:class:`GetCommResponse`.",
   "type": "object",
   "properties": {
      "interface": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "the name of an interface",
         "examples": [
            "wan"
         ],
         "title": "Interface"
      },
      "internet": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "internet status",
         "examples": [
            "up"
         ],
         "title": "Internet"
      },
      "sms": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "sms status",
         "examples": [
            "reachable"
         ],
         "title": "Sms"
      }
   }
}

Fields:
field interface: str | None = None

the name of an interface

field internet: str | None = None

internet status

field sms: str | None = None

sms status

classmethod construct(_fields_set: set[str] | None = None, **values: Any) Self
classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

model_copy(*, update: Mapping[str, Any] | None = None, deep: bool = False) Self
!!! abstract “Usage Documentation”

[model_copy](../concepts/serialization.md#model_copy)

Returns a copy of the model.

!!! note

The underlying instance’s [__dict__][object.__dict__] attribute is copied. This might have unexpected side effects if you store anything in it, on top of the model fields (e.g. the value of [cached properties][functools.cached_property]).

Parameters:
  • update – Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data.

  • deep – Set to True to make a deep copy of the model.

Returns:

New model instance.

model_dump(*, mode: Literal['json', 'python'] | str = 'python', include: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, exclude: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, context: Any | None = None, by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, round_trip: bool = False, warnings: bool | Literal['none', 'warn', 'error'] = True, fallback: Callable[[Any], Any] | None = None, serialize_as_any: bool = False) dict[str, Any]
!!! abstract “Usage Documentation”

[model_dump](../concepts/serialization.md#modelmodel_dump)

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Parameters:
  • mode – The mode in which to_python should run. If mode is ‘json’, the output will only contain JSON serializable types. If mode is ‘python’, the output may contain non-JSON-serializable Python objects.

  • include – A set of fields to include in the output.

  • exclude – A set of fields to exclude from the output.

  • context – Additional context to pass to the serializer.

  • by_alias – Whether to use the field’s alias in the dictionary key if defined.

  • exclude_unset – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults – Whether to exclude fields that are set to their default value.

  • exclude_none – Whether to exclude fields that have a value of None.

  • round_trip – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any – Whether to serialize fields with duck-typing serialization behavior.

Returns:

A dictionary representation of the model.

model_dump_json(*, indent: int | None = None, include: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, exclude: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, context: Any | None = None, by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, round_trip: bool = False, warnings: bool | Literal['none', 'warn', 'error'] = True, fallback: Callable[[Any], Any] | None = None, serialize_as_any: bool = False) str
!!! abstract “Usage Documentation”

[model_dump_json](../concepts/serialization.md#modelmodel_dump_json)

Generates a JSON representation of the model using Pydantic’s to_json method.

Parameters:
  • indent – Indentation to use in the JSON output. If None is passed, the output will be compact.

  • include – Field(s) to include in the JSON output.

  • exclude – Field(s) to exclude from the JSON output.

  • context – Additional context to pass to the serializer.

  • by_alias – Whether to serialize using field aliases.

  • exclude_unset – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults – Whether to exclude fields that are set to their default value.

  • exclude_none – Whether to exclude fields that have a value of None.

  • round_trip – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any – Whether to serialize fields with duck-typing serialization behavior.

Returns:

A JSON string representation of the model.

classmethod model_validate(obj: Any, *, strict: bool | None = None, from_attributes: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate a pydantic model instance.

Parameters:
  • obj – The object to validate.

  • strict – Whether to enforce types strictly.

  • from_attributes – Whether to extract data from object attributes.

  • context – Additional context to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Raises:

ValidationError – If the object could not be validated.

Returns:

The validated model instance.

classmethod model_validate_json(json_data: str | bytes | bytearray, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self
!!! abstract “Usage Documentation”

[JSON Parsing](../concepts/json.md#json-parsing)

Validate the given JSON data against the Pydantic model.

Parameters:
  • json_data – The JSON data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Raises:

ValidationError – If json_data is not a JSON string or the object could not be validated.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

classmethod parse_file(path: str | Path, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self
classmethod parse_obj(obj: Any) Self
classmethod parse_raw(b: str | bytes, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self

Session

pydantic model sungazer.models.session.StartResponse[source]

Bases: BaseModel

Response model for the Command=Start API endpoint.

This model contains detailed version information about the device hardware, firmware, and software components. It serves as an initial response when establishing a session with the device.

Show JSON schema
{
   "title": "StartResponse",
   "description": "Response model for the ``Command=Start`` API endpoint.\n\nThis model contains detailed version information about the device hardware,\nfirmware, and software components. It serves as an initial response when\nestablishing a session with the device.",
   "type": "object",
   "properties": {
      "result": {
         "examples": [
            "success"
         ],
         "title": "Result",
         "type": "string"
      },
      "supervisor": {
         "$ref": "#/$defs/Supervisor"
      }
   },
   "$defs": {
      "Supervisor": {
         "description": "Details about the supervisor, the PVS6 device\n\nThis model contains detailed version information about the device hardware,\nfirmware, and software components. It serves as an initial response when\nestablishing a session with the device.",
         "properties": {
            "SWVER": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  "2019.11, Build 5000"
               ],
               "title": "Swver"
            },
            "SERIAL": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  "ZT184585000549A0069"
               ],
               "title": "Serial"
            },
            "MODEL": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  "PVS6"
               ],
               "title": "Model"
            },
            "FWVER": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  "1.0.0"
               ],
               "title": "Fwver"
            },
            "SCVER": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  16504
               ],
               "title": "Scver"
            },
            "EASICVER": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  67072
               ],
               "title": "Easicver"
            },
            "SCBUILD": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  1185
               ],
               "title": "Scbuild"
            },
            "WNMODEL": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  400
               ],
               "title": "Wnmodel"
            },
            "WNVER": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  3000
               ],
               "title": "Wnver"
            },
            "WNSERIAL": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  16
               ],
               "title": "Wnserial"
            },
            "BUILD": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  5000
               ],
               "title": "Build"
            }
         },
         "title": "Supervisor",
         "type": "object"
      }
   },
   "required": [
      "result",
      "supervisor"
   ]
}

Fields:
field result: str [Required]
field supervisor: Supervisor [Required]
classmethod construct(_fields_set: set[str] | None = None, **values: Any) Self
classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

model_copy(*, update: Mapping[str, Any] | None = None, deep: bool = False) Self
!!! abstract “Usage Documentation”

[model_copy](../concepts/serialization.md#model_copy)

Returns a copy of the model.

!!! note

The underlying instance’s [__dict__][object.__dict__] attribute is copied. This might have unexpected side effects if you store anything in it, on top of the model fields (e.g. the value of [cached properties][functools.cached_property]).

Parameters:
  • update – Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data.

  • deep – Set to True to make a deep copy of the model.

Returns:

New model instance.

model_dump(*, mode: Literal['json', 'python'] | str = 'python', include: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, exclude: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, context: Any | None = None, by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, round_trip: bool = False, warnings: bool | Literal['none', 'warn', 'error'] = True, fallback: Callable[[Any], Any] | None = None, serialize_as_any: bool = False) dict[str, Any]
!!! abstract “Usage Documentation”

[model_dump](../concepts/serialization.md#modelmodel_dump)

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Parameters:
  • mode – The mode in which to_python should run. If mode is ‘json’, the output will only contain JSON serializable types. If mode is ‘python’, the output may contain non-JSON-serializable Python objects.

  • include – A set of fields to include in the output.

  • exclude – A set of fields to exclude from the output.

  • context – Additional context to pass to the serializer.

  • by_alias – Whether to use the field’s alias in the dictionary key if defined.

  • exclude_unset – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults – Whether to exclude fields that are set to their default value.

  • exclude_none – Whether to exclude fields that have a value of None.

  • round_trip – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any – Whether to serialize fields with duck-typing serialization behavior.

Returns:

A dictionary representation of the model.

model_dump_json(*, indent: int | None = None, include: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, exclude: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, context: Any | None = None, by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, round_trip: bool = False, warnings: bool | Literal['none', 'warn', 'error'] = True, fallback: Callable[[Any], Any] | None = None, serialize_as_any: bool = False) str
!!! abstract “Usage Documentation”

[model_dump_json](../concepts/serialization.md#modelmodel_dump_json)

Generates a JSON representation of the model using Pydantic’s to_json method.

Parameters:
  • indent – Indentation to use in the JSON output. If None is passed, the output will be compact.

  • include – Field(s) to include in the JSON output.

  • exclude – Field(s) to exclude from the JSON output.

  • context – Additional context to pass to the serializer.

  • by_alias – Whether to serialize using field aliases.

  • exclude_unset – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults – Whether to exclude fields that are set to their default value.

  • exclude_none – Whether to exclude fields that have a value of None.

  • round_trip – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any – Whether to serialize fields with duck-typing serialization behavior.

Returns:

A JSON string representation of the model.

classmethod model_validate(obj: Any, *, strict: bool | None = None, from_attributes: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate a pydantic model instance.

Parameters:
  • obj – The object to validate.

  • strict – Whether to enforce types strictly.

  • from_attributes – Whether to extract data from object attributes.

  • context – Additional context to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Raises:

ValidationError – If the object could not be validated.

Returns:

The validated model instance.

classmethod model_validate_json(json_data: str | bytes | bytearray, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self
!!! abstract “Usage Documentation”

[JSON Parsing](../concepts/json.md#json-parsing)

Validate the given JSON data against the Pydantic model.

Parameters:
  • json_data – The JSON data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Raises:

ValidationError – If json_data is not a JSON string or the object could not be validated.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

classmethod parse_file(path: str | Path, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self
classmethod parse_obj(obj: Any) Self
classmethod parse_raw(b: str | bytes, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self
pydantic model sungazer.models.session.StopResponse[source]

Bases: BaseModel

Response model for the Command=Stop API endpoint.

This model confirms the successful termination of a session with the device, providing a result status to indicate the outcome of the operation.

Show JSON schema
{
   "title": "StopResponse",
   "description": "Response model for the ``Command=Stop`` API endpoint.\n\nThis model confirms the successful termination of a session with the device,\nproviding a result status to indicate the outcome of the operation.",
   "type": "object",
   "properties": {
      "result": {
         "examples": [
            "success"
         ],
         "title": "Result",
         "type": "string"
      }
   },
   "required": [
      "result"
   ]
}

Fields:
field result: str [Required]

The result

classmethod construct(_fields_set: set[str] | None = None, **values: Any) Self
classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

model_copy(*, update: Mapping[str, Any] | None = None, deep: bool = False) Self
!!! abstract “Usage Documentation”

[model_copy](../concepts/serialization.md#model_copy)

Returns a copy of the model.

!!! note

The underlying instance’s [__dict__][object.__dict__] attribute is copied. This might have unexpected side effects if you store anything in it, on top of the model fields (e.g. the value of [cached properties][functools.cached_property]).

Parameters:
  • update – Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data.

  • deep – Set to True to make a deep copy of the model.

Returns:

New model instance.

model_dump(*, mode: Literal['json', 'python'] | str = 'python', include: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, exclude: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, context: Any | None = None, by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, round_trip: bool = False, warnings: bool | Literal['none', 'warn', 'error'] = True, fallback: Callable[[Any], Any] | None = None, serialize_as_any: bool = False) dict[str, Any]
!!! abstract “Usage Documentation”

[model_dump](../concepts/serialization.md#modelmodel_dump)

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Parameters:
  • mode – The mode in which to_python should run. If mode is ‘json’, the output will only contain JSON serializable types. If mode is ‘python’, the output may contain non-JSON-serializable Python objects.

  • include – A set of fields to include in the output.

  • exclude – A set of fields to exclude from the output.

  • context – Additional context to pass to the serializer.

  • by_alias – Whether to use the field’s alias in the dictionary key if defined.

  • exclude_unset – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults – Whether to exclude fields that are set to their default value.

  • exclude_none – Whether to exclude fields that have a value of None.

  • round_trip – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any – Whether to serialize fields with duck-typing serialization behavior.

Returns:

A dictionary representation of the model.

model_dump_json(*, indent: int | None = None, include: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, exclude: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, context: Any | None = None, by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, round_trip: bool = False, warnings: bool | Literal['none', 'warn', 'error'] = True, fallback: Callable[[Any], Any] | None = None, serialize_as_any: bool = False) str
!!! abstract “Usage Documentation”

[model_dump_json](../concepts/serialization.md#modelmodel_dump_json)

Generates a JSON representation of the model using Pydantic’s to_json method.

Parameters:
  • indent – Indentation to use in the JSON output. If None is passed, the output will be compact.

  • include – Field(s) to include in the JSON output.

  • exclude – Field(s) to exclude from the JSON output.

  • context – Additional context to pass to the serializer.

  • by_alias – Whether to serialize using field aliases.

  • exclude_unset – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults – Whether to exclude fields that are set to their default value.

  • exclude_none – Whether to exclude fields that have a value of None.

  • round_trip – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any – Whether to serialize fields with duck-typing serialization behavior.

Returns:

A JSON string representation of the model.

classmethod model_validate(obj: Any, *, strict: bool | None = None, from_attributes: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate a pydantic model instance.

Parameters:
  • obj – The object to validate.

  • strict – Whether to enforce types strictly.

  • from_attributes – Whether to extract data from object attributes.

  • context – Additional context to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Raises:

ValidationError – If the object could not be validated.

Returns:

The validated model instance.

classmethod model_validate_json(json_data: str | bytes | bytearray, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self
!!! abstract “Usage Documentation”

[JSON Parsing](../concepts/json.md#json-parsing)

Validate the given JSON data against the Pydantic model.

Parameters:
  • json_data – The JSON data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Raises:

ValidationError – If json_data is not a JSON string or the object could not be validated.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

classmethod parse_file(path: str | Path, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self
classmethod parse_obj(obj: Any) Self
classmethod parse_raw(b: str | bytes, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self
pydantic model sungazer.models.session.Supervisor[source]

Bases: BaseModel

Details about the supervisor, the PVS6 device

This model contains detailed version information about the device hardware, firmware, and software components. It serves as an initial response when establishing a session with the device.

Show JSON schema
{
   "title": "Supervisor",
   "description": "Details about the supervisor, the PVS6 device\n\nThis model contains detailed version information about the device hardware,\nfirmware, and software components. It serves as an initial response when\nestablishing a session with the device.",
   "type": "object",
   "properties": {
      "SWVER": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            "2019.11, Build 5000"
         ],
         "title": "Swver"
      },
      "SERIAL": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            "ZT184585000549A0069"
         ],
         "title": "Serial"
      },
      "MODEL": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            "PVS6"
         ],
         "title": "Model"
      },
      "FWVER": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            "1.0.0"
         ],
         "title": "Fwver"
      },
      "SCVER": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            16504
         ],
         "title": "Scver"
      },
      "EASICVER": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            67072
         ],
         "title": "Easicver"
      },
      "SCBUILD": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            1185
         ],
         "title": "Scbuild"
      },
      "WNMODEL": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            400
         ],
         "title": "Wnmodel"
      },
      "WNVER": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            3000
         ],
         "title": "Wnver"
      },
      "WNSERIAL": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            16
         ],
         "title": "Wnserial"
      },
      "BUILD": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            5000
         ],
         "title": "Build"
      }
   }
}

Fields:
field BUILD: int | None = None

Build number of the software.

field EASICVER: int | None = None

EASIC version number.

field FWVER: str | None = None

The firmware version.

field MODEL: str | None = None

The hardware model.

field SCBUILD: int | None = None

Software build number (how does this differ from BUILD?)

field SCVER: int | None = None

The software version (how does this differ from SWVER?)

field SERIAL: str | None = None

The serial number of the device.

field SWVER: str | None = None

Software version.

field WNMODEL: int | None = None

Wireless network model identifier.

field WNSERIAL: int | None = None

Wireless network serial number.

field WNVER: int | None = None

Wireless network version number.

classmethod construct(_fields_set: set[str] | None = None, **values: Any) Self
classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

model_copy(*, update: Mapping[str, Any] | None = None, deep: bool = False) Self
!!! abstract “Usage Documentation”

[model_copy](../concepts/serialization.md#model_copy)

Returns a copy of the model.

!!! note

The underlying instance’s [__dict__][object.__dict__] attribute is copied. This might have unexpected side effects if you store anything in it, on top of the model fields (e.g. the value of [cached properties][functools.cached_property]).

Parameters:
  • update – Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data.

  • deep – Set to True to make a deep copy of the model.

Returns:

New model instance.

model_dump(*, mode: Literal['json', 'python'] | str = 'python', include: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, exclude: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, context: Any | None = None, by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, round_trip: bool = False, warnings: bool | Literal['none', 'warn', 'error'] = True, fallback: Callable[[Any], Any] | None = None, serialize_as_any: bool = False) dict[str, Any]
!!! abstract “Usage Documentation”

[model_dump](../concepts/serialization.md#modelmodel_dump)

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Parameters:
  • mode – The mode in which to_python should run. If mode is ‘json’, the output will only contain JSON serializable types. If mode is ‘python’, the output may contain non-JSON-serializable Python objects.

  • include – A set of fields to include in the output.

  • exclude – A set of fields to exclude from the output.

  • context – Additional context to pass to the serializer.

  • by_alias – Whether to use the field’s alias in the dictionary key if defined.

  • exclude_unset – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults – Whether to exclude fields that are set to their default value.

  • exclude_none – Whether to exclude fields that have a value of None.

  • round_trip – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any – Whether to serialize fields with duck-typing serialization behavior.

Returns:

A dictionary representation of the model.

model_dump_json(*, indent: int | None = None, include: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, exclude: set[int] | set[str] | Mapping[int, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | Mapping[str, set[int] | set[str] | Mapping[int, IncEx | bool] | Mapping[str, IncEx | bool] | bool] | None = None, context: Any | None = None, by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, round_trip: bool = False, warnings: bool | Literal['none', 'warn', 'error'] = True, fallback: Callable[[Any], Any] | None = None, serialize_as_any: bool = False) str
!!! abstract “Usage Documentation”

[model_dump_json](../concepts/serialization.md#modelmodel_dump_json)

Generates a JSON representation of the model using Pydantic’s to_json method.

Parameters:
  • indent – Indentation to use in the JSON output. If None is passed, the output will be compact.

  • include – Field(s) to include in the JSON output.

  • exclude – Field(s) to exclude from the JSON output.

  • context – Additional context to pass to the serializer.

  • by_alias – Whether to serialize using field aliases.

  • exclude_unset – Whether to exclude fields that have not been explicitly set.

  • exclude_defaults – Whether to exclude fields that are set to their default value.

  • exclude_none – Whether to exclude fields that have a value of None.

  • round_trip – If True, dumped values should be valid as input for non-idempotent types such as Json[T].

  • warnings – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].

  • fallback – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.

  • serialize_as_any – Whether to serialize fields with duck-typing serialization behavior.

Returns:

A JSON string representation of the model.

classmethod model_validate(obj: Any, *, strict: bool | None = None, from_attributes: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate a pydantic model instance.

Parameters:
  • obj – The object to validate.

  • strict – Whether to enforce types strictly.

  • from_attributes – Whether to extract data from object attributes.

  • context – Additional context to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Raises:

ValidationError – If the object could not be validated.

Returns:

The validated model instance.

classmethod model_validate_json(json_data: str | bytes | bytearray, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self
!!! abstract “Usage Documentation”

[JSON Parsing](../concepts/json.md#json-parsing)

Validate the given JSON data against the Pydantic model.

Parameters:
  • json_data – The JSON data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

Raises:

ValidationError – If json_data is not a JSON string or the object could not be validated.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

classmethod parse_file(path: str | Path, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self
classmethod parse_obj(obj: Any) Self
classmethod parse_raw(b: str | bytes, *, content_type: str | None = None, encoding: str = 'utf8', proto: DeprecatedParseProtocol | None = None, allow_pickle: bool = False) Self