DiedB / Homey-SolarPanels

Connects production statistics of a wide range of PV inverters to Homey
https://apps.athom.com/app/it.diederik.solar
GNU General Public License v3.0
52 stars 37 forks source link

ZCS Azzurro inverter support #307

Open doors99 opened 12 months ago

doors99 commented 12 months ago

Hello, my inverter (ZCS Azzurro 20000) is not supported. This is the inverter page and following is an example of call request to API Rest to have needed information:

following is an example to make a request to their public api rest endpoint where ZZZZZZZZ = api key, YYYYYYYY = client name, XXXXXXXXX = inverter serial number. This will work with any ZCS Azzurro inverter.

var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://third.zcsazzurroportal.com:19003/',
  'headers': {
    'Authorization': 'ZZZZZZZZ',
    'Client': 'YYYYYYYY'
  },
  body: '{\r\n    "realtimeData": {\r\n        "command": "realtimeData",\r\n        "params": {\r\n            "thingKey": "XXXXXXXXX",\r\n            "requiredValues": "*"\r\n        }\r\n    }\r\n}'

};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

And this is the kind of response it will receive:

{
    "realtimeData": {
        "success": true,
        "params": {
            "value": [
                {
                    "XXXXXXXXX": {
                        "powerAutoconsuming": 213,
                        "powerCharging": 0,
                        "energyExporting": 0.02,
                        "powerImporting": 10,
                        "energyConsumingTotal": 10874,
                        "energyChargingTotal": 2993.2,
                        "powerDischarging": 305,
                        "batteryCycletime2": 0,
                        "energyDischargingTotal": 2505.3,
                        "energyImporting": 0.02,
                        "powerGenerating": 213,
                        "energyExportingTotal": 6034.9,
                        "batterySoC2": 0,
                        "energyGenerating": 0.02,
                        "batterySoC": 78,
                        "powerExporting": 0,
                        "energyCharging": 0,
                        "energyConsuming": 4.01,
                        "batteryCycletime": 73,
                        "energyAutoconsuming": 0,
                        "energyAutoconsumingTotal": 8346.9,
                        "energyDischarging": 3.99,
                        "powerConsuming": 529,
                        "energyGeneratingTotal": 17375,
                        "lastUpdate": "2023-10-03T05:29:20Z",
                        "thingFind": "2022-11-29T08:04:30Z",
                        "energyImportingTotal": 21.8
                    }
                }
            ]
        }
    }
}
doors99 commented 12 months ago

the code in the example was done with a working request done with postman and then just extracted the code