MIX devices are Growatt hybrid inverters with battery storage. This method configures the system time for AC discharge operations, which controls when the battery can discharge to power AC loads or export to the grid.
Method Signature
Parameters
The unique identifier of the plant containing the MIX device. Note: This parameter is prefixed with underscore as it’s required by the API but not directly used in the current implementation.
The serial number of the MIX device. This uniquely identifies the specific hybrid inverter you want to configure.
Returns
Returns aResult<serde_json::Value> containing the response from the device configuration endpoint, or a GrowattError if the request fails.
Errors
GrowattError::NotLoggedIn- If the client is not authenticatedGrowattError::InvalidResponse- If the response is empty or malformedGrowattError::RequestError- If the HTTP request fails
Example
Implementation Details
The method automatically captures the current system time usingchrono::Local::now() and formats it as YYYY-MM-DD HH:MM:SS. This timestamp is sent to the device as part of the configuration request.
API Endpoint
action: “mixSet”serialNum: The MIX device serial numbertype: “pf_sys_year”param1: Current timestamp inYYYY-MM-DD HH:MM:SSformat