cjaliaga / aioaquarea

Asynchronous library to control Panasonic Aquarea devices
MIT License
11 stars 4 forks source link

Energy generation stats broken? #25

Open andrewkolak opened 8 months ago

andrewkolak commented 8 months ago

My Panasonic 3.2kW generation K returns 0 or NaN for energy generation option. Other features work fine. Is there a way to get current consumption and COP as well?

cjaliaga commented 7 months ago

I think this is an issue on the Panasonic Aquarea API not returning data. For me it also returns 0s and never returned anything else, I added it to the client just in case it returns data in the future or for any configuration distinct to mine. The best way to debug it is to open the Aquarea Smart Cloud page and use the developer tools of the browser, access the statistics section and you'll see the requests performed and the response.

Regarding COP and current consumption, that's something available in Aquarea Service Cloud (the one for installers) but not available in the Smart one (the one that we have to use here).

andrewkolak commented 7 months ago

Shame. Panasonic made users' data bare minimum :) So, I assume there is nothing what can be done (except using installers data).

cjaliaga commented 7 months ago

Shame. Panasonic made users' data bare minimum :) So, I assume there is nothing what can be done (except using installers data).

Yeah.... đŸ˜”Sometimes I think about trying to figure out how that service works, but let's be real, it's pretty complex. Thing is, I just don't have the time for it.

andrewkolak commented 7 months ago

Hi,

So I assume this is not as easy as switching API point? I would assume it's the "same infrastructure" just different server and API point. Besides many users do give installers access for maintenance, so in this case they won't have login details anyway. Maybe one day Panasonic will publish an official API for integrations, although I doubt.

cjaliaga commented 7 months ago

So I assume this is not as easy as switching API point? I would assume it's the "same infrastructure" just different server and API point. Besides many users do give installers access for maintenance, so in this case they won't have login details anyway.

Not at all. From my initial investigation, it seems a completely different API, different way of login in...

And the responses of the API are really self explanatory đŸ¤£. One example:

{
    "connectionStatus": 0,
    "cnCntErrorStatus": 0,
    "errorCode": 0,
    "statusDataInfo": {
        "function-status-text-005": {
            "textValue": "2006-0310",
            "type": "basic-text"
        },
        "function-status-text-027": {
            "type": "simple-value",
            "value": "42"
        },
        "function-status-text-049": {
            "type": "simple-value",
            "value": ""
        },
        "function-status-text-025": {
            "type": "simple-value",
            "value": "41"
        },
        "function-status-text-047": {
            "type": "simple-value",
            "value": ""
        },
        "function-status-text-068": {
            "type": "simple-value",
            "value": "0"
        },
        "function-status-text-009": {
            "type": "simple-value",
            "value": "32"
        },
        "function-status-text-007": {
            "textValue": "2006-0339",
            "type": "basic-text"
        },
        "function-status-text-029": {
            "type": "simple-value",
            "value": ""
        },
        "function-status-text-041": {
            "textValue": "2006-0960",
            "type": "basic-text"
        }
andrewkolak commented 7 months ago

Hmm... And tis can't be linked to actual data in the installers page, so we know which value represents what? I assume code in HeishaMon is no help as this is yet very different data/approach.

cjaliaga commented 7 months ago

It can be linked to the actual data, that's for sure but it requires time and patience, checking how the page uses the values from the JSON responses... We would need to reverse engineer all the login process as well, the flow the page follows in order to get from the username/password (login process) to the customers -> devices... Doable? Maybe... couldn't say until we have tried.

I would love for Panasonic to stop considering users "unqualified individuals" and offer those values on their user facing apps instead of just considering that information "installers only". If they only added the info to the APIs even if their official app are not exposing it (yet), we could make use if it. Maybe we could try to establish a communication channel to the team that handles this service, that would make all this work quite easier.

andrewkolak commented 7 months ago

I have some experience in working with "manufactures" and I feel that no one from Panasonic would ever bother to talk to us. Finding values should be doable, but I assume login procedure could be actually more tricky (I know only basic Python and login procedures always been nightmare for me). Also- there is still issue with kicking out installer from accessing the pump, which somehow I don't really want to do (or keep asking him to link back). Maybe one day Panasonic will expose actual API to users.