Overview
Retrieves fault logs for a specific device at a plant. This method allows you to query device errors and warnings with filtering options by date, device type, and fault type.get_plant_fault_logs() is an alias method that calls get_fault_logs() with identical parameters. Both methods can be used interchangeably.Method Signature
Parameters
The unique identifier of the plant. This parameter cannot be empty.
The date for which to retrieve fault logs in
YYYY-MM-DD format. If None is provided, the current date will be used automatically.The serial number of the device to query. Can be an empty string to query all devices.
The page number for paginated results. Use
1 for the first page.Device type identifier. See the Device Flag Values section below for valid values.
Type of fault to filter by. See the Fault Type Values section below for valid values.
Returns
Returns aResult<serde_json::Value> containing the fault log data on success, or a GrowattError on failure.
Errors
This method may return the following errors:GrowattError::InvalidResponse- If the plant ID is empty, or if the response is empty or nullGrowattError::NetworkError- If there is a network communication errorGrowattError::AuthenticationError- If the session has expired or authentication failed
Device Flag Values
The
device_flag parameter specifies the type of device to query:0- All devices1- Inverter2- Storage (Battery)3- MAX (AC coupled storage)4- MIX (Hybrid inverter)5- SPA (Smart Plug)6- Environmental sensor
Fault Type Values
The
fault_type parameter specifies the severity or category of faults:0- All fault types1- Errors only2- Warnings only3- Information messages
Example
Query All Devices
To query fault logs for all devices in a plant, pass an empty string fordevice_sn and 0 for device_flag:
Pagination
Fault logs are returned in paginated format. To retrieve subsequent pages, increment thepage_num parameter:
This method automatically checks if you are logged in before making the request. If the session has expired, you will need to call
login() again.