Skip to main content
MIX devices are Growatt hybrid inverters that combine solar power generation with battery storage capabilities. The MIX serial number (mix_sn) uniquely identifies each device in your solar installation.
Retrieves comprehensive total data for a specific MIX device, including cumulative energy production, consumption, and battery statistics.

Method Signature

pub async fn get_mix_total(
    &mut self,
    plant_id: &str,
    mix_sn: &str
) -> Result<serde_json::Value>

Parameters

plant_id
&str
required
The unique identifier of the plant containing the MIX device. You can retrieve plant IDs using the get_plant_list() method.
mix_sn
&str
required
The serial number of the MIX device. This is a unique identifier for the specific hybrid inverter you want to query.

Returns

Returns a Result<serde_json::Value> containing the total data for the MIX device, or a GrowattError if the request fails.

Errors

  • GrowattError::NotLoggedIn - If the client is not authenticated
  • GrowattError::InvalidResponse - If the response is empty or malformed
  • GrowattError::RequestError - If the HTTP request fails

Example

use growatt_api::GrowattApi;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let mut api = GrowattApi::new();
    
    // Login first
    api.login("username", "password").await?;
    
    // Get MIX total data
    let mix_data = api.get_mix_total("123456", "ABC1234567").await?;
    
    println!("MIX Total Data: {:#?}", mix_data);
    
    Ok(())
}

API Endpoint

POST /panel/mix/getMIXTotalData?plantId={plant_id}
The method sends a form-encoded POST request with the MIX serial number.

Build docs developers (and LLMs) love