sockless-coding / panasonic_cc

Panasonic Comfort Cloud - Home Assistant Component
MIT License
140 stars 35 forks source link

Wrong value - Fan mode is not Fan mode? #214

Closed mkz212 closed 1 month ago

mkz212 commented 3 months ago

In custom_components/panasonic_cc/pcomfortcloud/constants.py:

class OperationMode(Enum):
    Auto = 0
    Dry = 1
    Cool = 2
    Heat = 3
    Fan = 4

But i think that 4 is for Fan OR Nanoe Stand Alone mode ! (And maybe also for iAutoX.)

When parameters.lastSettingMode = 1 -> Fan Mode When parameters.lastSettingMode = 2 -> Nanoe Stand Alone Mode (mode like heat, cool, etc, not additional function!)

I checked and it really reads it that way. But for some reason server does not take value lastSettingMode.

Maybe someone can check how looks request from app when Nanoe Stand Alone or Fan Mode is setting up?

https://www.panasonic.com/global/hvac/products/comfort-cloud/how-to-use-comfort-cloud/choose-air-conditioner-operation-mode.html

mkz212 commented 3 months ago

@heldchen If you still have this whole setup to check how the queries from the application look, could you check how Nanoe Stand Alone Mode (mode, not function!) is set and how Fan Mode?

heldchen commented 3 months ago

this depends on the AC model. one of my ac f.e. has no fan_only mode (in the app, but can still be set to fan_only successfully in HA). so I am not sure what exactly you're looking for. please add a screenshot of the app and mark the buttons I should test/log.

mkz212 commented 3 months ago

I dont have button to enable Fan Mode but as you can see it is active when I turn it on from HomeKit.

IMG_6220

And here is Nanoe Stand Alone Mode:

IMG_6220

heldchen commented 3 months ago

afaik the nanoex mode corresponds to fan_only (your 2nd screenshot). I have the same: image

for another model that I have, it looks similar but has no dedicated fan mode buttons: image

mkz212 commented 3 months ago

@heldchen

Responses:

Fan Mode: params.operationMode = 4 parameters.lastSettingMode = 1

Nanoe Stand Alone Mode: params.operationMode = 4 parameters.lastSettingMode = 2

But i cannot set value for lastSettingMode.

See link in my first post. Manual from Panasonic. Fan mode it is not Nanoe Stand Alone mode.

And it certainly does not happen on the principle that params.operationMode = 4 is sent and the server selects the appropriate options based on what the air conditioning has. Because my air conditioning in theory has Nanoe Stand Alone and it does not have Fan Mode and it still sets Fan Mode, even that in the Panasonic application this option does not have a button and is hidden.

So can you check what happens when you turn on the Nanoe Stand Alone option in the application? What commands are sent, what parameters, etc.?

heldchen commented 3 months ago

Nanoe:

{
  "deviceGuid": "CZ-RTC6BLW+8C5<REDACTED>",
  "parameters": {
    "fanSpeed": 5,
    "operationMode": 5
  }
}

Cool:

{
  "deviceGuid": "CZ-RTC6BLW+8C5<REDACTED>",
  "parameters": {
    "fanSpeed": 5,
    "operationMode": 2
  }
}

Dry:

{
  "deviceGuid": "CZ-RTC6BLW+8C5<REDACTED>",
  "parameters": {
    "fanSpeed": 5,
    "operationMode": 1,
    "temperatureSet": 24
  }
}

Heat:

{
  "deviceGuid": "CZ-RTC6BLW+8C5<REDACTED>",
  "parameters": {
    "fanSpeed": 5,
    "operationMode": 3,
    "temperatureSet": 18
  }
}

Auto:

{
  "deviceGuid": "CZ-RTC6BLW+8C5<REDACTED>",
  "parameters": {
    "operationMode": 0,
    "temperatureSet": 20.5
  }
}

Device status:

