bodyscape / cielo_home

Integration with Cielo Home
Apache License 2.0
44 stars 10 forks source link

Error while setting up cielo_home platform for climate #30

Closed ashishpandey closed 8 months ago

ashishpandey commented 9 months ago

I am getting the below error in HA logs and the climate entity doesn't show up. I do have individual controls and sensors show up in this integration, and I can use the switch to turn my AC on and off.

Home Assistant 2023.9.2 Breez Eco, Firmware: 1.0.9,2.4.0 cielo_home v1.6.2 installed via HACS

Any suggestions on how to troubleshoot this error

Logger: homeassistant.components.climate
Source: custom_components/cielo_home/cielohomedevice.py:555
Integration: Climate (documentation, issues)
First occurred: 10:53:16 PM (1 occurrences)
Last logged: 10:53:16 PM

Error while setting up cielo_home platform for climate
Traceback (most recent call last):
  File "/lsiopy/lib/python3.11/site-packages/homeassistant/helpers/entity_platform.py", line 359, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/cielo_home/climate.py", line 49, in async_setup_entry
    entity = CieloHomeThermostat(device)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/cielo_home/climate.py", line 101, in __init__
    self._attr_min_temp = self._device.get_min_temp()
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/cielo_home/cielohomedevice.py", line 555, in get_min_temp
    self.get_unit_of_temperature(), device_unit, int(range_temps[0])
                                                 ^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: 'inc'
ashishpandey commented 9 months ago

Also noticing that my device info screen looks a bit incomplete as compared to example in readme. specifically, HVAC and swing options are empty, fan entry and few other rows are missing. I can see these controls on cielo web Wondering if something changed with firmware 1.0.9. What can I do to help investigate?

Screenshot 2023-09-24 at 2 52 59 PM
ashishpandey commented 9 months ago

I think I know the issue. I have a screenless AC model, these don't have 2-way communication with the applicance, only allow fire and forget commands. so the payload is a bit different from the API. I'll experiment a bit and see if I can make it work. If something substantial, might send a PR for review

example payload

{
        "protocolId": 467,
        "applianceId": 2238,
        "manufacturerId": 202,
        "name": "Cielo",
        "modelNumber": "Model 237 Screenless",
        "isFaren": 0,
        "temp": "inc:dec",
        "tempIncrement": 1,
        "mode": "mode",
        "isMultiModeTempRange": 0,
        "modesTemp": [],
        "fan": "fanspeed",
        "swing": "swing",
        "showSwingTray": 0,
        "isScreenless": 1,
        "is485IR": 0,
        "modeRules": {
          "mode": {
            "mode_rules": "default:default:default",
            "ui_rules": "default:default:default"
          }
        },
        "isDisplayLight": 0,
        "isLightBasestring": 0,
        "isSwingBasestring": 1,
        "isTurboBasestring": 0,
        "displayLight": "on:off",
        "oppositeUnitId": 0,
        "isTurboDisplay": 0,
        "turboConfig": "",
        "turbo": "",
        "isFreezepointDisplay": 0,
        "freezepointConfig": "",
        "freezepoint": "freezepoint",
        "isFollowmeDisplay": 0,
        "followmeConfig": "",
        "followme": "",
        "serviceFunctions": null,
        "serviceFunctionsDefault": null,
        "isServFuncDisplay": 0,
        "isEvenTemp": 1
      }
bodyscape commented 9 months ago

Screenshot_20230924-063104.png

Give me the response json data from the applianceidlist and the devices url.

ashishpandey commented 9 months ago

here you go

devices

