make-all / tuya-local

Local support for Tuya devices in Home Assistant
MIT License
1.35k stars 522 forks source link

Request support for QLima D812 Smart dehumidfier #2477

Open DutchKillerbee opened 4 hours ago

DutchKillerbee commented 4 hours ago

Log message

Manually created qlima_d812smart_dehumidifier.yaml file works perfect.

name: Dehumidifier
products:
  - id: bf4c8535a63515943fz0kj
    name: Qlima D812 Smart
primary_entity:
  entity: humidifier
  class: dehumidifier
  dps:
    - id: 1
      type: boolean
      name: switch
    - id: 3
      type: integer
      name: humidity
      range:
        min: 40
        max: 60
      mapping:
        - step: 10
    - id: 19
      type: bitfield
      name: fault_code
secondary_entities:
  - entity: fan
    dps:
      - id: 1
        type: boolean
        name: switch
  - entity: binary_sensor
    class: problem
    category: diagnostic
    dps:
      - id: 19
        type: bitfield
        name: sensor
        mapping:
          - dps_val: 0
            value: false
          - value: true
  - entity: select
    translation_key: timer
    category: config
    dps:
      - id: 17
        type: string
        name: option
        mapping:
          - dps_val: cancel 
            value: cancel
          - dps_val: "2h"
            value: "2h"
          - dps_val: "4h"
            value: "4h"
          - dps_val: "6h"
            value: "6h"
  - entity: sensor
    translation_key: time_remaining
    class: duration
    category: diagnostic
    dps:
      - id: 18
        type: integer
        name: sensor
        unit: min

Product ID

bf4c8535a63515943fz0kj

Product Name

QLima D812 Smart

DPS information

Power dp 1
Countdown dp 17
Left time dp 18
deHumidify dp 3
fault dp 19

{
  "result": {
    "category": "cs",
    "functions": [
      {
        "code": "switch",
        "dp_id": 1,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "dehumidify_set_enum",
        "dp_id": 3,
        "type": "Enum",
        "values": "{\"range\":[\"30\",\"40\",\"50\"]}"
      },
      {
        "code": "countdown_set",
        "dp_id": 17,
        "type": "Enum",
        "values": "{\"range\":[\"cancel\",\"2h\"]}"
      }
    ],
    "lang_config": {},
    "status": [
      {
        "code": "switch",
        "dp_id": 1,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "dehumidify_set_enum",
        "dp_id": 3,
        "type": "Enum",
        "values": "{\"range\":[\"30\",\"40\",\"50\"]}"
      },
      {
        "code": "countdown_set",
        "dp_id": 17,
        "type": "Enum",
        "values": "{\"range\":[\"cancel\",\"2h\"]}"
      },
      {
        "code": "countdown_left",
        "dp_id": 18,
        "type": "Integer",
        "values": "{\"unit\":\"min\",\"min\":0,\"max\":360,\"scale\":0,\"step\":1}"
      },
      {
        "code": "fault",
        "dp_id": 19,
        "type": "Bitmap",
        "values": "{\"label\":[\"E1\",\"E2\"]}"
      }
    ]
  },
  "success": true,
  "t": 1706631506756,
  "tid": "32b7067abf8b11ee847d96852008b4f4"
}

Information about how the device functions

Similar to QLima D820a dehumidifier (already supported and a yaml file (qlima_d820a_dehumidifier.yaml) exists in the devices directory)

DutchKillerbee commented 4 hours ago

Hereby the yaml file: qlima_d812smart_dehumidifier.zip And a screenshot from HA image

DutchKillerbee commented 3 hours ago

And part of the HA logfile

