make-all / tuya-local

Local support for Tuya devices in Home Assistant
MIT License
1.39k stars 535 forks source link

Request support for Linptech G6L Wireless Doorbell (category 'wxml') #2504

Open megadimich opened 1 day ago

megadimich commented 1 day ago

Log message

{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2024.11.1",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.12.4",
    "docker": true,
    "arch": "x86_64",
    "timezone": "Europe/Kiev",
    "os_name": "Linux",
    "os_version": "6.6.54-haos",
    "supervisor": "2024.11.2",
    "host_os": "Home Assistant OS 13.2",
    "docker_version": "27.2.0",
    "chassis": "vm",
    "run_as_root": true
  },
  "custom_components": {
    "tuya_local": {
      "documentation": "https://github.com/make-all/tuya-local",
      "version": "2024.11.2",
      "requirements": [
        "tinytuya==1.15.1",
        "tuya-device-sharing-sdk>=0.1.9,<=0.2.99"
      ]
    },
    "hacs": {
      "documentation": "https://hacs.xyz/docs/configuration/start",
      "version": "2.0.1",
      "requirements": [
        "aiogithubapi>=22.10.1"
      ]
    }
  },
  "integration_manifest": {
    "domain": "tuya_local",
    "name": "Tuya Local",
    "codeowners": [
      "make-all"
    ],
    "config_flow": true,
    "dependencies": [],
    "documentation": "https://github.com/make-all/tuya-local",
    "integration_type": "device",
    "iot_class": "local_push",
    "issue_tracker": "https://github.com/make-all/tuya-local/issues",
    "requirements": [
      "tinytuya==1.15.1",
      "tuya-device-sharing-sdk>=0.1.9,<=0.2.99"
    ],
    "version": "2024.11.2",
    "is_built_in": false,
    "overwrites_built_in": false
  },
  "setup_times": {
    "null": {
      "setup": 2.2824970073997974e-05
    },
    "01JBAPWQADV5JKDWZV6RS750Z2": {
      "wait_import_platforms": -3.8165155720198527,
      "config_entry_setup": 3.9648274670471437
    }
  },
  "data": {
    "name": "Doorbell",
    "type": "whm04_doorbell",
    "device_id": "**REDACTED**",
    "device_cid": "",
    "local_key": "**REDACTED**",
    "host": "**REDACTED**",
    "protocol_version": 3.3,
    "tinytuya_version": "1.15.1",
    "api_version_set": 3.3,
    "api_version_used": 3.3,
    "api_working": true,
    "status": {},
    "cached_state": {
      "updated_at": 1731622789.7582362,
      "2": 1,
      "3": 1,
      "6": false,
      "10": 1
    },
    "pending_state": {},
    "connected": true,
    "force_dps": [],
    "home_assistant": {
      "name": "Doorbell",
      "name_by_user": null,
      "disabled": false,
      "disabled_by": null,
      "entities": [
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": null,
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "siren.doorbell",
            "state": "on",
            "attributes": {
              "available_tones": [
                "dingdong",
                "vacal",
                "Polka Italienne",
                "Carmen prelude",
                "Old ringtones",
                "Westminster Chimes",
                "Radetzky Marsch",
                "vocal 135i",
                "vocal i531",
                "DO-RE-MI",
                "Go home",
                "Scarborough fair",
                "Di spagna sono la Bella",
                "Libiamo ne",
                "Greensleeves",
                "Rondo Alla Turca",
                "Oh! Friends",
                "the golden Jubilee",
                "Merry Christmas",
                "Minuet",
                "Music box dancer",
                "Lonely Goatherd",
                "Russe Dance",
                "For Alice",
                "Memory",
                "The William tell overture",
                "happy birthday",
                "Mozart",
                "Edelweiss",
                "Red River Valley",
                "Jingle Bells",
                "Su San Na",
                "Rhytm of the rain",
                "Romance De Amour",
                "Moscow Nights",
                "Telephone ringing",
                "Yesenia",
                "Flute dance",
                "Alarm"
              ],
              "tone": "dingdong",
              "volume_level": 0.01,
              "doorbell_call": 1,
              "icon": "mdi:bell",
              "friendly_name": "Doorbell",
              "supported_features": 15
            },
            "last_changed": "2024-11-14T19:33:34.566870+00:00",
            "last_reported": "2024-11-14T19:33:34.566870+00:00",
            "last_updated": "2024-11-14T19:33:34.566870+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": null,
          "device_class": null,
          "original_device_class": "sound",
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "binary_sensor.doorbell_ringing",
            "state": "off",
            "attributes": {
              "device_class": "sound",
              "friendly_name": "Doorbell Ringing"
            },
            "last_changed": "2024-11-14T19:33:34.566299+00:00",
            "last_reported": "2024-11-14T19:33:34.572439+00:00",
            "last_updated": "2024-11-14T19:33:34.566299+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "config",
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "switch.doorbell_mobile_notifications",
            "state": "off",
            "attributes": {
              "icon": "mdi:message-alert",
              "friendly_name": "Doorbell Mobile notifications"
            },
            "last_changed": "2024-11-14T19:33:34.566424+00:00",
            "last_reported": "2024-11-14T19:33:34.566424+00:00",
            "last_updated": "2024-11-14T19:33:34.566424+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "diagnostic",
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "sensor.doorbell_button",
            "state": "unknown",
            "attributes": {
              "friendly_name": "Doorbell Button"
            },
            "last_changed": "2024-11-14T19:33:34.566535+00:00",
            "last_reported": "2024-11-14T19:33:34.566535+00:00",
            "last_updated": "2024-11-14T19:33:34.566535+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": null,
          "device_class": null,
          "original_device_class": "doorbell",
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "event.doorbell_doorbell",
            "state": "unknown",
            "attributes": {
              "event_types": [
                null,
                "ring"
              ],
              "event_type": null,
              "device_class": "doorbell",
              "friendly_name": "Doorbell Doorbell"
            },
            "last_changed": "2024-11-14T19:33:34.566631+00:00",
            "last_reported": "2024-11-14T19:33:34.566631+00:00",
            "last_updated": "2024-11-14T19:33:34.566631+00:00"
          }
        }
      ]
    }
  }
}

