Method Signature
Parameters
The unique identifier of the plant to retrieve devices from
The page number to retrieve. If
None is provided, defaults to page 1.Returns
Type:Result<serde_json::Value>
Returns a JSON value containing paginated device information. The response typically includes:
- Array of device objects with detailed information
- Device serial numbers, types, and status
- Performance metrics and statistics
- Pagination metadata (total pages, total count)
Errors
This method can return the following errors:GrowattError::NotLoggedIn- User is not authenticatedGrowattError::RequestError- HTTP request failedGrowattError::InvalidResponse- Empty response or invalid structureGrowattError::JsonError- Failed to parse JSON response
Example
Example: Iterate Through All Pages
API Endpoint
POST/panel/getDevicesByPlantList
Form Parameters:
plantId- The plant identifiercurrPage- Current page number (string representation)
Notes
This method automatically handles session management. If the session has expired, it will attempt to re-authenticate using stored credentials before making the request.
Pagination Support: This method accepts an optional page number parameter. When retrieving devices from plants with many devices, iterate through pages until an empty result is returned. The page parameter defaults to 1 if not specified.
The
curr_page parameter is converted to a string internally before being sent to the API, as the Growatt API expects string values in form parameters.