{
  "timestamp": 1719316441355,
  "permission": 3,
  "summerHouse": 0,
  "iAutoX": false,
  "nanoe": true,
  "nanoeStandAlone": true,
  "autoMode": true,
  "heatMode": true,
  "fanMode": false,
  "dryMode": true,
  "coolMode": true,
  "ecoNavi": false,
  "powerfulMode": true,
  "quietMode": true,
  "airSwingLR": true,
  "autoSwingUD": false,
  "ecoFunction": 0,
  "temperatureUnit": 0,
  "modeAvlList": {
    "autoMode": 1
  },
  "nanoeList": {
    "visualizationShow": 0
  },
  "clothesDrying": false,
  "insideCleaning": false,
  "fireplace": false,
  "autoTempMax": 27,
  "autoTempMin": 17,
  "dryTempMax": 30,
  "dryTempMin": 18,
  "coolTempMax": 30,
  "coolTempMin": 18,
  "heatTempMax": 30,
  "heatTempMin": 18,
  "fanSpeedMode": 5,
  "fanDirectionMode": 5,
  "parameters": {
    "ecoFunctionData": 0,
    "insideCleaning": 0,
    "fireplace": 0,
    "lastSettingMode": 0,
    "operate": 1,
    "operationMode": 0,
    "temperatureSet": 20.5,
    "fanSpeed": 5,
    "fanAutoMode": 1,
    "airSwingLR": 2,
    "airSwingUD": 4,
    "ecoMode": 0,
    "ecoNavi": 0,
    "nanoe": 2,
    "iAuto": 0,
    "airDirection": 1,
    "insideTemperature": 20,
    "outTemperature": 26,
    "airQuality": 0
  },
  "deviceNanoe": 1,
  "visualizationAvlFlg": false
}
mkz212 commented 3 months ago
{
  "deviceGuid": "CZ-RTC6BLW+8C5<REDACTED>",
  "parameters": {
    "fanSpeed": 5,
    "operationMode": 5
  }
}

Oh Thaks! 👍 I was just about to try other values for operationMode.

heldchen commented 3 months ago

lastSettingMode is not something that these devices seem to support, it's only shown in the get-groups call:

{
  "uiFlg": false,
  "groupCount": 1,
  "groupList": [
    {
      "groupId": 1<REDACTED>,
      "groupName": "My House",
      "pairingList": [],
      "deviceList": [
        {
          "deviceGuid": "CS-Z25ZKEW+E06<REDACTED>",
          "deviceType": "3",
          "deviceName": "Schlafzimmer",
          "permission": 3,
          "temperatureUnit": 0,
          "summerHouse": 0,
          "nanoeStandAlone": true,
          "autoMode": true,
          "modeAvlList": {
            "autoMode": 1
          },
          "parameters": {
            "operate": 0,
            "operationMode": 2,
            "temperatureSet": 20,
            "fanSpeed": 0,
            "fanAutoMode": 1,
            "airSwingLR": 0,
            "airSwingUD": 0,
            "ecoFunctionData": 0,
            "ecoMode": 2,
            "ecoNavi": 0,
            "nanoe": 2,
            "iAuto": 0,
            "airDirection": 0,
            "lastSettingMode": 0
          },
          "deviceModuleNumber": "CS-Z25ZKEW",
          "deviceHashGuid": "26e<REDACTED>",
          "modelVersion": 2,
          "coordinableFlg": true,
          "pairedFlg": false
        },
        {
          "deviceGuid": "CZ-RTC6BLW+8C5<REDACTED>",
          "deviceType": "5",
          "deviceName": "Essen",
          "permission": 3,
          "temperatureUnit": 0,
          "summerHouse": 0,
          "nanoeStandAlone": true,
          "autoMode": true,
          "modeAvlList": {
            "autoMode": 1
          },
          "parameters": {
            "operate": 1,
            "operationMode": 2,
            "temperatureSet": 20,
            "fanSpeed": 3,
            "fanAutoMode": 1,
            "airSwingLR": 2,
            "airSwingUD": 0,
            "ecoFunctionData": 0,
            "ecoMode": 0,
            "ecoNavi": 0,
            "nanoe": 2,
            "iAuto": 0,
            "airDirection": 1,
            "lastSettingMode": 0
          },
          "deviceModuleNumber": "S-50PY3E",
          "deviceHashGuid": "fa4<REDACTED>"
        }
      ]
    }
  ]
}
mkz212 commented 3 months ago

To set Fan mode: operationMode = 4

To read Fan mode: operationMode = 4 AND lastSettingMode =1

To set Nanoe Stand Alone Mode: operationMode = 5

To read Nanoe Stand Alone mode: operationMode = 4 AND lastSettingMode = 2 (Yes! 4! Not 5!)

Confirmed and working! Thank you!

sockless-coding commented 1 month ago

I've added better feature support checks in v1.1.0 so only the relevant modes should be available.