tuya / tuya-home-assistant

Home Assistant integration for controlling Powered by Tuya (PBT) devices using Tuya Open API, maintained by the Home Assistant Community and Tuya Developer Team.
MIT License
871 stars 206 forks source link

Proscenic A9 purifier support not functioning correctly #727

Open michaelmior opened 2 years ago

michaelmior commented 2 years ago

I'm having issue with my air purifier support. I only get four entities in HA: fan.a9, switch.a9_child_lock, switch.a9_filter_cartridge_reset, and switch.a9_power. Nothing about the air quality or the other info available via the Tuya IoT cloud. However, the bigger problem is that the power status is not reported correctly. I can use the switch to turn the purifier on, but in HA, the switch resets to off after a few seconds and the state shows as unavailable.

Device normal info

Device info

{
  "result": {
    "active_time": 1637763360,
    "biz_type": 0,
    "category": "kj",
    "create_time": 1614036229,
    "icon": "smart/icon/ay1533718828917HNmxD/538907f85c58eed4490ad81ded112c55.png",
    "id": "xxxxxxxx",
    "ip": "xxxxxxxx",
    "lat": "xxxxxxxx",
    "local_key": "xxxxxxxx",
    "lon": "xxxxxxxx",
    "name": "A9",
    "online": true,
    "owner_id": "xxxxxxxx",
    "product_id": "giwqfeiezesbkkbe",
    "product_name": "A9",
    "status": [
      {
        "code": "switch",
        "value": true
      },
      {
        "code": "pm25",
        "value": 5
      },
      {
        "code": "filter",
        "value": 41
      },
      {
        "code": "lock",
        "value": false
      },
      {
        "code": "light",
        "value": false
      },
      {
        "code": "filter_reset",
        "value": true
      },
      {
        "code": "filter_days",
        "value": 1257
      },
      {
        "code": "total_time",
        "value": 0
      },
      {
        "code": "total_pm",
        "value": 0
      },
      {
        "code": "air_quality",
        "value": "mild"
      },
      {
        "code": "fault",
        "value": 0
      }
    ],
    "sub": false,
    "time_zone": "-05:00",
    "uid": "xxxxxxxx",
    "update_time": 1638640760,
    "uuid": "xxxxxxxx"
  },
  "success": true,
  "t": 1639063338759
}

Device specifications

{
  "result": {
    "category": "kj",
    "functions": [
      {
        "code": "switch",
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "lock",
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "light",
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "filter_reset",
        "type": "Boolean",
        "values": "{}"
      }
    ],
    "status": [
      {
        "code": "switch",
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "pm25",
        "type": "Integer",
        "values": "{\"unit\":\"\",\"min\":0,\"max\":999,\"scale\":0,\"step\":1}"
      },
      {
        "code": "filter",
        "type": "Integer",
        "values": "{\"unit\":\"%\",\"min\":0,\"max\":100,\"scale\":0,\"step\":1}"
      },
      {
        "code": "lock",
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "light",
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "filter_reset",
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "filter_days",
        "type": "Integer",
        "values": "{\"unit\":\"h\",\"min\":0,\"max\":3000,\"scale\":0,\"step\":1}"
      },
      {
        "code": "total_time",
        "type": "Integer",
        "values": "{\"unit\":\"min\",\"min\":0,\"max\":5256000,\"scale\":0,\"step\":1}"
      },
      {
        "code": "total_pm",
        "type": "Integer",
        "values": "{\"unit\":\"mg\",\"min\":0,\"max\":10000000,\"scale\":0,\"step\":1}"
      },
      {
        "code": "air_quality",
        "type": "Enum",
        "values": "{\"range\":[\"great\",\"mild\",\"good\",\"medium\",\"severe\"]}"
      },
      {
        "code": "fault",
        "type": "Bitmap",
        "values": "{\"label\":[\"e1\",\"e2\"]}"
      }
    ]
  },
  "success": true,
  "t": 1639063367353
}
frenck commented 2 years ago

Yesterday, Home Assistant 2022.2 was released. Could you try upgrading to that version and see if the issue has been resolved?

If not, Home Assistant 2022.2 contains a new diagnostic tool. There is now a "Download Diagnostics" button on each Tuya device on the device page. Clicking that button will download diagnostics information for that specific device. Drag the downloaded file into this issue. It will help with finding out what the problem is.

michaelmior commented 2 years ago

Still the same issue which doesn't seem surprising since the Tuya integration was not updated. Diagnostics attached although I'm not sure there's any new information in there.

tuya-22e5df0b379da460a633ca799f955b54-A9-62c150550962fedef614f909566e4bd4.json.txt .

frenck commented 2 years ago

Still the same issue which doesn't seem surprising since the Tuya integration was not updated.

? It was, yesterday a new Home Assistant was released, with quite a lot of changes to Tuya actually...

frenck commented 2 years ago

Looked at the diagnostic file, that is helpful. Will add this to my list of things to do 👍

michaelmior commented 2 years ago

Whoops, I guess I missed the Tuya changes. Anyway, thank you for taking a look!