Product ID

gznianheex1wcv5b

Product Name

Self-powered wireless doorbell G6L

DPS information

{
            "active_time": 1678379561,
            "biz_type": 0,
            "category": "wxml",
            "create_time": 1678379561,
            "icon": "smart/icon/ay1541129189848tRH06/35acdd39aaead0bfb1b84f729be92f8d.png",
            "id": "bfd316663c2c14324dzvqb",
            "ip": "XXX.XXX.XXX.XXX",
            "lat": "XX.XX",
            "local_key": "****************",
            "lon": "XX.X",
            "model": "G6L",
            "name": "\u0417\u0432\u043e\u043d\u043e\u043a",
            "online": true,
            "owner_id": "82840616",
            "product_id": "gznianheex1wcv5b",
            "product_name": "Self-powered wireless doorbell G6L",
            "status": [
                {
                    "code": "doorbell_list_data",
                    "value": "AgQBAQwBCAD/EABEAG8AbwByAEIAZQBsAGw="
                },
                {
                    "code": "doorbell_ring_value",
                    "value": 1
                },
                {
                    "code": "doorbell_volume_value",
                    "value": 1
                },
                {
                    "code": "alarm_message",
                    "value": "AEQAbwBvAHIAQgBlAGwAbA=="
                },
                {
                    "code": "alarm_propel_switch",
                    "value": false
                },
                {
                    "code": "disturb_time_set",
                    "value": "AAAFZAFo"
                },
                {
                    "code": "doorbell_call",
                    "value": 1
                }
            ],
            "sub": false,
            "time_zone": "+02:00",
            "uid": "eu1677504406180dF94X",
            "update_time": 1729500878,
            "uuid": "8af907392527a255",
            "mapping": {
                "1": {
                    "code": "doorbell_list_data",
                    "type": "Raw",
                    "values": {
                        "maxlen": 128
                    }
                },
                "2": {
                    "code": "doorbell_ring_value",
                    "type": "Integer",
                    "values": {
                        "unit": "",
                        "min": 1,
                        "max": 40,
                        "scale": 0,
                        "step": 1
                    }
                },
                "3": {
                    "code": "doorbell_volume_value",
                    "type": "Integer",
                    "values": {
                        "unit": "",
                        "min": 0,
                        "max": 8,
                        "scale": 0,
                        "step": 1
                    }
                },
                "5": {
                    "code": "alarm_message",
                    "type": "Raw",
                    "values": {
                        "maxlen": 128
                    }
                },
                "6": {
                    "code": "alarm_propel_switch",
                    "type": "Boolean",
                    "values": {}
                },
                "7": {
                    "code": "disturb_time_set",
                    "type": "Raw",
                    "values": {
                        "maxlen": 128
                    }
                },
                "10": {
                    "code": "doorbell_call",
                    "type": "Integer",
                    "values": {
                        "min": 1,
                        "max": 255,
                        "scale": 0,
                        "step": 1
                    }
                }
            }
        }

