### Login and Get Plant List Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/shinephone.md Demonstrates how to log in using username and password and then retrieve a list of Growatt plants associated with the user ID. Ensure you have the 'growattServer' library installed. ```python import growattServer api = growattServer.GrowattApi() login_response = api.login(, ) # Get a list of growatt plants. print(api.plant_list(login_response['user']['id'])) ``` -------------------------------- ### device.detail() Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/openapiv1/devices/sph.md Get detailed data and settings for an SPH hybrid inverter. ```APIDOC ## device.detail() ### Description Get detailed data and settings for an SPH hybrid inverter. ### Method None ### Endpoint None ### Parameters None ### Request Example None ### Response #### Success Response (200) - **data** (object) - Detailed data and settings for the SPH inverter. #### Response Example ```json { "data": { ... } } ``` ``` -------------------------------- ### Initialize Growatt API with Default User-Agent Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/shinephone.md Use this method to initialize the Growatt API with the default User-Agent string. This is the standard way to start using the library. ```python api = growattServer.GrowattApi() # The default way to initialise ``` -------------------------------- ### api.sph_detail Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/openapiv1.md Get detailed data and settings for an SPH hybrid inverter. ```APIDOC ## api.sph_detail(device_sn) ### Description Get detailed data and settings for an SPH hybrid inverter. ### Method Not specified (assumed to be a Python method call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * **device_sn** (String) - Required - The serial number of the SPH device. ``` -------------------------------- ### Get Detailed Data for MIN Inverter Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/openapiv1.md Fetch detailed information for a MIN inverter by providing its serial number. ```python api.min_detail(device_sn) ``` -------------------------------- ### device.energy() Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/openapiv1/devices/sph.md Get current energy data for an SPH inverter, including power and energy values. ```APIDOC ## device.energy() ### Description Get current energy data for an SPH inverter, including power and energy values. ### Method None ### Endpoint None ### Parameters None ### Request Example None ### Response #### Success Response (200) - **data** (object) - Current energy data including power and energy values. #### Response Example ```json { "data": { ... } } ``` ``` -------------------------------- ### Get Settings for MIN Inverter Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/openapiv1.md Retrieve all current settings for a MIN inverter using its serial number. ```python api.min_settings(device_sn) ``` -------------------------------- ### device.energy_history(start_date, end_date, timezone, page, limit) Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/openapiv1/devices/sph.md Get energy history data for an SPH inverter (7-day max range). ```APIDOC ## device.energy_history(start_date, end_date, timezone, page, limit) ### Description Get energy history data for an SPH inverter. This method supports a maximum range of 7 days. ### Method None ### Endpoint None ### Parameters #### Query Parameters - **start_date** (Date) - Optional - The start date for the history data. - **end_date** (Date) - Optional - The end date for the history data. - **timezone** (String) - Optional - The timezone for the data. - **page** (Int) - Optional - The page number for pagination. - **limit** (Int) - Optional - The number of records per page. ### Request Example None ### Response #### Success Response (200) - **data** (object) - Energy history data. #### Response Example ```json { "data": { ... } } ``` ``` -------------------------------- ### api.sph_energy_history Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/openapiv1.md Get energy history data for an SPH inverter (7-day max range). ```APIDOC ## api.sph_energy_history(device_sn, start_date=None, end_date=None, timezone=None, page=None, limit=None) ### Description Get energy history data for an SPH inverter (7-day max range). ### Method Not specified (assumed to be a Python method call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * **device_sn** (String) - Required - The serial number of the SPH device. * **start_date** (Date) - Optional - The start date for the history data. * **end_date** (Date) - Optional - The end date for the history data. * **timezone** (String) - Optional - The timezone for the data. * **page** (Int) - Optional - The page number for pagination. * **limit** (Int) - Optional - The number of records per page. ``` -------------------------------- ### Get Energy History for MIN Inverter Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/openapiv1.md Retrieve historical energy data for a MIN inverter. The range is limited to 7 days. Optional parameters for date range, timezone, page, and limit can be provided. ```python api.min_energy_history(device_sn, start_date=None, end_date=None, timezone=None, page=None, limit=None) ``` -------------------------------- ### Read Specific Parameter for MIN Inverter Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/openapiv1.md Read a specific setting or parameter from a MIN inverter. Requires the device serial number and the parameter ID. Optional start and end addresses can be specified. ```python api.min_read_parameter(device_sn, parameter_id, start_address=None, end_address=None) ``` -------------------------------- ### Get Energy Data for MIN Inverter Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/openapiv1.md Retrieve current energy data for a MIN inverter using its serial number. This includes power and energy values. ```python api.min_energy(device_sn) ``` -------------------------------- ### Get Device Class Dynamically Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/openapiv1/devices.md If the device type is unknown, use the api.get_device() method with the device serial number and device type ID. This method returns the correct device class instance if found, allowing you to call standard device methods. ```python import growattServer api = growattServer.OpenApiV1(token="YOUR_API_TOKEN") device = api.get_device(device_sn, device_type) if device is not None: device.detail() device.energy() device.energy_history() device.read_parameter() device.write_parameter() ``` -------------------------------- ### device.settings() Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/openapiv1/devices/min.md Retrieves all settings for a Min inverter. ```APIDOC ## device.settings() ### Description Get all settings for a min inverter. ### Method None (Assumed to be a method call within a library) ### Endpoint N/A ### Parameters None ### Request Example N/A ### Response #### Success Response - **settings** (object) - An object containing all configurable settings for the inverter. #### Response Example ```json { "settings": { "grid_export_limit": 5000, "battery_charge_limit": 4500 } } ``` ``` -------------------------------- ### api.sph_energy Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/openapiv1.md Get current energy data for an SPH inverter. ```APIDOC ## api.sph_energy(device_sn) ### Description Get current energy data for an SPH inverter, including power and energy values. ### Method Not specified (assumed to be a Python method call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * **device_sn** (String) - Required - The serial number of the SPH device. ``` -------------------------------- ### Initialize OpenAPI V1 Client Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/openapiv1.md Instantiate the OpenAPI V1 client with your API token. This is the first step to interact with the Growatt API. ```python import growattServer api = growattServer.OpenApiV1(token="YOUR_API_TOKEN") # Get a list of growatt plants. plants = api.plant_list_v1() print(plants) ``` -------------------------------- ### Instantiate and Use Specific Device Class Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/openapiv1/devices.md Instantiate a specific device class (e.g., Sph or Min) with your API token and device serial number. Then call methods like detail(), energy(), energy_history(), read_parameter(), and write_parameter(). ```python import growattServer from growattServer.open_api_v1.devices import Sph, Min api = growattServer.OpenApiV1(token="YOUR_API_TOKEN") device = Sph(api, 'YOUR_DEVICE_SERIAL_NUMBER') # or Min(api, 'YOUR_DEVICE_SERIAL_NUMBER') device.detail() device.energy() device.energy_history() device.read_parameter() device.write_parameter() ``` -------------------------------- ### device.detail() Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/openapiv1/devices/min.md Retrieves detailed data for a Min inverter. ```APIDOC ## device.detail() ### Description Get detailed data for a min inverter. ### Method None (Assumed to be a method call within a library) ### Endpoint N/A ### Parameters None ### Request Example N/A ### Response #### Success Response - **detailed_data** (object) - Object containing detailed information about the inverter. #### Response Example ```json { "detailed_data": { "serial_number": "SN12345", "model": "MIN-TLX-5000", "firmware_version": "v1.2.3" } } ``` ``` -------------------------------- ### Initialize GrowattApiV1 Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/openapiv1.md Initialize the Growatt API client with your API token. Ensure you use the correct server URL based on your account registration region. ```python api = growattServer.GrowattApiV1(token="YOUR_API_TOKEN") # Initialize with your API token ``` -------------------------------- ### Interact with Devices using Generic Device Objects Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/openapiv1.md Use generic device objects like Sph or Min to interact with your devices. This approach avoids repeatedly specifying the device serial number for each call. ```python import growattServer from growattServer.open_api_v1.devices import Sph, Min api = growattServer.OpenApiV1(token="YOUR_API_TOKEN") my_inverter = Sph(api, 'YOUR_DEVICE_SERIAL_NUMBER') # or Min(api, 'YOUR_DEVICE_SERIAL_NUMBER') my_inverter.detail() my_inverter.energy() my_inverter.energy_history() my_inverter.read_parameter() my_inverter.write_parameter() ``` -------------------------------- ### api.tlx_get_all_settings Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/shinephone.md Retrieves all possible settings for the TLX type inverter. ```APIDOC ## api.tlx_get_all_settings(tlx_id) ### Description Gets all possible settings for the tlx type inverter. ### Arguments - **tlx_id** (String) - The ID of the TLX inverter. ``` -------------------------------- ### api.storage_energy_overview Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/shinephone.md Retrieves the 'Generation overview' information for a plant and storage device. ```APIDOC ## api.storage_energy_overview(plant_id, storage_id) ### Description Gets the information you see in the "Generation overview". ### Arguments - **plant_id** (String) - The ID of the plant. - **storage_id** (String) - The ID of the storage device. ``` -------------------------------- ### Generic Plant Methods Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/openapiv1.md These methods provide generic access to plant information and energy data, applicable across different device types. ```APIDOC ## Generic Plant Methods ### Description Methods that work across all device types for managing plants and retrieving energy data. ### Methods - **api.plant_list()** - **Description**: Get a list of plants registered to your account. - **Arguments**: None - **api.plant_details(plant_id)** - **Description**: Get detailed information about a power station. - **Arguments**: - plant_id (String): The ID of the plant. - **api.plant_energy_overview(plant_id)** - **Description**: Get energy overview data for a plant. - **Arguments**: - plant_id (String): The ID of the plant. - **api.plant_energy_history(plant_id, start_date, end_date, time_unit, page, perpage)** - **Description**: Get historical energy data for a plant for multiple days/months/years. - **Arguments**: - plant_id (String): The ID of the plant. - start_date (Date): The start date for the historical data. - end_date (Date): The end date for the historical data. - time_unit (String): The unit of time for the data (e.g., day, month, year). - page (Int): The page number for pagination. - perpage (Int): The number of items per page. - **api.device_list(plant_id)** - **Description**: Get a list of devices in specified plant. - **Arguments**: - plant_id (String): The ID of the plant. ``` -------------------------------- ### Device Methods Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/openapiv1/devices.md Provides access to core device functionalities like retrieving energy data, details, history, and managing parameters. ```APIDOC ## Device Methods ### Description These are the core methods available for interacting with any device through the OpenAPI V1. ### Methods - **`device.energy()`** - **Description**: Get current energy data for any inverter, including power and energy values. - **Arguments**: None - **`device.detail()`** - **Description**: Get detailed data for any inverter. - **Arguments**: None - **`device.energy_history(start_date=None, end_date=None, timezone=None, page=None, limit=None)`** - **Description**: Get energy history data for any inverter (7-day max range). - **Arguments**: - `start_date` (Date) - Optional - The start date for the history data. - `end_date` (Date) - Optional - The end date for the history data. - `timezone` (String) - Optional - The timezone for the data. - `page` (Int) - Optional - The page number for pagination. - `limit` (Int) - Optional - The number of results per page. - **`device.read_parameter(parameter_id, start_address=None, end_address=None)`** - **Description**: Read a specific setting for any inverter. - **Arguments**: - `parameter_id` (String) - Required - The ID of the parameter to read. - `start_address` (Int) - Optional - The starting address for reading parameters. - `end_address` (Int) - Optional - The ending address for reading parameters. - **`device.write_parameter(parameter_id, parameter_values)`** - **Description**: Set parameters on any inverter. Parameter values can be a single value, a list, or a dictionary. - **Arguments**: - `parameter_id` (String) - Required - The ID of the parameter to set. - `parameter_values` (Dict/Array) - Required - The values to set for the parameter. ``` -------------------------------- ### Generic Device Methods Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/openapiv1.md These methods offer a generic way to interact with devices using the V1 API, abstracting away the need for device serial numbers in many cases. ```APIDOC ## Generic Device Methods ### Description Devices offer a generic way to interact with your device using the V1 API without needing to provide your S/N every time. And can be used instead of the more specific device methods in the API class. ### Methods - **device.energy()** - **Description**: Get current energy data for any inverter, including power and energy values. - **Arguments**: None - **device.detail()** - **Description**: Get detailed data for any inverter. - **Arguments**: None - **device.energy_history(start_date=None, end_date=None, timezone=None, page=None, limit=None)** - **Description**: Get energy history data for any inverter (7-day max range). - **Arguments**: - start_date (Date): The start date for the historical data. - end_date (Date): The end date for the historical data. - timezone (String): The timezone for the data. - page (Int): The page number for pagination. - limit (Int): The number of items per page. - **device.read_parameter(parameter_id, start_address=None, end_address=None)** - **Description**: Read a specific setting for any inverter. - **Arguments**: - parameter_id (String): The ID of the parameter to read. - start_address (Int): The starting address for reading parameters. - end_address (Int): The ending address for reading parameters. - **device.write_parameter(parameter_id, parameter_values)** - **Description**: Set parameters on any inverter. Parameter values can be a single value, a list, or a dictionary. - **Arguments**: - parameter_id (String): The ID of the parameter to write. - parameter_values (Dict/Array): The values to set for the parameter. ``` -------------------------------- ### Update Time Segment for MIN Inverter Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/openapiv1.md Update a specific time segment for a MIN inverter's battery mode and schedule. Requires device serial number, segment ID, battery mode, start time, and end time. The segment can also be enabled or disabled. ```python api.min_write_time_segment(device_sn, segment_id, batt_mode, start_time, end_time, enabled=True) ``` -------------------------------- ### Initialize Growatt API with Random User ID Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/shinephone.md Initialize the Growatt API and append a randomly generated User ID to the default User-Agent string. This can help in scenarios where servers might require a more dynamic User-Agent. ```python api = growattServer.GrowattApi(True) # Adds a randomly generated User ID to the default User-Agent ``` -------------------------------- ### Initialize Growatt API with Custom User-Agent Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/shinephone.md Initialize the Growatt API by completely overriding the default User-Agent string with a custom value. Use this when you need full control over the User-Agent header. ```python api = growattServer.GrowattApi(False, "my_user_agent_value") # Overrides the default and uses "my_user_agent_value" in the User-Agent header ``` -------------------------------- ### api.plant_settings Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/shinephone.md Retrieves the current settings for a specified plant. ```APIDOC ## api.plant_settings(plant_id) ### Description Gets the current settings for the specified plant. See: [details](./shinephone/plant_settings.md) ### Arguments - **plant_id** (String) - The ID of the plant. ``` -------------------------------- ### api.tlx_energy_overview Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/shinephone.md Retrieves the energy overview for a TLX inverter within a specified plant. ```APIDOC ## api.tlx_energy_overview(plant_id, tlx_id) ### Description Gets energy overview of the system. ### Arguments - **plant_id** (String) - The ID of the plant. - **tlx_id** (String) - The ID of the TLX inverter. ``` -------------------------------- ### MIN Device Methods Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/openapiv1.md Specific methods for interacting with MIN type inverters, covering energy data, details, history, settings, and parameter manipulation. ```APIDOC ## MIN Device Methods ### Description Methods specifically designed for MIN devices (type 7), providing granular control and data retrieval. ### Methods - **api.min_energy(device_sn)** - **Description**: Get current energy data for a min inverter, including power and energy values. - **Arguments**: - device_sn (String): The serial number of the MIN device. - **api.min_detail(device_sn)** - **Description**: Get detailed data for a min inverter. - **Arguments**: - device_sn (String): The serial number of the MIN device. - **api.min_energy_history(device_sn, start_date=None, end_date=None, timezone=None, page=None, limit=None)** - **Description**: Get energy history data for a min inverter (7-day max range). - **Arguments**: - device_sn (String): The serial number of the MIN device. - start_date (Date): The start date for the historical data. - end_date (Date): The end date for the historical data. - timezone (String): The timezone for the data. - page (Int): The page number for pagination. - limit (Int): The number of items per page. - **api.min_settings(device_sn)** - **Description**: Get all settings for a min inverter. - **Arguments**: - device_sn (String): The serial number of the MIN device. - **api.min_read_parameter(device_sn, parameter_id, start_address=None, end_address=None)** - **Description**: Read a specific setting for a min inverter. - **Arguments**: - device_sn (String): The serial number of the MIN device. - parameter_id (String): The ID of the parameter to read. - start_address (Int): The starting address for reading parameters. - end_address (Int): The ending address for reading parameters. - **api.min_write_parameter(device_sn, parameter_id, parameter_values)** - **Description**: Set parameters on a min inverter. Parameter values can be a single value, a list, or a dictionary. - **Arguments**: - device_sn (String): The serial number of the MIN device. - parameter_id (String): The ID of the parameter to write. - parameter_values (Dict/Array): The values to set for the parameter. - **api.min_write_time_segment(device_sn, segment_id, batt_mode, start_time, end_time, enabled=True)** - **Description**: Update a specific time segment for a min inverter. - **Arguments**: - device_sn (String): The serial number of the MIN device. - segment_id (Int): The ID of the time segment to update. - batt_mode (Int): The battery mode (0=load priority, 1=battery priority, 2=grid priority). - start_time (datetime.time): The start time for the segment. - end_time (datetime.time): The end time for the segment. - enabled (Bool): Whether the time segment is enabled. - **api.min_read_time_segments(device_sn, settings_data=None)** - **Description**: Read all time segments from a MIN inverter. Optionally pass settings_data to avoid redundant API calls. - **Arguments**: - device_sn (String): The serial number of the MIN device. - settings_data (Dict): Optional pre-fetched settings data. ``` -------------------------------- ### api.device_list Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/shinephone.md Retrieves a list of devices within a specified plant. ```APIDOC ## api.device_list(plant_id) ### Description Gets a list of devices in specified plant. ### Arguments - **plant_id** (String) - The ID of the plant. ``` -------------------------------- ### device.energy() Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/openapiv1/devices/min.md Retrieves the current energy data for a Min inverter, including power and energy values. ```APIDOC ## device.energy() ### Description Get current energy data for a min inverter, including power and energy values. ### Method None (Assumed to be a method call within a library) ### Endpoint N/A ### Parameters None ### Request Example N/A ### Response #### Success Response - **power** (float) - Current power value. - **energy** (float) - Current energy value. #### Response Example ```json { "power": 1500.5, "energy": 12345.6 } ``` ``` -------------------------------- ### device.write_parameter(parameter_id, parameter_values) Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/openapiv1/devices/min.md Sets parameters on a Min inverter. The parameter values can be a single value, a list, or a dictionary. Refer to external details for parameter IDs. ```APIDOC ## device.write_parameter(parameter_id, parameter_values) ### Description Set parameters on a min inverter. Parameter values can be a single value, a list, or a dictionary. see: [details](../min_tlx_settings.md) ### Method None (Assumed to be a method call within a library) ### Endpoint N/A ### Parameters #### Request Body - **parameter_id** (String) - Required - The unique identifier for the setting parameter. - **parameter_values** (Dict/Array/String/Int) - Required - The value(s) to set for the parameter. Can be a single value, a list, or a dictionary. ### Request Example ```json { "parameter_id": "BATTERY_CHARGE_LIMIT", "parameter_values": 4500 } ``` ### Response #### Success Response (200) - **status** (String) - Indicates success or failure of the operation. #### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### api.mix_info Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/shinephone.md Retrieves high-level information about the Mix system, including daily and overall totals. The `plant_id` is optional. ```APIDOC ## api.mix_info(mix_id, plant_id=None) ### Description Gets high-level information about the Mix system, including daily and overall totals. ### Arguments - **mix_id** (String) - The ID of the Mix system. - **plant_id** (String, optional) - The ID of the plant. ``` -------------------------------- ### api.tlx_get_enabled_settings Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/shinephone.md Retrieves all enabled settings for the TLX type inverter. ```APIDOC ## api.tlx_get_enabled_settings(tlx_id) ### Description Gets all enabled settings for the tlx type inverter. ### Arguments - **tlx_id** (String) - The ID of the TLX inverter. ``` -------------------------------- ### Read All Settings Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/openapiv1/sph_settings.md Retrieves all device data and settings for a specified SPH device using its serial number. ```APIDOC ## Read All Settings ### Description Retrieves all device data and settings for a specified SPH device. ### Method `api.sph_detail` ### Parameters #### Path Parameters - **device_sn** (string) - Required - The device serial number. ### Returns Dict containing all device data and settings. #### Response Body - **serialNum** (String) - Serial Number - **portName** (String) - Communication port information Communication port type and address - **dataLogSn** (String) - DataLog serial number - **groupId** (int) - Inverter group - **alias** (String) - Alias - **location** (String) - Location - **addr** (int) - Inverter address - **fwVersion** (String) - Firmware version - **model** (long) - Model - **innerVersion** (String) - Internal version number - **lost** (boolean) - Whether communication is lost - **status** (int) - Mix Status 0: waiting mode, 1: self-check mode, 3: failure mode, 4: upgrading, 5, 6, 7, 8: normal mode - **tcpServerIp** (String) - TCP server IP address - **lastUpdateTime** (Date) - Last update time - **sysTime** (Calendar) - System Time - **deviceType** (int) - 0: Mix6k, 1: Mix4-10k - **communicationVersion** (String) - Communication version number - **onOff** (int) - Switch machine - **pmax** (int) - Rated power - **vnormal** (float) - Rated PV voltage - **lcdLanguage** (int) - LCD language - **countrySelected** (int) - Country selection - **wselectBaudrate** (int) - Baud rate selection - **comAddress** (int) - Mailing address - **manufacturer** (String) - Manufacturer Code - **dtc** (int) - Device code - **modbusVersion** (int) - MODBUS version - **floatChargeCurrentLimit** (float) - Float charge current limit - **vbatWarning** (float) - Low battery voltage alarm point - **vbatWarnClr** (float) - Low battery voltage recovery point - **vbatStopForDischarge** (float) - Battery discharge stop voltage - **vbatStopForCharge** (float) - Battery charging stop voltage - **vbatStartForDischarge** (float) - Lower limit of battery discharge voltage - **vbatStartforCharge** (float) - Battery charging upper limit voltage - **batTempLowerLimitD** (float) - Lower limit of battery discharge temperature - **batTempUpperLimitD** (float) - Upper limit of battery discharge temperature - **batTempLowerLimitC** (float) - Lower limit of battery charging temperature - **batTempUpperLimitC** (float) - Upper limit of battery charging temperature - **forcedDischargeTimeStart1** (String) - Discharge 1 start time - **forcedDischargeTimeStart2** (String) - Discharge 2 start time - **forcedDischargeTimeStart3** (String) - Discharge 3 start time - **forcedDischargeTimeStop1** (String) - Discharge 1 stop time - **forcedDischargeTimeStop2** (String) - Discharge 2 stop time - **forcedDischargeTimeStop3** (String) - Discharge 3 stop time - **forcedChargeTimeStart1** (String) - Charge 1 start time - **forcedChargeTimeStart2** (String) - Charge 2 start time - **forcedChargeTimeStart3** (String) - Charge 3 start time - **forcedChargeTimeStop1** (String) - Charge 1 stop time - **forcedChargeTimeStop2** (String) - Charge 2 stop time - **forcedChargeTimeStop3** (String) - Charge 3 stop time - **bctMode** (int) - Sensor type (2:METER;1:cWirelessCT;0:cWiredCT) - **bctAdjust** (int) - Sensor adjustment enable - **wdisChargeSOCLowLimit1** (int) - Discharge in load priority mode - **wdisChargeSOCLowLimit2** (int) - Grid priority mode discharge - **wchargeSOCLowLimit1** (int) - Load priority mode charging - **wchargeSOCLowLimit2** (int) - Battery priority mode charging - **acChargeEnable** (int) - AC charging enable - **priorityChoose** (int) - Energy priority selection - **chargePowerCommand** (int) - Charging power setting - **disChargePowerCommand** (int) - Discharge power setting - **bagingTestStep** (int) - Battery self-test - **batteryType** (int) - Battery type selection - **epsFunEn** (int) - Emergency power enable - **epsVoltSet** (int) - Emergency power supply voltage - **epsFreqSet** (int) - Emergency power frequency - **forcedDischargeStopSwitch1** (int) - Discharge 1 enable bit - **forcedDischargeStopSwitch2** (int) - Discharge 2 enable bit - **forcedDischargeStopSwitch3** (int) - Discharge 3 enable bit - **forcedChargeStopSwitch1** (int) - Charge 1 enable bit - **forcedChargeStopSwitch2** (int) - Charge 2 enable bit - **forcedChargeStopSwitch3** (int) - Charge 3 enable bit - **voltageHighLimit** (float) - Mains voltage upper limit - **voltageLowLimit** (float) - Mains voltage lower limit - **buckUpsFunEn** (int) - Off-grid enable - **uspFreqSet** (int) - Off-grid frequency - **buckUPSVoltSet** (int) - Off-grid voltage - **pvPfCmdMemoryState** (int) - Does the inverter store the following commands - **activeRate** (int) - Active power - **reactiveRate** (int) - Reactive power - **underExcited** (int) - Capacitive or Perceptual - **exportLimit** (int) - Backflow prevention enable - **exportLimitPowerRate** (float) - Backflow prevention - **powerFactor** (float) - PF value - **pv_on_off** (String) - Switch - **pf_sys_year** (String) - Set time - **pv_grid_voltage_high** (String) - Mains voltage upper limit - **pv_grid_voltage_low** (String) - Mains voltage lower limit - **mix_off_grid_enable** (String) - Off-grid enable ``` -------------------------------- ### device.write_parameter(parameter_id, parameter_values) Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/openapiv1/devices/sph.md Set parameters on an SPH inverter. ```APIDOC ## device.write_parameter(parameter_id, parameter_values) ### Description Set parameters on an SPH inverter. ### Method None ### Endpoint None ### Parameters #### Request Body - **parameter_id** (String) - Required - The ID of the parameter to set. - **parameter_values** (Dict/Array) - Required - The values to set for the parameter. ### Request Example ```json { "parameter_id": "some_parameter", "parameter_values": { ... } } ``` ### Response #### Success Response (200) - **success** (Boolean) - Indicates if the operation was successful. #### Response Example ```json { "success": true } ``` ``` -------------------------------- ### api.classic_inverter_info Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/shinephone.md Retrieves information for a classic inverter by scraping its settings page. This method returns a dictionary containing details such as on/off status, model, firmware version, and serial number. ```APIDOC ## api.classic_inverter_info ### Description Get classic inverter information (including on/off status) by scraping the inverter settings page. ### Parameters - **device_sn** (String) - Required - The serial number of the classic inverter. ### Returns A dict with fields like `onOff`, `deviceModel`, `status`, `fwVersion`, `sn`, `alias`, etc. ### Note This works by parsing HTML, not a JSON API. ``` -------------------------------- ### api.plant_info Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/shinephone.md Retrieves information for a specified plant. ```APIDOC ## api.plant_info(plant_id) ### Description Gets info for specified plant. ### Arguments - **plant_id** (String) - The ID of the plant. ``` -------------------------------- ### device.read_parameter(parameter_id, start_address, end_address) Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/openapiv1/devices/min.md Reads a specific setting for a Min inverter using its parameter ID and optional address range. Refer to external details for parameter IDs. ```APIDOC ## device.read_parameter(parameter_id, start_address, end_address) ### Description Read a specific setting for a min inverter. see: [details](../min_tlx_settings.md) ### Method None (Assumed to be a method call within a library) ### Endpoint N/A ### Parameters #### Query Parameters - **parameter_id** (String) - Required - The unique identifier for the setting parameter. - **start_address** (Int) - Optional - The starting address for reading the parameter (if applicable). - **end_address** (Int) - Optional - The ending address for reading the parameter (if applicable). ### Request Example ```json { "parameter_id": "GRID_EXPORT_LIMIT", "start_address": 0, "end_address": 1 } ``` ### Response #### Success Response - **parameter_value** (String/Int/Dict/Array) - The value(s) of the requested parameter. #### Response Example ```json { "parameter_value": 5000 } ``` ``` -------------------------------- ### api.login Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/shinephone.md Logs into the Growatt API. This must be done before making any request. The response should be captured to obtain the `userId` variable. This method should not be used for public v1 APIs. ```APIDOC ## api.login(username, password) ### Description Logs into the Growatt API. This must be done before making any request. The response should be captured to obtain the `userId` variable. This method should not be used for public v1 APIs. ### Arguments - **username** (String) - The username for login. - **password** (String) - The password for login. ``` -------------------------------- ### api.mix_system_status Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/shinephone.md Retrieves instantaneous values for the Mix system, such as current import/export, generation, and charging rates. ```APIDOC ## api.mix_system_status(mix_id, plant_id) ### Description Gets instantaneous values for Mix system, e.g., current import/export, generation, charging rates, etc. ### Arguments - **mix_id** (String) - The ID of the Mix system. - **plant_id** (String) - The ID of the plant. ``` -------------------------------- ### api.storage_detail Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/shinephone.md Retrieves detailed data for a storage (battery) device. ```APIDOC ## api.storage_detail(storage_id) ### Description Gets detailed data on storage (battery). ### Arguments - **storage_id** (String) - The ID of the storage device. ``` -------------------------------- ### device.read_parameter(parameter_id, start_address, end_address) Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/openapiv1/devices/sph.md Read a specific parameter from an SPH inverter. Currently, only 'pv_on_off' is supported. ```APIDOC ## device.read_parameter(parameter_id, start_address, end_address) ### Description Read a specific parameter from an SPH inverter. Currently, only 'pv_on_off' is supported. ### Method None ### Endpoint None ### Parameters #### Query Parameters - **parameter_id** (String) - Optional - The ID of the parameter to read. - **start_address** (Int) - Optional - The starting address for reading parameters. - **end_address** (Int) - Optional - The ending address for reading parameters. ### Request Example None ### Response #### Success Response (200) - **data** (object) - The value of the requested parameter. #### Response Example ```json { "data": { ... } } ``` ``` -------------------------------- ### api.storage_params Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/shinephone.md Retrieves extensive and convoluted information on storage (battery) devices. ```APIDOC ## api.storage_params(storage_id) ### Description Gets extensive information on storage (more info, more convoluted). ### Arguments - **storage_id** (String) - The ID of the storage device. ``` -------------------------------- ### api.update_plant_settings Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/shinephone.md Updates the settings for a plant to the values specified in the `changed_settings` dictionary. If `current_settings` are not provided, they will be looked up automatically. ```APIDOC ## api.update_plant_settings(plant_id, changed_settings, current_settings=None) ### Description Updates the settings for a plant to the values specified in the dictionary. If `current_settings` are not provided, it will look them up automatically using the `get_plant_settings` function. ### Arguments - **plant_id** (String) - The ID of the plant. - **changed_settings** (Dict) - A dictionary containing the settings to be changed. - **current_settings** (Dict, optional) - A dictionary containing the current settings of the plant. ``` -------------------------------- ### api.plant_list Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/shinephone.md Retrieves a list of plants registered to the user's account. ```APIDOC ## api.plant_list(user_id) ### Description Gets a list of plants registered to your account. ### Arguments - **user_id** (String) - The ID of the user. ``` -------------------------------- ### api.tlx_battery_info_detailed Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/shinephone.md Retrieves detailed battery information for TLX systems. ```APIDOC ## api.tlx_battery_info_detailed(serial_num) ### Description Gets detailed battery info. ### Arguments - **serial_num** (String) - The serial number of the battery. ``` -------------------------------- ### api.update_classic_inverter_setting Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/shinephone.md Applies settings to classic inverters. This function takes default parameters and specific overrides to configure the inverter based on its serial number. ```APIDOC ## api.update_classic_inverter_setting ### Description Applies settings for specified system based on serial number. This function is only going to work for classic inverters. ### Parameters - **default_parameters** (Dict) - Required - Default configuration parameters. - **parameters** (Dict/Array) - Required - Specific parameters to override or set. ### Note This function is exclusively for classic inverters. ``` -------------------------------- ### api.noah_info Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/shinephone.md Retrieves all information for a specified Noah device, including configured operation modes, battery management settings, and firmware version. ```APIDOC ## api.noah_info(serial_number) ### Description Gets all information for the specified Noah device, e.g., configured operation modes, battery management settings, firmware version, etc. ### Arguments - **serial_number** (String) - The serial number of the Noah device. ``` -------------------------------- ### api.mix_totals Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/shinephone.md Retrieves daily and overall total information for the Mix system. This duplicates some information from `mix_info`. ```APIDOC ## api.mix_totals(mix_id, plant_id) ### Description Gets daily and overall total information for the Mix system (duplicates some of the information from `mix_info`). ### Arguments - **mix_id** (String) - The ID of the Mix system. - **plant_id** (String) - The ID of the plant. ``` -------------------------------- ### api.tlx_battery_info Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/shinephone.md Retrieves battery information for TLX systems. ```APIDOC ## api.tlx_battery_info(serial_num) ### Description Gets battery info for tlx systems. ### Arguments - **serial_num** (String) - The serial number of the battery. ``` -------------------------------- ### Write Inverter Parameter Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/openapiv1/min_tlx_settings.md Writes a specific parameter to a MIN/TLX inverter. The value can be a single value, a list, or a dictionary. ```APIDOC ## Write Inverter Parameter ### Description Writes a specific parameter to a MIN/TLX inverter. The parameter can be set to a single value, a list of values, or a dictionary of values. ### Function `api.min_write_parameter` ### Parameters #### Path Parameters - **device_sn** (string) - Required - The device serial number. - **parameter_id** (string) - Required - Parameter ID to write (e.g., "ac_charge"). - **parameter_values** (any) - Required - The value to set for the parameter. Can be a single value, a list, or a dictionary. ``` -------------------------------- ### api.tlx_detail Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/shinephone.md Retrieves detailed data for a TLX type inverter. ```APIDOC ## api.tlx_detail(tlx_id) ### Description Gets detailed data on a tlx type inverter. ### Arguments - **tlx_id** (String) - The ID of the TLX inverter. ``` -------------------------------- ### api.is_plant_noah_system Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/shinephone.md Determines if Noah devices are configured for the specified plant. ```APIDOC ## api.is_plant_noah_system(plant_id) ### Description Gets information if Noah devices are configured for the specified plant. ### Arguments - **plant_id** (String) - The ID of the plant. ``` -------------------------------- ### api.plant_detail Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/shinephone.md Retrieves detailed data for a specific plant within a given timespan and date. ```APIDOC ## api.plant_detail(plant_id, timespan, date) ### Description Gets details of a specific plant. ### Arguments - **plant_id** (String) - The ID of the plant. - **timespan** (Int) - The timespan for the data (1=day, 2=month). - **date** (String) - The date for the data. ``` -------------------------------- ### api.tlx_energy_prod_cons Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/shinephone.md Retrieves energy production and consumption data for a TLX inverter within a specified plant. ```APIDOC ## api.tlx_energy_prod_cons(plant_id, tlx_id) ### Description Gets energy production and consumption for the system. ### Arguments - **plant_id** (String) - The ID of the plant. - **tlx_id** (String) - The ID of the TLX inverter. ``` -------------------------------- ### api.update_tlx_inverter_setting Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/shinephone.md Applies a specified setting to a TLX inverter. This method allows for granular control over inverter configurations by targeting a specific setting type and parameter. ```APIDOC ## api.update_tlx_inverter_setting ### Description Apply the provided parameter for the specified setting on the specified tlx inverter. ### Parameters - **serial_number** (String) - Required - The serial number of the TLX inverter. - **setting_type** (String) - Required - The type of setting to update. - **parameter** (Any) - Required - The new value for the setting. ### See Also - [details](./shinephone/inverter_settings.md) ``` -------------------------------- ### Write Specific Parameter for MIN Inverter Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/openapiv1.md Set or update parameters on a MIN inverter. Requires the device serial number, parameter ID, and the new parameter values, which can be a single value, a list, or a dictionary. ```python api.min_write_parameter(device_sn, parameter_id, parameter_values) ``` -------------------------------- ### api.inverter_detail Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/shinephone.md Retrieves detailed data for a specific inverter. ```APIDOC ## api.inverter_detail(inverter_id) ### Description Gets detailed data on inverter. ### Arguments - **inverter_id** (String) - The ID of the inverter. ``` -------------------------------- ### api.plant_energy_data Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/shinephone.md Retrieves energy data for the specified plant. ```APIDOC ## api.plant_energy_data(plant_id) ### Description Gets energy data for the specified plant. ### Arguments - **plant_id** (String) - The ID of the plant. ``` -------------------------------- ### device.read_time_segments(settings_data) Source: https://github.com/indykoning/pypi_growattserver/blob/master/docs/openapiv1/devices/min.md Reads all time segments from a Min inverter. Optionally, `settings_data` can be provided to avoid redundant API calls. Refer to external details for more information. ```APIDOC ## device.read_time_segments(settings_data) ### Description Read all time segments from a MIN inverter. Optionally pass settings_data to avoid redundant API calls. see: [details](../min_tlx_settings.md) ### Method None (Assumed to be a method call within a library) ### Endpoint N/A ### Parameters #### Query Parameters - **settings_data** (Dict) - Optional - Pre-fetched settings data to avoid an extra API call. ### Request Example ```json { "settings_data": { "some_setting": "value" } } ``` ### Response #### Success Response - **time_segments** (Array) - An array of time segment configurations. #### Response Example ```json { "time_segments": [ { "segment_id": 1, "batt_mode": 1, "start_time": "08:00:00", "end_time": "17:00:00", "enabled": true } ] } ``` ```