2024-11-08 10:45:03.775 DEBUG (MainThread) [custom_components.tuya_local.device] QLima D812 Smart new pending updates: {"3": {"value": "40", "updated_at": 1731059103.7752094, "sent": false}}
2024-11-08 10:45:03.784 DEBUG (MainThread) [custom_components.tuya_local.device] QLima D812 Smart sending dps update: {"3": "40"}
2024-11-08 10:45:03.914 DEBUG (MainThread) [custom_components.tuya_local.device] QLima D812 Smart received {"3": "40", "full_poll": true}
2024-11-08 10:45:03.916 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Considering mapping for range of humidity
2024-11-08 10:45:03.916 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Considering mapping for range of humidity
2024-11-08 10:45:03.918 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Dehumidifier: Mapped dps 19 value from 0 to False
2024-11-08 10:45:03.918 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Dehumidifier: Mapped dps 19 value from 0 to False
2024-11-08 10:45:03.919 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] No mapping for dpid 18 (sensor), unable to determine valid values
2024-11-08 10:45:03.920 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] No mapping for dpid 18 (sensor), unable to determine valid values
2024-11-08 10:45:03.920 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] option values: ['cancel', '2h', '4h', '6h']
2024-11-08 10:45:03.921 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Dehumidifier: Mapped dps 17 value from 2h to 2h
2024-11-08 10:45:03.922 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Dehumidifier: Mapped dps 17 value from 2h to 2h
2024-11-08 10:45:03.922 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] option values: ['cancel', '2h', '4h', '6h']
2024-11-08 10:45:04.030 DEBUG (MainThread) [custom_components.tuya_local.device] QLima D812 Smart received {"1": true, "3": "40", "17": "2h", "18": 120, "19": 0, "full_poll": false}
2024-11-08 10:45:04.033 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Considering mapping for range of humidity
2024-11-08 10:45:04.034 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Considering mapping for range of humidity
2024-11-08 10:45:04.035 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Dehumidifier: Mapped dps 19 value from 0 to False
2024-11-08 10:45:04.035 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Dehumidifier: Mapped dps 19 value from 0 to False
2024-11-08 10:45:04.036 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] No mapping for dpid 18 (sensor), unable to determine valid values
2024-11-08 10:45:04.036 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] No mapping for dpid 18 (sensor), unable to determine valid values
2024-11-08 10:45:04.036 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] option values: ['cancel', '2h', '4h', '6h']
2024-11-08 10:45:04.037 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Dehumidifier: Mapped dps 17 value from 2h to 2h
2024-11-08 10:45:04.037 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Dehumidifier: Mapped dps 17 value from 2h to 2h
2024-11-08 10:45:04.037 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] option values: ['cancel', '2h', '4h', '6h']
2024-11-08 10:45:09.739 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Considering mapping for range of humidity
2024-11-08 10:45:09.740 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Considering mapping for range of humidity
2024-11-08 10:45:09.740 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Stepping 50 to 10
2024-11-08 10:45:09.741 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Dehumidifier: Mapped dps 3 to 50 from 50
2024-11-08 10:45:09.741 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Considering mapping for range of humidity
2024-11-08 10:45:09.741 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Rounding humidity
2024-11-08 10:45:09.741 DEBUG (MainThread) [custom_components.tuya_local.device] QLima D812 Smart new pending updates: {"3": {"value": "50", "updated_at": 1731059109.7417884, "sent": false}}
2024-11-08 10:45:09.744 DEBUG (MainThread) [custom_components.tuya_local.device] QLima D812 Smart sending dps update: {"3": "50"}
2024-11-08 10:45:09.974 DEBUG (MainThread) [custom_components.tuya_local.device] QLima D812 Smart received {"3": "50", "full_poll": true}
2024-11-08 10:45:09.976 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Considering mapping for range of humidity
2024-11-08 10:45:09.976 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Considering mapping for range of humidity
2024-11-08 10:45:09.979 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Dehumidifier: Mapped dps 19 value from 0 to False
2024-11-08 10:45:09.979 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Dehumidifier: Mapped dps 19 value from 0 to False
2024-11-08 10:45:09.982 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] No mapping for dpid 18 (sensor), unable to determine valid values
2024-11-08 10:45:09.983 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] No mapping for dpid 18 (sensor), unable to determine valid values
2024-11-08 10:45:09.983 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] option values: ['cancel', '2h', '4h', '6h']
2024-11-08 10:45:09.984 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Dehumidifier: Mapped dps 17 value from 2h to 2h
2024-11-08 10:45:09.984 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Dehumidifier: Mapped dps 17 value from 2h to 2h
2024-11-08 10:45:09.984 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] option values: ['cancel', '2h', '4h', '6h']
2024-11-08 10:45:10.100 DEBUG (MainThread) [custom_components.tuya_local.device] QLima D812 Smart received {"1": true, "3": "50", "17": "2h", "18": 120, "19": 0, "full_poll": false}
2024-11-08 10:45:10.103 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Considering mapping for range of humidity
2024-11-08 10:45:10.104 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Considering mapping for range of humidity
2024-11-08 10:45:10.105 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Dehumidifier: Mapped dps 19 value from 0 to False
2024-11-08 10:45:10.106 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Dehumidifier: Mapped dps 19 value from 0 to False
2024-11-08 10:45:10.107 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] No mapping for dpid 18 (sensor), unable to determine valid values
2024-11-08 10:45:10.107 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] No mapping for dpid 18 (sensor), unable to determine valid values
2024-11-08 10:45:10.108 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] option values: ['cancel', '2h', '4h', '6h']
2024-11-08 10:45:10.108 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Dehumidifier: Mapped dps 17 value from 2h to 2h
2024-11-08 10:45:10.109 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Dehumidifier: Mapped dps 17 value from 2h to 2h
2024-11-08 10:45:10.110 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] option values: ['cancel', '2h', '4h', '6h']