API result from iot.tuya.com (under Cloud / API Explorer / Device Control :
{
  "result": {
    "model": "{\"modelId\":\"000002qqw6\",\"services\":[{\"actions\":[],\"code\":\"\",\"description\":\"\",\"events\":[],\"name\":\"默认服务\",\"properties\":[{\"abilityId\":1,\"accessMode\":\"rw\",\"code\":\"doorbell_list_data\",\"description\":\"01是查询数量   02是获取列表 03是读取  04是修改   05是删除  06是添加  07是退出添加\",\"extensions\":{\"attribute\":\"736\"},\"name\":\"门铃列表数据\",\"typeSpec\":{\"type\":\"raw\",\"maxlen\":128}},{\"abilityId\":2,\"accessMode\":\"rw\",\"code\":\"doorbell_ring_value\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-baojing\",\"attribute\":\"676\"},\"name\":\"门铃铃声\",\"typeSpec\":{\"type\":\"value\",\"max\":40,\"min\":1,\"scale\":0,\"step\":1,\"unit\":\"\"}},{\"abilityId\":3,\"accessMode\":\"rw\",\"code\":\"doorbell_volume_value\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-yinliang\",\"attribute\":\"676\"},\"name\":\"门铃音量\",\"typeSpec\":{\"type\":\"value\",\"max\":8,\"min\":0,\"scale\":0,\"step\":1,\"unit\":\"\"}},{\"abilityId\":5,\"accessMode\":\"rw\",\"code\":\"alarm_message\",\"description\":\"UTF16 BE格式上报,透传显示\",\"extensions\":{\"attribute\":\"736\"},\"name\":\"告警消息\",\"typeSpec\":{\"type\":\"raw\",\"maxlen\":128}},{\"abilityId\":6,\"accessMode\":\"rw\",\"code\":\"alarm_propel_switch\",\"description\":\"\",\"extensions\":{\"attribute\":\"736\"},\"name\":\"告警推送开关\",\"typeSpec\":{\"type\":\"bool\"}},{\"abilityId\":7,\"accessMode\":\"rw\",\"code\":\"disturb_time_set\",\"description\":\"1byte:bit0-bit6 周日-周一\\n2-3byte:开始时间\\n4-5byte:结束时间\\n最大设置10条\",\"extensions\":{\"attribute\":\"736\"},\"name\":\"勿扰时段\",\"typeSpec\":{\"type\":\"raw\",\"maxlen\":128}},{\"abilityId\":10,\"accessMode\":\"ro\",\"code\":\"doorbell_call\",\"description\":\"\",\"extensions\":{\"attribute\":\"704\"},\"name\":\"门铃呼叫\",\"typeSpec\":{\"type\":\"value\",\"max\":255,\"min\":1,\"scale\":0,\"step\":1}}]}]}"
  },
  "success": true,
  "t": 1731622152477,
  "tid": "144d41a5a2d511efbd65e6107338fc03"
}

Information about how the device functions

An example of how this doorbell was added to the homebridge-tuya-platform : https://github.com/0x5e/homebridge-tuya-platform/issues/257

make-all commented 1 day ago

What is the problem with how it is working now with the WHM04 config?

megadimich commented 1 day ago

What is the problem with how it is working now with the WHM04 config?

It doesn't work at all. See how this problem was solved here: https://github.com/0x5e/homebridge-tuya-platform/issues/257

make-all commented 19 hours ago

The dps are identical to the WHM04, so if it doesn't work AT ALL with that config, then I don't know how this can be supported. I could understand if there was some specific feature not working, but "not at all" seems like the device may in fact be not usable with the local protocol.

megadimich commented 18 hours ago

The dps are identical to the WHM04, so if it doesn't work AT ALL with that config, then I don't know how this can be supported. I could understand if there was some specific feature not working, but "not at all" seems like the device may in fact be not usable with the local protocol.

On the HomeBridge smart home controller in the Touya-local integration, I was able to run this door lock. Did you read the link: https://github.com/0x5e/homebridge-tuya-platform/issues/257?

This could be the reason why this door lock is not working in your integration: The doorbell trigger should use alarm_message because that's what the camera doorbell uses. But this doorbell uses doorbell_call instead.