### Create Power Station API Source: https://www.foxesscloud.com/public/i18n/en/OpenApiDocument This API endpoint allows users to create a new power station by providing comprehensive details about the installation, including connected devices, location information, and the physical layout of solar panels. ```APIDOC POST /op/v0/plant/create Interface description: Creates a new power station. Request Body Example: { "devices": [ { "sn": "*******" } ], "pileSN": "*************", "details": { "name": "name_51b2289bf18f", "type": 1, "countryCode": "CN", "city": "city_54049a6aad08", "address": "address_efdf02e2819d", "postcode": "213414", "price": 0.52, "currency": "CNY(¥)", "systemCapacity": 72.00 }, "timezone": "Asia/Shanghai", "position": { "x": "x_9e0c3cf37a91", "y": "y_6fa583b5fe21", "format": "format_b9434db57b54", "pid": "pid_169c8579050c" }, "electricmeterSN": "*********************", "layoutByMini": { "direction": 1, "arrange": [ { "sn": "***********", "horizontal": 2, "vertical": 3, "azimuth": 30, "dipAngle": 45, "direction": 1, "capacity": 30, "model": "model_71300e86ba58" } ] } } ``` -------------------------------- ### FoxESS Cloud API - Scheduler Endpoints Source: https://www.foxesscloud.com/public/i18n/en/OpenApiDocument Documentation for the Scheduler API endpoints in FoxESS Cloud, including methods to get and set device states and timing configurations. These endpoints are marked as deprecated. ```APIDOC APIDOC: Endpoint: /op/v0/device/scheduler/get/flag Method: POST Description: Obtain the timing mode switch status (Deprecated). Request Body Example: { "deviceSN": "**************" } Request Parameters: Headers: Content-Type: application/json (Required) token: string (Required) - Generate apikey from the API management function of the platform. signature: string (Required) - Signature rule: Encrypt the string url + "\r\n" + token + "\r\n" + timestamp with md5. timestamp: string (Required) - Current timestamp. lang: string (Required) - Language, e.g., 'en'. Body: deviceSN: string (Required) - Serial number of device. Response Data: error number: integer (Required) - Error number (When the result is not equal to zero, the request fails). Error message: string (Required) data: object (Required) support: integer (Required) - Whether the timing function is supported (0: nonsupport, 1: support). enable: integer (Required) - Whether to enable the timing function (0: disable, 1: enable). Endpoint: /op/v0/device/scheduler/get Method: POST Description: Get timing mode segment information (Deprecated). Request Body Example: { "deviceSN": "**************" } Request Parameters: Headers: Content-Type: application/json (Required) token: string (Required) - Generate apikey from the API management function of the platform. signature: string (Required) - Signature rule: Encrypt the string url + "\r\n" + token + "\r\n" + timestamp with md5. timestamp: string (Required) - Current timestamp. lang: string (Required) - Language, e.g., 'en'. Body: deviceSN: string (Required) - Serial number of device. Response Data: error number: integer (Required) - Error number (When the result is not equal to zero, the request fails). Error message: string (Required) data: object (Required) enable: string (Required) - State of master switch (0: off, 1: on). groups: object[] (Required) - Array of time segment groups. item Type: object enable: integer (Required) - Whether to enable this group setting (0: disable, 1: enable). startHour: integer (Required) - Start time - hour (0-23). startMinute: integer (Required) - Start time - minute (0-59). endHour: integer (Required) - Ending time - hour (0-23). endMinute: integer (Required) - Ending time - minute (0-59). workMode: string (Required) - Working mode (SelfUse, Feedin, Backup, ForceCharge, ForceDischarge). minSocOnGrid: integer (Required) - Minimum SOC value when offline. fdSoc: integer (Required) - Discharge SOC value. fdPwr: integer (Required) - Maximum discharge power value. ``` -------------------------------- ### Execute User Get Access Count Source: https://www.foxesscloud.com/public/i18n/en/OpenApiDocument Python function to call the user get access count API. It specifies the API path and uses a GET request. ```python def user_get_access_count(): path = '/op/v0/user/getAccessCount' response = fr_requests('get', path) save_response_data(response, 'user_get_access_count_response.json') return response ``` -------------------------------- ### Get Device Settings Source: https://www.foxesscloud.com/public/i18n/en/OpenApiDocument Retrieves the settings for a specific device, identified by its serial number. Requires authentication headers. ```APIDOC Path: /op/v0/gw/setting/get Method: POST Description: Retrieves device settings. Request Headers: - Content-Type: application/json (Required) - token: API key (Required) - signature: MD5 hash of url + "\r\n" + token + "\r\n" + timestamp (Required) - timestamp: Current timestamp (Required) - lang: Language code (e.g., 'en') (Required) Request Body: - Serial Number: string (Required) (Serial number of the Inverter) ``` -------------------------------- ### Get Device Peakshaving Settings Source: https://www.foxesscloud.com/public/i18n/en/OpenApiDocument Retrieves the current peakshaving settings for a specified device. Requires authentication via token and signature. ```APIDOC Path: /op/v0/device/peakShaving/get Method: POST Request Headers: - Content-Type: application/json (Required) - token: API key (Required) - signature: MD5 hash of (url + "\r\n" + token + "\r\n" + timestamp) (Required) - timestamp: Current timestamp (Required) - lang: Language code (e.g., 'en') (Required) Request Body: - Serial number of Inverter (string, Required) Response Data: - Error number (integer, Required): 0 for success, non-zero for failure. - Response object (object, Required): - importLimit: object - value: setting value (string, Required) - unit: unit of setting (string, Required) - precision: precision of setting (number, Required, e.g., 1, 0.1, 0.01) - range: object - min: minimum value (number, Required) - max: maximum value (number, Required) - soc: object - value: setting value (string, Required) - unit: unit of setting (string, Required) - precision: precision of setting (number, Required, e.g., 1, 0.1, 0.01) - range: object - min: minimum value (number, Required) - max: maximum value (number, Required) ``` -------------------------------- ### FoxESS Cloud API - Get Available Variables Source: https://www.foxesscloud.com/public/i18n/en/OpenApiDocument Retrieves the table of available variables for use with real-time and historical data interfaces. ```APIDOC Endpoint: /op/v0/device/variable/get Method: GET Description: Obtain variable tables for use by real-time data and historical data interfaces. ``` -------------------------------- ### FoxESS Cloud API - Get Power Station List Source: https://www.foxesscloud.com/public/i18n/en/OpenApiDocument Retrieves a list of power stations associated with the authenticated account. Requires pagination parameters and authentication headers including a token and signature. ```APIDOC Path: /op/v0/plant/list Method: POST Interface description: Obtain the list of power stations to which this account belongs Request Headers: - Content-Type: application/json (Required) - token: Required (Generate apikey from the API management function of the platform) - signature: Required (Encrypt the string url + "\r\n" + token + "\r\n" + timestamp with md5) - timestamp: Required (Current timestamp) - lang: en (Required) Request Body: - currentPage: integer (Required, Minimum value: 1) - pageSize: integer (Required, Minimum value: 10) Response Data: - Error number: integer (Required, When the result is not equal to zero, the request fails) - data: object [] (Required) - stationID: string (Required, Id of power station) - name: string (Required, Name of power station) - ianaTimezone: string (Required, Timezone of power station) - currentPage: integer (Required, Current page number) - pageSize: integer (Required, The amount of data presented per page) - total: integer (Required, Data volume total) Request Body Example: { "currentPage": 1, "pageSize": 10 } ``` -------------------------------- ### Get Device Settings API Source: https://www.foxesscloud.com/public/i18n/en/OpenApiDocument Retrieves specific settings for a given device. Requires the device serial number and the key of the setting to be fetched. Useful for querying parameters like export limits. ```APIDOC POST /op/v0/device/setting/get Interface description: Obtain the device settings. Request Body: { "sn": "string (required)", "key": "string (required)" } Response Data: - Error number (integer, required): Indicates success (0) or failure (non-zero). - Object (required): Contains the requested device settings. ``` -------------------------------- ### Get Data Logger List Source: https://www.foxesscloud.com/public/i18n/en/OpenApiDocument Retrieves a list of data loggers associated with an account. Requires authentication headers and a JSON request body specifying pagination. ```APIDOC Path: /op/v0/module/list Method: POST Description: Obtain the collector list of this account. Request Headers: - Content-Type: application/json (Required) - token: API key (Required) - signature: MD5 hash of url + "\r\n" + token + "\r\n" + timestamp (Required) - timestamp: Current timestamp (Required) - lang: Language code (e.g., 'en') (Required) Request Body: - currentPage: integer (Required, Minimum: 1) - pageSize: integer (Required, Minimum: 10, Maximum: 1000) Response Data: - Error number: integer (0 for success) - currentPage: integer - pageSize: integer - total: integer - data: object[] - moduleSN: string (Data Logger Serial Number) - stationID: string (Power Station ID) - status: integer (Data Logger Status: 1=online, 2=offline) - signal: integer (Signal Strength: 0-100) ``` -------------------------------- ### Get Error Code Information API Source: https://www.foxesscloud.com/public/i18n/en/OpenApiDocument Retrieves error code information for devices. Requires authentication via token and signature. The response includes error codes and their corresponding descriptions in multiple languages. ```APIDOC Path: /op/v0/device/fault/get Method: GET Interface description: Obtain error code information Request parameter Headers: - Content-Type: application/json (Required) - token: Required (Generate apikey from the API management function of the platform) - signature: Required (Signature rule: Encrypt the string url + "\r\n" + token + "\r\n" + timestamp with md5) - timestamp: Required (Current timestamp) - lang: Required (Default: en) Request parameter Body: - (string): Not Required, format: binary Response Data: - (integer): Required - (object []): Required, item Type: object - {errNo} (object): Required, Error code - en (string): Required, The error code corresponds in English - zh_CN (string): Required, The error code corresponds in Chinese - pl (string): Required, The error code corresponds in Polish ``` -------------------------------- ### FoxESS Cloud API - Get Device Real-time Data Source: https://www.foxesscloud.com/public/i18n/en/OpenApiDocument Fetches the latest real-time data for specified inverters. Requires an array of serial numbers (sns) and optionally an array of variables to query. Returns data only for the current user. ```APIDOC Path: /op/v1/device/real/query Method: POST Interface description: Get the latest real-time data of the inverter. The sn array is mandatory and returns only the result set belonging to the current user. If no variable is specified, all variables are queried Request Headers: - Content-Type: application/json (Required) - token: Required (Generate apikey from the API management function of the platform) - signature: Required (Encrypt the string url + "\r\n" + token + "\r\n" + timestamp with md5) - timestamp: Required (Current timestamp) - lang: en (Required) Request Body: - sns: string [] (Mandatory, Array of inverter serial numbers) - variables: string [] (Optional, Array of variables to query, e.g., ["pvPower", "pv1Current"]) Request Body Example: { "sns": ["***************","***************","***************"], "variables": ["pvPower","pv1Current"] } ``` -------------------------------- ### Get Device History Data Source: https://www.foxesscloud.com/public/i18n/en/OpenApiDocument Retrieves historical data for a device within a specified 24-hour period or the last three days if no period is specified. Requires device serial number, variables, and optionally start and end timestamps. ```APIDOC Path: /op/v0/device/history/query Method: POST Request Headers: - Content-Type: application/json (Required) - token: API key (Required) - signature: MD5 hash of url + token + timestamp (Required) - timestamp: Current timestamp (Required) - lang: Language code (e.g., 'en') (Required) Request Body: - sn: Serial Number of Inverter (string, Required) - variables: Array of variable names (string[], Not Required, defaults to all if not provided) - begin: Start timestamp in milliseconds (number, Not Required) - end: End timestamp in milliseconds (number, Not Required) Example Request Body: { "sn": "***************", "variables": ["pvPower","pv1Current"], "begin": 1703548800000, "end": 1703635200000 } Response Data: - An array of data objects, each containing: - deviceSN: Serial Number of Inverter (string, Required) - datas: Array of data points (object[], Required) - variable: Variable name (string, Required) - unit: Unit of variable (string, Required) - name: Name in English (string, Required) - data: Array of data values (object[], Required) - value: The data value (number, Required) - time: Time of Data Update, utc time (string, Required) ``` -------------------------------- ### FoxESS Cloud API - Create Power Station Request Parameters Source: https://www.foxesscloud.com/public/i18n/en/OpenApiDocument Defines the required headers and body parameters for creating a power station via the FoxESS Cloud API. This includes details like authentication tokens, timestamps, signature rules, and comprehensive information about the power station such as its name, type, location, capacity, and specific details for mini-devices. ```APIDOC ### Request parameter **Headers** Parameter name | Parameter value | Is it required | Example | Note ---|---|---|---|--- Content-Type | application/json | Required | | token | | Required | | Generate apikey from the API management function of the platform signature | | Required | | Signature rule: Encrypt the string url + "\r\n" + token + "\r\n" + timestamp with md5 timestamp | | Required | | Current timestamp lang | | Required | en | Language **Body** Name | Type | Is it required | Default value | Note | Other information ---|---|---|---|---|--- | object [] | Not Required | | Information of modules(needed for creating pv/energy-storage power station) | item Type: object ├─ sn | string | Not Required | | Serial number of module | ├─ key | string | Not Required | | | | string | Not Required | | Charge pile's serial number(needed for charge pile power station) | | object | Required | | Details of power station | ├─ name | string | Required | | Name of power station | ├─ type | number | Required | | Type of power station(1-pv power station,2-energy-storage power station,3-charge-pile power station,4-mini-device power station) | ├─ countryCode | string | Required | | Country's code of power station(Two-bit code, such as China is "CN",Reference address:https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) | ├─ city | string | Required | | City | ├─ address | string | Required | | Address | ├─ postcode | string | Required | | Postcode | ├─ price | number | Not Required | | Electric price of power station(needed for creating pv/energy-storage/mini-device power station) | ├─ currency | string | Not Required | | The currency of electricity price measurement(needed for editing pv/energy-storage/mini-device power station,reference:U.S. dollar-USD($);Euro-EUR(€);Vietnamese Dong-VND(D.);RMB-CNY(¥);Pound sterling-GBP(£);Australian dollar-AUD($);Poland-PLN(Zł);India-INR(₹);Brazil-BRL(R$);S.Africa-ZAR(R);THB (THB)-THB(฿);Pakistani rupee-PKR(Rs)) | ├─ systemCapacity | number | Not Required | | System's capacity of power station(needed for creating pv/energy-storage/mini-device power station) | | string | Required | | Detailed time zone in English("district"+"/"+"country",such as:Asia/Shanghai,Reference address:https://nodatime.org/TimeZones) | | object | Not Required | | Coordinate information | ├─ format | string | Not Required | | Coordinate address | ├─ x | string | Not Required | | Longitude | ├─ y | string | Not Required | | Latitude | ├─ pid | string | Not Required | | Ip of address | | string | Not Required | | Serial number of electricmeter(needn't if empty) | | object | Not Required | | Information of mini-device (needed for creating mini-device power station) | ├─ direction | number | Not Required | | Component layout(1-portrait,2-crosswise) | ├─ arrange | object [] | Not Required | | | item Type: object ├─ sn | string | Not Required | | Serial number of module (needed for creating mini-device power station) | ├─ horizontal | number | Not Required | | Horizontal number (needed for creating mini-device power station) | ├─ vertical | number | Not Required | | Vertical number (needed for creating mini-device power station) | ├─ azimuth | number | Not Required | | Azimuth angle (needed for creating mini-device power station,between 0 and 360°) | ├─ dipAngle | number | Not Required | | Angle of inclination (needed for creating mini-device power station,between 0 and 90°) | ├─ direction | number | Not Required | | Direction( needed for creating mini-device power station,1-vertical,2-horizontal) | ├─ capacity | number | Not Required | | Component capacity (needed for creating mini-device power station) | ├─ model | string | Not Required | | Component type (needed for creating mini-device power station) | ``` -------------------------------- ### FoxESS Cloud API - Get Power Station Detail Endpoint Source: https://www.foxesscloud.com/public/i18n/en/OpenApiDocument Details the GET endpoint for retrieving specific details of a power station using its ID. ```APIDOC Get power station detail Basic information Path: /op/v0/plant/detail Method: GET Interface description: Obtain details about a power station based on the power station ID ``` -------------------------------- ### FoxESS Cloud Parameters Source: https://www.foxesscloud.com/public/i18n/en/OpenApiDocument This section details various parameters monitored and managed by the FoxESS Cloud system. It includes information on units, inverter compatibility (Grid-tied and Energy-storage), and multilingual names for each parameter. ```APIDOC meterPower2: name: zh_CN: 电表2功率 en: Meter2Power pl: Meter2Power fr: Meter2Power pt: Meter2Power de: Meter2Power unit: kW Grid-tied inverter: true Energy-storage inverter: true meterPowerR: name: zh_CN: 电表功率R en: MeterRPower pl: MeterRPower fr: MeterRPower pt: MeterRPower de: MeterRPower unit: kW Grid-tied inverter: true Energy-storage inverter: true meterPowerS: name: zh_CN: 电表功率S en: MeterSPower pl: MeterSPower fr: MeterSPower pt: MeterSPower de: MeterSPower unit: kW Grid-tied inverter: true Energy-storage inverter: true meterPowerT: name: zh_CN: 电表功率T en: MeterTPower pl: MeterTPower fr: MeterTPower pt: MeterTPower de: MeterTPower unit: kW Grid-tied inverter: true Energy-storage inverter: true SoC: name: zh_CN: SoC en: SoC pl: SoC fr: SoC pt: SoC de: SoC unit: "%" Grid-tied inverter: false Energy-storage inverter: true ReactivePower: name: zh_CN: 无功功率 en: ReactivePower pl: ReactivePower fr: ReactivePower pt: ReactivePower de: ReactivePower unit: kVar Grid-tied inverter: true Energy-storage inverter: true PowerFactor: name: zh_CN: 功率因数 en: PowerFactor pl: PowerFactor fr: PowerFactor pt: PowerFactor de: PowerFactor unit: "" Grid-tied inverter: true Energy-storage inverter: true generation: name: zh_CN: 累计发电量 en: Cumulative power generation pl: Cumulative power generation fr: Cumulative power generation pt: Cumulative power generation de: Cumulative power generation unit: kWh Grid-tied inverter: true Energy-storage inverter: true ResidualEnergy: name: zh_CN: 电池剩余电量 en: Battery Residual Energy pl: Battery Residual Energy fr: Battery Residual Energy pt: Battery Residual Energy de: Battery Residual Energy unit: kWh Grid-tied inverter: false Energy-storage inverter: true runningState: name: zh_CN: 运行状态 en: Running State pl: Running State fr: Running State pt: Running State de: Running State unit: "" Grid-tied inverter: true Energy-storage inverter: true enum: 160: self-test 161: waiting 162: checking 163: on-grid 164: off-grid 165: fault 166: permanent-fault 167: standby 168: upgrading 169: fct 170: illegal batStatus: name: zh_CN: 电池状态 en: Battery Status pl: Battery Status fr: Battery Status pt: Battery Status de: Battery Status unit: "" Grid-tied inverter: false Energy-storage inverter: true batStatusV2: name: zh_CN: 电池状态Name en: Battery Status Name pl: Battery Status Name fr: Battery Status Name pt: Battery Status Name de: Battery Status Name unit: "" Grid-tied inverter: false Energy-storage inverter: true currentFault: name: zh_CN: 当前报错 en: The current error code is reported pl: The current error code is reported fr: The current error code is reported pt: The current error code is reported de: The current error code is reported unit: "" Grid-tied inverter: true Energy-storage inverter: true currentFaultCount: name: zh_CN: 当前报错个数 en: The number of errors pl: The number of errors fr: The number of errors pt: The number of errors de: The number of errors unit: "" Grid-tied inverter: true Energy-storage inverter: true energyThroughput: name: zh_CN: 电池吞吐量 en: Battery throughput pl: Battery throughput fr: Battery throughput pt: Battery throughput de: Battery throughput unit: Wh Grid-tied inverter: false Energy-storage inverter: true SOH: name: zh_CN: SOH en: SOH pl: SOH fr: SOH pt: SOH de: SOH unit: "%" Grid-tied inverter: false Energy-storage inverter: true gridConsumption: name: zh_CN: 总电网用电量 en: Total grid electricity consumption pl: Total grid electricity consumption fr: Total grid electricity consumption pt: Total grid electricity consumption de: Total grid electricity consumption unit: kWh ``` -------------------------------- ### Get Battery State of Charge (SoC) Source: https://www.foxesscloud.com/public/i18n/en/OpenApiDocument Retrieves the current state of charge for a device's battery. It sends a GET request with the device serial number. ```python def device_bat_soc_get(): path = '/op/v0/device/battery/soc/get' request_param = {'sn': 'sn'} response = fr_requests('get', path, request_param) save_response_data(response, 'device_bat_soc_get_response.json') return response ``` -------------------------------- ### List System Modules Source: https://www.foxesscloud.com/public/i18n/en/OpenApiDocument Retrieves a list of available modules within the system. This is useful for understanding the system's components. ```APIDOC module_list() Fetches a list of system modules. Parameters: currentPage: The current page number for pagination (defaults to 1). pageSize: The number of items per page (defaults to 10). Returns: A response containing a list of modules. ``` -------------------------------- ### Get Battery Force Charge Time Source: https://www.foxesscloud.com/public/i18n/en/OpenApiDocument Retrieves the configured force charge times for a device's battery. It sends a GET request with the device serial number. ```python def device_bat_force_charge_time_get(): path = '/op/v0/device/battery/forceChargeTime/get' request_param = {'sn': 'sn'} response = fr_requests('get', path, request_param) save_response_data(response, 'device_bat_force_charge_time_get_response.json') return response ``` -------------------------------- ### Execute Module List Source: https://www.foxesscloud.com/public/i18n/en/OpenApiDocument Python function to call the module list API. It sets the API path and request parameters for pagination, then sends the POST request. ```python def module_list(): path = '/op/v0/module/list' request_param = {'currentPage': 1, 'pageSize': 10} response = fr_requests('post', path, request_param) save_response_data(response, 'module_list_response.json') return response ``` -------------------------------- ### FoxESS Cloud API - Public Information Source: https://www.foxesscloud.com/public/i18n/en/OpenApiDocument This section outlines general information about the FoxESS Cloud Platform's open API. It covers authentication requirements (API key generation and security), communication protocols (RESTful style, JSON data format, UTF-8 encoding), and a recommendation to modify the User-Agent when using script calls. ```APIDOC API Key Generation: - Obtain API key from the 'api management' section of the cloud platform personal center. - Keep API key secure to prevent unauthorized access. - A new key invalidates the old one if lost or leaked. API Design: - RESTful style. - Returned data format: JSON. - Encoding format: UTF-8. Script Calling: - Modify User-Agent when using scripts. ``` -------------------------------- ### Get Meter List Source: https://www.foxesscloud.com/public/i18n/en/OpenApiDocument Retrieves a list of meters associated with power stations. Requires a JSON request body for pagination. ```APIDOC Path: /op/v0/gw/list Method: POST Description: Retrieves a list of meters. Request Headers: - Content-Type: application/json (Required) Request Body: - currentPage: integer (Required, Minimum: 1) - pageSize: integer (Required, Minimum: 10) Response Data: - Error number: integer (0 for success) - currentPage: integer - pageSize: integer - total: integer - data: object[] - sn: string (Meter Serial Number) - stationID: string (Power Station ID) - stationName: string (Power Station Name) - status: integer (Meter Status: 1=online, 2=fault, 3=offline) ``` -------------------------------- ### Set Device Settings API Source: https://www.foxesscloud.com/public/i18n/en/OpenApiDocument This API endpoint allows for setting various device parameters. It requires authentication via a token and a signature, and accepts configuration details in the request body. ```APIDOC POST /op/v0/gw/setting/set Headers: - Content-Type: application/json (Required) - token: (Required) Generate apikey from the API management function of the platform - signature: (Required) Signature rule: Encrypt the string url + "\r\n" + token + "\r\n" + timestamp with md5 - timestamp: (Required) Current timestamp - lang: (Required) en Body: - (string, Required) - (string, Required) - (string, Not Required) Only available in non-normal mode - (string, Not Required) Only available in G100mode - (string, Not Required) Only available in G100mode - (string, Not Required) Only available in G100mode - (string, Not Required) Only available in G100mode - (string, Not Required) Only available in G100mode Response Data: - (integer, Required) Error number (When the result is not equal to zero, the request fails) - (object, Required) ``` -------------------------------- ### Get Device List Source: https://www.foxesscloud.com/public/i18n/en/OpenApiDocument Retrieves a list of inverters associated with the authenticated account. This endpoint is useful for managing multiple devices. ```APIDOC POST /op/v0/device/list Request Body: { "currentPage": integer, "pageSize": integer } Response Data: (Details of the response data structure for device list are not provided in the input, but typically include device identifiers, status, and model information.) Headers: - Content-Type: application/json - token: Required (API key) - signature: Required (MD5 hash of url + token + timestamp) - timestamp: Required (Current timestamp) - lang: Required (e.g., 'en') ``` -------------------------------- ### FoxESS Cloud API - Power Station Body Parameters Source: https://www.foxesscloud.com/public/i18n/en/OpenApiDocument Details the structure of the request body for power station operations, including information for PV, energy storage, and charge pile power stations, as well as mini-devices and coordinate information. ```APIDOC Body: Name | Type | Is it required | Default value | Note | Other information ---|---|---|---|---|--- | object [] | Not Required | | Information of modules(needed for editing pv/energy-storage power station) | item Type: object ├─ sn | string | Not Required | | Serial number of module | ├─ key | string | Not Required | | | | string | Not Required | | Charge pile's serial number(needed for charge pile power station) | | object | Required | | Details of power station | ├─ name | string | Required | | Name of power station | ├─ type | number | Required | | Type of power station(1-pv power station,2-energy-storage power station,3-charge-pile power station,4-mini-device power station) | ├─ countryCode | string | Required | | Country's code of power station(Two-bit code, such as China is "CN",Reference address:https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) | ├─ city | string | Required | | City | ├─ address | string | Required | | Address | ├─ postcode | string | Required | | Postcode | ├─ price | number | Not Required | | Electric price of power station(needed for editing pv/energy-storage/mini-device power station) | ├─ currency | string | Not Required | | The currency of electricity price measurement(needed for editing pv/energy-storage/mini-device power station,reference:U.S. dollar-USD($);Euro-EUR(€);Vietnamese Dong-VND(D.);RMB-CNY(¥);Pound sterling-GBP(£);Australian dollar-AUD($);Poland-PLN(Zł);India-INR(₹);Brazil-BRL(R$);S.Africa-ZAR(R);THB (THB)-THB(฿);Pakistani rupee-PKR(Rs)) | ├─ stationID | string | Required | | Id of power station | ├─ systemCapacity | number | Not Required | | System's capacity of power station(needed for editing pv/energy-storage/mini-device power station) | | string | Required | | Detailed time zone in English("district"+"/"+"country",such as:Asia/Shanghai,Reference address:https://nodatime.org/TimeZones) | | object | Not Required | | Coordinate information | ├─ format | string | Not Required | | Coordinate address | ├─ x | string | Not Required | | Longitude | ├─ y | string | Not Required | | Latitude | ├─ pid | string | Not Required | | Ip of address | | string | Not Required | | Serial number of electricmeter(needn't if empty) | | object | Not Required | | Information of mini-device (needed for editing mini-device power station) | ├─ direction | number | Not Required | | Component layout(1-portrait,2-crosswise) | ├─ arrange | object [] | Not Required | | | item Type: object ├─ sn | string | Not Required | | Serial number of module | ├─ horizontal | number | Not Required | | Horizontal number | ├─ vertical | number | Not Required | | Vertical number | ├─ azimuth | number | Not Required | | Azimuth angle(between 0 and 360°) | ├─ dipAngle | number | Not Required | | Angle of inclination(between 0 and 90°) | ├─ direction | number | Not Required | | Direction(1-vertical,2-horizontal) | ├─ capacity | number | Not Required | | Component capacity | ├─ model | string | Not Required | | Component type | ``` -------------------------------- ### FoxESS Cloud API - Get Device Detail Source: https://www.foxesscloud.com/public/i18n/en/OpenApiDocument Retrieves detailed information about a specific inverter using its serial number. ```APIDOC Endpoint: /op/v0/device/detail Method: GET Description: Obtain inverter details. Request Parameters: - Headers: (See general API request headers) - Query: - sn: Required. Serial number of the Inverter. Response Data: - Error Number: integer, Required. Indicates request success (0) or failure (non-zero). - Response Object: object, Required. - deviceSN: string, Required. Serial number of the inverter. - moduleSN: string, Required. Serial number of the collector. - stationID: string, Required. ID of the power station. - stationName: string, Required. Name of the power station. - afciVersion: string, Required. Version of afci. - managerVersion: string, Required. Version of manager. - masterVersion: string, Required. Version of master. - slaveVersion: string, Required. Version of slave. - hardwareVersion: string, Required. Version of hardware. - status: integer, Required. Status of device (1:online, 2:breakdown, 3:offline). - capacity: integer, Required. Capacity of device (in kW). - function: object, Required. Functional support. - scheduler: boolean, Required. Whether the periodic mode switchover function is supported. - batteryList: object [], Required. List of batteries associated with the device. - batterySN: string, Required. Serial number of the battery. - type: string, Required. Master Slave Type of the battery. - version: string, Required. Version of the battery. - model: string, Required. Model of the battery. - capicty: string, Required. Capacity of the battery. ``` -------------------------------- ### Device Generation Data Source: https://www.foxesscloud.com/public/i18n/en/OpenApiDocument Fetches the generation data for a specific device using its serial number via a GET request. ```python def device_generation(): path = '/op/v0/device/generation' request_param = {'sn': 'sn'} response = fr_requests('get', path, request_param) save_response_data(response, 'device_generation_response.json') return response ``` -------------------------------- ### FoxESS Cloud API: Set Device Settings Source: https://www.foxesscloud.com/public/i18n/en/OpenApiDocument This API endpoint allows for setting various configuration parameters on FoxESS devices. It requires authentication via a token and a signature generated from the request details. The body specifies the inverter serial number, the setting key (e.g., ExportLimit, MinSoc), and the desired value. ```APIDOC POST /op/v0/device/setting/set Request Headers: - Content-Type: application/json (Required) - token: API key (Required) - signature: MD5 hash of url + "\r\n" + token + "\r\n" + timestamp (Required) - timestamp: Current timestamp (Required) - lang: Language code (Required, e.g., 'en') Request Body: - sn (string, Required): Serial number of the Inverter. - key (string, Required): Settings item. Enumeration: ExportLimit, MinSoc, MinSocOnGrid, MaxSoc, GridCode, WorkMode, ActivePowerLimit, ExportLimitPower, EpsOutPut. - value (string, Required): The desired settings value. Response Body: - An integer representing the error number (0 for success). - An object containing 'value' (string), 'unit' (string), 'precision' (number), and 'range' (object with 'min' and 'max' numbers). ``` -------------------------------- ### FoxESS Cloud API Common Error Solutions Source: https://www.foxesscloud.com/public/i18n/en/OpenApiDocument Provides solutions for common error codes encountered when using the FoxESS Cloud API. Includes explanations and recommended actions for missing headers, invalid body parameters, and request frequency issues. ```APIDOC Common Error Solutions: - Error Code 40256: Missing request header parameters. Ensure request headers match document requirements. - Error Code 40257: Invalid request body parameters. Verify request body parameters are consistent with document requirements. - Error Code 40400: Request frequency too high. Reduce the frequency of access. ``` -------------------------------- ### Execute Device Scheduler Set Source: https://www.foxesscloud.com/public/i18n/en/OpenApiDocument Python function to call the device scheduler set API. It constructs the request parameters and sends the POST request using `fr_requests`. ```python def device_scheduler_set(self, request_param2): path = '/op/v0/device/scheduler/set' response = fr_requests('post', path, request_param2) save_response_data(response, 'device_scheduler_set_response.json') return response ``` -------------------------------- ### Get Meter Reader Information Source: https://www.foxesscloud.com/public/i18n/en/OpenApiDocument Retrieves meter reader information for a specified device. Requires authentication via token and signature. ```APIDOC Path: /op/v0/device/getMeterReader Method: POST Request Headers: - Content-Type: application/json (Required) - token: API key (Required) - signature: MD5 hash of (url + "\r\n" + token + "\r\n" + timestamp) (Required) - timestamp: Current timestamp (Required) - lang: Language code (e.g., 'en') (Required) Request Body: - Serial number (string, Required) Response Data: - Error number (integer, Required): 0 for success, non-zero for failure. - Response object (object, Required): - readerType: Electric meter reader type (number, Required, Enum: 0-7) - readerStatus: Electric meter reader status (number, Required, Enum: 0, 1) ``` -------------------------------- ### Response Data Structure for Device Settings Source: https://www.foxesscloud.com/public/i18n/en/OpenApiDocument Defines the structure of the response data for device settings, including various parameters like power, current, and voltage limits, each with value, unit, precision, and range information. ```APIDOC Response Data Structure: - number (Required) - object (Required) - mode (object, Required) - value (string, Required) - unit (string, Required) - precision (number, Required) - range (object, Required) - min (number, Required) - max (number, Required) - enumList (string [], Required) - feedinPower (object, Required) - value (string, Required) - unit (string, Required) - precision (number, Required) - range (object, Required) - min (number, Required) - max (number, Required) - enumList (string [], Required) - outputMaxCurrent (object, Required) - value (string, Required) - unit (string, Required) - precision (number, Required) - range (object, Required) - min (number, Required) - max (number, Required) - enumList (string [], Required) - inputMaxCurrent (object, Required) - value (string, Required) - unit (string, Required) - precision (number, Required) - range (object, Required) - min (number, Required) - max (number, Required) - enumList (string [], Required) - overVoltageMaxValue (object, Required) - value (string, Required) - unit (string, Required) - precision (number, Required) - range (object, Required) - min (number, Required) - max (number, Required) - enumList (string [], Required) - underVoltageMinValue (object, Required) - value (string, Required) - unit (string, Required) - precision (number, Required) - range (object, Required) - min (number, Required) - max (number, Required) - enumList (string [], Required) - sysOnOffPowerValue (object, Required) - value (string, Required) - unit (string, Required) - precision (number, Required) - range (object, Required) - min (number, Required) - max (number, Required) - enumList (string [], Required) - deviceQuantity (object, Required) - value (string, Required) - unit (string, Required) - precision (number, Required) - range (object, Required) - min (number, Required) - max (number, Required) - enumList (string [], Required) ``` -------------------------------- ### Get User Access Count Source: https://www.foxesscloud.com/public/i18n/en/OpenApiDocument Retrieves the access count for the current user. This can be used for monitoring user activity or system usage. ```APIDOC user_get_access_count() Fetches the access count for the user. Returns: A response containing the user's access count. ```