aturri / ha-zcsazzurro

A modern integration for ZCS Azzurro devices in Home Assistant
MIT License
23 stars 6 forks source link

Autoconsumed Power should acknowledge Battery consumption #14

Open Azokul opened 1 year ago

Azokul commented 1 year ago

Feature request

Hi, So, after a little bit of testing and tweaking I found out that AutoConsumed power doesn't really take into consideration the energy provided by the battery.

If possible it would be awesome to be able to have a separate sensor that take in consideration the usage of the battery or having it implemented directly on the AutoconsumedPower.

What version of the integration are you using?

0.0.8

Anything in the logs that might be useful for us?

No response

Additional information

No response

aturri commented 1 year ago

Hi @Azokul, this integration is reporting the data taken from ZCS API as-is. This is an example of data retrieved from their API:

{
    "xxxxxxxxx": {
        "energyAutoconsuming": 0.13,
        "energyAutoconsumingTotal": 341.2,
        "lastUpdate": "2023-06-29T06:16:00Z",
        "energyDischarging": 2.2,
        "powerDischarging": 0,
        "powerImporting": 560,
        "energyChargingTotal": 147.1,
        "batterySoC": 29,
        "powerGenerating": 266,
        "energyGeneratingTotal": 2106.7,
        "powerConsuming": 826,
        "energyExportingTotal": 1618.4,
        "energyImportingTotal": 274.7,
        "energyConsuming": 6.21,
        "powerExporting": 0,
        "batteryCycletime": 10,
        "thingFind": "2022-01-09T12:01:32Z",
        "energyDischargingTotal": 106.9,
        "energyCharging": 0.0,
        "powerCharging": 0,
        "energyConsumingTotal": 722.8,
        "powerAutoconsuming": 266,
        "energyGenerating": 0.15,
        "energyExporting": 0.02,
        "energyImporting": 3.88
    }
}

If this is information you need can be expressed as an arithmetic operation between the data from their API, then it is possible to show it into the HA integration. Otherwise, it is necessary to keep the state into HA, but then it becomes difficult to handle (also due to the fact that a reboot might loose data etc.).

Thank you Andrea

Azokul commented 1 year ago

Ah i see, thanks! I think i might be able to derive it then ^_^