Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Figure out how to read inverter live data from zcsazzurro #96

Open
zmoog opened this issue Oct 19, 2024 · 6 comments
Open

Figure out how to read inverter live data from zcsazzurro #96

zmoog opened this issue Oct 19, 2024 · 6 comments
Assignees
Labels

Comments

@zmoog
Copy link
Owner

zmoog commented Oct 19, 2024

I own a zcsazzurro inverter connected to my solar panels. I want to collect live metrics from the zcs azzurro cloud.

@zmoog zmoog added the research label Oct 19, 2024
@zmoog zmoog self-assigned this Oct 19, 2024
@zmoog zmoog added this to Notes Oct 19, 2024
@zmoog
Copy link
Owner Author

zmoog commented Oct 19, 2024

API keys

@zmoog zmoog moved this to In Progress in Notes Oct 19, 2024
@zmoog
Copy link
Owner Author

zmoog commented Oct 21, 2024

A quick test using cURL:

export ZCS_ENDPOINT="https://third.zcsazzurroportal.com:19003"
export ZCS_CLIENT_ID="<redacted>"
export ZCS_CLIENT_API_AUTH="<redacted>"

$ cat request.json 
{
    "realtimeData": {
        "command": "realtimeData",
        "params": {
            "thingKey": "SERIALNUMBER123",
            "requiredValues": "*"
        }
    }
}

$ curl -X POST "${ZCS_ENDPOINT}" \
    -H "Client:${ZCS_CLIENT_ID}" \
    -H "Authorization:${ZCS_CLIENT_API_AUTH}" \
    -d @request.json | jq    
{
  "realtimeData": {
    "params": {
      "value": [
        {
          "SERIALNUMBER123": {
            "powerCharging": 0,
            "batteryCycletime": 61,
            "energyAutoconsuming": 0.0,
            "lastUpdate": "2024-10-21T06:02:03Z",
            "powerGenerating": 10,
            "energyImporting": 2.45,
            "energyGenerating": 0.0,
            "powerDischarging": 0,
            "batterySoC": 18,
            "energyImportingTotal": 539.6,
            "energyExportingTotal": 1325.5,
            "energyChargingTotal": 793.8,
            "powerImporting": 710,
            "powerConsuming": 720,
            "energyGeneratingTotal": 3228.4,
            "energyCharging": 0.0,
            "energyDischargingTotal": 727.2,
            "thingFind": "2024-06-04T08:55:36Z",
            "powerExporting": 0,
            "energyAutoconsumingTotal": 1109.1,
            "energyConsuming": 2.45,
            "energyConsumingTotal": 2063.5,
            "energyDischarging": 0.0,
            "energyExporting": 0.0,
            "powerAutoconsuming": 10
          }
        }
      ]
    },
    "success": true
  }
}

@zmoog
Copy link
Owner Author

zmoog commented Oct 22, 2024

To make sense of these fields, here's the sample response and a screenshot from the app:

{
  "realtimeData": {
    "params": {
      "value": [
        {
          "123456789010": {
            "energyDischargingTotal": 739.8,
            "powerExporting": 0,
            "energyExportingTotal": 1327.9,
            "energyDischarging": 8.13,
            "batteryCycletime": 62,
            "lastUpdate": "2024-10-22T20:07:21Z",
            "energyGenerating": 20.46,
            "energyAutoconsumingTotal": 1130.3,
            "energyImporting": 4.0,
            "energyCharging": 4.67,
            "powerImporting": 880,
            "energyChargingTotal": 807.0,
            "energyConsumingTotal": 2100.2,
            "energyAutoconsuming": 15.61,
            "powerConsuming": 885,
            "energyConsuming": 27.74,
            "powerGenerating": 0,
            "energyImportingTotal": 546.1,
            "energyExporting": 0.18,
            "batterySoC": 20,
            "thingFind": "2024-06-04T08:55:36Z",
            "powerAutoconsuming": 0,
            "powerCharging": 0,
            "energyGeneratingTotal": 3265.2,
            "powerDischarging": 5
          }
        }
      ]
    },
    "success": true
  }
}

CleanShot 2024-10-24 at 08 15 15

@zmoog
Copy link
Owner Author

zmoog commented Oct 22, 2024

Note: The metrics are updated roughly every 5 minutes. Sometimes they stop updating for hours ¯_(ツ)_/¯

@zmoog
Copy link
Owner Author

zmoog commented Oct 24, 2024

The prototype zmoog/otel-collector-contrib#7 is up and running.

Here's the initial dashboard:

CleanShot 2024-10-24 at 08 24 05@2x

@zmoog
Copy link
Owner Author

zmoog commented Oct 24, 2024

Sometimes, the metrics from the endpoint https://third.zcsazzurroportal.com:19003 stop updating, and the endpoint returns the last update. For example,

{
  "realtimeData": {
    "params": {
      "value": [
        {
          "123456789010": {
            "energyDischargingTotal": 739.8,
            "powerExporting": 0,
            "energyExportingTotal": 1327.9,
            "energyDischarging": 8.13,
            "batteryCycletime": 62,
            "lastUpdate": "2024-10-22T20:07:21Z",
            "energyGenerating": 20.46,
            "energyAutoconsumingTotal": 1130.3,
            "energyImporting": 4.0,
            "energyCharging": 4.67,
            "powerImporting": 880,
            "energyChargingTotal": 807.0,
            "energyConsumingTotal": 2100.2,
            "energyAutoconsuming": 15.61,
            "powerConsuming": 885,
            "energyConsuming": 27.74,
            "powerGenerating": 0,
            "energyImportingTotal": 546.1,
            "energyExporting": 0.18,
            "batterySoC": 20,
            "thingFind": "2024-06-04T08:55:36Z",
            "powerAutoconsuming": 0,
            "powerCharging": 0,
            "energyGeneratingTotal": 3265.2,
            "powerDischarging": 5
          }
        }
      ]
    },
    "success": true
  }
}

Right now, the endpoint returns an empty response:

{
  "realtimeData": {
    "params": {
      "value": [
        {
          "123456789010": {}
        }
      ]
    },
    "success": true
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: In Progress
Development

No branches or pull requests

1 participant