{
  "status": 200,
  "message": "SUCCESS",
  "data": {
      "iosVersion": "4.4.0",
      "iosLatestVersion": "4.4.0",
      "iosExpiryTime": 1640977200,
      "androidVersion": "5.4.6",
      "androidLatestVersion": "5.5.4",
      "androidExpiryTime": 1640977200,
      "manufactureDBversion": "1009.15",
      "comfyMinimumLimit": {
          "fahRoomTemp": 0,
          "celRoomTemp": 0,
          "roomHumidity": 3
      },
      "listDevices": [
          {
              "isLocalDbAck": 1,
              "deviceId": "mqUfmk",
              "isFaren": 0,
              "macAddress": "483FDA7C74B6",
              "deviceName": "cooler",
              "fwVersion": "1.0.9,2.4.0",
              "connectionSource": 1,
              "deviceType": "BREEZ-ECO",
              "deviceTypeVersion": "BB02",
              "suggestedRemotes": [
                  {
                      "applianceId": "2238",
                      "protocolId": 467,
                      "isFaren": 0,
                      "priority": 6
                  }
              ],
              "broadcastName": "Cielo_BB02_7C62C8",
              "deviceTimeZone": "+08:00",
              "deviceTimeZoneName": "Asia/Singapore",
              "applianceId": 2239,
              "applianceType": "AC",
              "isEnergyDevice": 0,
              "createdAt": 1695053236,
              "retainCreatedAt": 1695053236,
              "deviceStatus": 1,
              "latestAction": {
                  "uirules": "default:default:default:default",
                  "deviceStatus": "off",
                  "temp": "20",
                  "actionSource": "DeviceAction",
                  "statustimestamp": "1695523154",
                  "fanspeed": "fanspeed",
                  "mode": "mode",
                  "swing": "swing",
                  "followme": "off",
                  "ontimestamp": "1695559076",
                  "power": "on",
                  "modeTimestamp": "1695042584",
                  "timestamp": "1695559076",
                  "moderules": "default:default:default:default"
              },
              "wifiName": "coriander",
              "userId": "1XthWgtrwA",
              "applianceSubtype": 1,
              "isOnceSyncedState": 1,
              "isFotaRequired": 1,
              "isUpdatingFw": 0,
              "fwInitiatedAt": 0,
              "fpFailureAttempts": 0,
              "fpSuccessAttempts": 0,
              "turboFailureAttempts": 0,
              "turboSuccessAttempts": 0,
              "scheduleDetails": {},
              "isBlocked": 0,
              "blockMessage": "Unblocked",
              "groupId": "-1",
              "deviceSettings": {
                  "tbenabled": "1"
              },
              "latestBucketError": "0",
              "thermostatDeviceId": "N/A",
              "structureId": "N/A",
              "thermostatHomeAway": {},
              "isBacktrackEnabled": 1,
              "latEnv": {
                  "temp": 28.0,
                  "humidity": 48.0
              },
              "humCalibrationOffset": "0",
              "tempCalibrationOffset": "0",
              "isHumCalibrationSync": 1,
              "isTempCalibrationSync": 1,
              "myRules": [],
              "myRuleConfiguration": {},
              "deviceFilterDuration": "87",
              "deviceFilterFlag": 1,
              "filterTimestamp": 1695559076,
              "deviceFilterDurationValue": 5234,
              "isWifiDisabled": 0,
              "priority": 1,
              "bb02Color": 1
          }
      ],
      "listGroups": [],
      "devicesCount": 1
  }
}

applianceIdList

{
  "status": 200,
  "message": "SUCCESS",
  "data": {
    "listAppliances": [
      {
        "protocolId": 467,
        "applianceId": 2238,
        "manufacturerId": 202,
        "name": "Cielo",
        "modelNumber": "Model 237 Screenless",
        "isFaren": 0,
        "temp": "inc:dec",
        "tempIncrement": 1,
        "mode": "mode",
        "isMultiModeTempRange": 0,
        "modesTemp": [],
        "fan": "fanspeed",
        "swing": "swing",
        "showSwingTray": 0,
        "isScreenless": 1,
        "is485IR": 0,
        "modeRules": {
          "mode": {
            "mode_rules": "default:default:default",
            "ui_rules": "default:default:default"
          }
        },
        "isDisplayLight": 0,
        "isLightBasestring": 0,
        "isSwingBasestring": 1,
        "isTurboBasestring": 0,
        "displayLight": "on:off",
        "oppositeUnitId": 0,
        "isTurboDisplay": 0,
        "turboConfig": "",
        "turbo": "",
        "isFreezepointDisplay": 0,
        "freezepointConfig": "",
        "freezepoint": "freezepoint",
        "isFollowmeDisplay": 0,
        "followmeConfig": "",
        "followme": "",
        "serviceFunctions": null,
        "serviceFunctionsDefault": null,
        "isServFuncDisplay": 0,
        "isEvenTemp": 1
      }
    ]
  }
}
bodyscape commented 9 months ago

@ashishpandey in var "temp": "inc:dec". It's suppose to be two number. like "temp": "12:35". It's weird!

ashishpandey commented 9 months ago

Screenless remotes (isScreenless: 1) don't get the temp reading back from the air conditioner. They can only send a one unit temperature up or down command without knowing a current value. Same applies for mode, fan and swing. Each of those can only send a command to the AC that cycles to the next mode without knowing what the current value is.

bodyscape commented 9 months ago

@ashishpandey try the version 1.6.3