localtuya icon indicating copy to clipboard operation
localtuya copied to clipboard

Wifi Doorbell support?

Open alexcodelab opened this issue 3 years ago • 35 comments

The problem

I get error when i will add my tuya doorbell to Home Assistant.

Environment

  • Localtuya version:
  • Last working localtuya version (if known and relevant):
  • Home Assistant Core version:
  • [] Are you using the Home Assistant Tuya Cloud component ?
  • [] Are you using the Tuya App in parallel ?

Steps to reproduce

  1. First i wake up the wifi in the doorbell, by clicking on the doorbell in the tuya app and wait after i have a video stream
  2. In home assistant > add integration > local tuya > choose doorbell device > put local key in there > Send
  3. Boom error in the description "Connection to device succeeded but no datapoints found, please try again. Create a new issue and include debug logs if problem persists."

DP dump

C:\Users\Admin\Desktop\tuyadebug>python test.py <Doorbell_id> <local_ip_adress> <dev_key>
INFO:localtuya:localtuya version 1.0.0
INFO:localtuya:Python 3.8.8 (tags/v3.8.8:024d805, Feb 19 2021, 13:18:16) [MSC v.1928 64 bit (AMD64)] on win32
INFO:localtuya:Using pytuya version '8.1.0'
INFO:localtuya:Detecting list of available DPS of device <Doorbell_id> [<local_ip_adress>], protocol 3.3.
DEBUG:localtuya.pytuya:Sending command status (device type: type_0a)
DEBUG:localtuya.pytuya:paylod=b'{"gwId":"<Doorbell_id>","devId":"<Doorbell_id>"}'
WARNING:localtuya.pytuya:Failed to get status: timed out
INFO:localtuya:Detecting list of available DPS of device <Doorbell_id> [<local_ip_adress>], protocol 3.3.
DEBUG:localtuya.pytuya:Sending command status (device type: type_0a)
DEBUG:localtuya.pytuya:paylod=b'{"gwId":"<Doorbell_id>","devId":"<Doorbell_id>"}'
WARNING:localtuya.pytuya:Failed to get status: timed out
INFO:localtuya:Detecting list of available DPS of device <Doorbell_id> [<local_ip_adress>], protocol 3.3.
DEBUG:localtuya.pytuya:Sending command status (device type: type_0a)
DEBUG:localtuya.pytuya:paylod=b'{"gwId":"<Doorbell_id>","devId":"<Doorbell_id>"}'
DEBUG:localtuya.pytuya:DATA RECEIVED!
DEBUG:localtuya.pytuya:decode payload=b'\xdfq\xfe\xda\x92\x88\xaa\xa6\xd8\xd4\xdc\x985\x0c6\x009\x9e\xc5]\xf9i\x14\xa9&\x87\xb1\xca3\x9b\xe4e'
DEBUG:localtuya.pytuya:'data unvalid' error detected: switching to dev_type 'type_0d'
DEBUG:localtuya.pytuya:Re-send status due to device type change (type_0a -> type_0d)
DEBUG:localtuya.pytuya:Sending command status (device type: type_0d)
DEBUG:localtuya.pytuya:paylod=b'{"devId":"<Doorbell_id>","uid":"<Doorbell_id>","t":"1618663953","dps":{"1":null,"2":null,"3":null,"4":null,"5":null,"6":null,"7":null,"8":null,"9":null,"10":null}}'
DEBUG:localtuya.pytuya:DATA RECEIVED!
DEBUG:localtuya.pytuya:READING AGAIN!
DEBUG:localtuya.pytuya:decode payload=b'3.3\x00\x00\x00\x00\x00\x00\xe7`\x00\x00\x00\x01\xe8\x87\xa5\xde\xc6zYv\x83dp\x8ar\x1b\xae\xa5R\xb99W\xf1\x95\xb7*#\xa5\x85\x1b\x8c\xe0Z\x13'
DEBUG:localtuya.pytuya:decrypted result='{"dps":{"101":false},"t":6}'
DEBUG:localtuya.pytuya:Sending command status (device type: type_0d)
DEBUG:localtuya.pytuya:paylod=b'{"devId":"<Doorbell_id>","uid":"<Doorbell_id>","t":"1618663954","dps":{"1":null,"11":null,"12":null,"13":null,"14":null,"15":null,"16":null,"17":null,"18":null,"19":null,"20":null}}'
DEBUG:localtuya.pytuya:DATA RECEIVED!
DEBUG:localtuya.pytuya:READING AGAIN!
DEBUG:localtuya.pytuya:decode payload=b"3.3\x00\x00\x00\x00\x00\x00\xe7b\x00\x00\x00\x01\x16\x16s\x9aUN\xb7\xf2\xf6'*V\xcee|\xe4\xcc\xa9\x9e\xda\xdf^\xdd\xe32\x88O\x82t\xdf\xf3\x85\x90\x89\xf3R\x07H\xaf\xf5GDs\x85v\x82\x86$"
DEBUG:localtuya.pytuya:decrypted result='{"dps":{"103":false},"t":1618663955}'
DEBUG:localtuya.pytuya:Sending command status (device type: type_0d)
DEBUG:localtuya.pytuya:paylod=b'{"devId":"<Doorbell_id>","uid":"<Doorbell_id>","t":"1618663955","dps":{"1":null,"21":null,"22":null,"23":null,"24":null,"25":null,"26":null,"27":null,"28":null,"29":null,"30":null}}'
DEBUG:localtuya.pytuya:DATA RECEIVED!
DEBUG:localtuya.pytuya:decode payload=b"3.3\x00\x00\x00\x00\x00\x00\xe7d\x00\x00\x00\x01~T\x0b\xf06\x8cS'\xc3\x96\x8ea\xc7\\\xd9\xf4\xcc\xa9\x9e\xda\xdf^\xdd\xe32\x88O\x82t\xdf\xf3\x85vr\x1bm4\x85\xd2\xa1\x9399f\xb2,\x12\x1d"
DEBUG:localtuya.pytuya:decrypted result='{"dps":{"104":false},"t":1618663956}'
DEBUG:localtuya.pytuya:Sending command status (device type: type_0d)
DEBUG:localtuya.pytuya:paylod=b'{"devId":"<Doorbell_id>","uid":"<Doorbell_id>","t":"1618663955","dps":{"1":null,"100":null,"101":null,"102":null,"103":null,"104":null,"105":null,"106":null,"107":null,"108":null,"109":null,"110":null}}'
DEBUG:localtuya.pytuya:DATA RECEIVED!
DEBUG:localtuya.pytuya:decode payload=b'3.3\x00\x00\x00\x00\x00\x00\xe7e\x00\x00\x00\x01wA\x93\n\xa0\x89\xa0\xa6\xad\xb2\x1b\x91}\xa1\xaf\xd2\x017N\xc2\x1c\xb5S\xaa3\x14\xd9\xb44\x8a\x0e\xcf\x1f\x7f%%W\xd5\x86t\x8ee\xcaDt\x1aD\x92'
DEBUG:localtuya.pytuya:decrypted result='{"dps":{"108":"0"},"t":1618663956}'
AVAILABLE DPS ARE [{'101': False, '103': False, '104': False, '108': '0'}]
INFO:localtuya:COMPLETE response from device <Doorbell_id> [<local_ip_adress>].
INFO:localtuya:TIMEOUT: No response from device <Doorbell_id> [<local_ip_adress>] after 2 attempts.

Provide Home Assistant taceback/logs

Traceback (most recent call last):
File "/config/custom_components/localtuya/config_flow.py", line 279, in async_step_basic_info
self.dps_strings = await validate_input(self.hass, user_input)
File "/config/custom_components/localtuya/config_flow.py", line 185, in validate_input
interface = await pytuya.connect(
File "/config/custom_components/localtuya/pytuya/__init__.py", line 637, in connect
_, protocol = await loop.create_connection(
File "/usr/local/lib/python3.8/asyncio/base_events.py", line 1025, in create_connection
raise exceptions[0]
File "/usr/local/lib/python3.8/asyncio/base_events.py", line 1010, in create_connection
sock = await self._connect_sock(
File "/usr/local/lib/python3.8/asyncio/base_events.py", line 924, in _connect_sock
await self.sock_connect(sock, address)
File "/usr/local/lib/python3.8/asyncio/selector_events.py", line 496, in sock_connect
return await fut
File "/usr/local/lib/python3.8/asyncio/selector_events.py", line 528, in _sock_connect_cb
raise OSError(err, f'Connect call failed {address}')
OSError: [Errno 113] Connect call failed ('192.168.2.195', 6668)

Additional information

alexcodelab avatar Apr 17 '21 13:04 alexcodelab

Any Updated on this Issue I have a door Bell need to be integrated with Home assistant

kond111 avatar Jul 21 '21 11:07 kond111

I would also much appreciate this, I have almost all my Tuya devices implemented with local tuya for more than a year now, only leaving out the "dreaded" doorbell, that I can't get sensors of the main functions even with the official Tuya integratrion (doobell press, camera and motion sensors). Pretty useless for any thinkable automation without those sensors... Could this eventually be implemented? How can I help? Thanks in advance!

FragMenthor avatar Mar 04 '22 14:03 FragMenthor

This is my device diagnostic in official Tuya integration:

tuya-513bd91c37dca566213f274fd97f9e1f-Campainha-e7a3b34c3b339531231843fef235c553.json.txt

FragMenthor avatar Mar 04 '22 14:03 FragMenthor

These are screenshots of the Tuya IOT Platfotm debugging:

image

image

image

Device Log, Motion Exemple:

image

FragMenthor avatar Mar 04 '22 14:03 FragMenthor

+1 on this please

sacredprey005 avatar Jul 19 '22 01:07 sacredprey005

+1

rqsakai avatar Jul 21 '22 18:07 rqsakai

was this closed without a solution?

rqsakai avatar Jul 21 '22 19:07 rqsakai

sry my mistake i reopen this

alexcodelab avatar Jul 21 '22 19:07 alexcodelab

+1

alexcodelab avatar Jul 21 '22 19:07 alexcodelab

Thanks @alexcodelab :D

rqsakai avatar Jul 21 '22 19:07 rqsakai

+1

I have a question, do these Tuya IoT platform tools maybe allow for flashing Tasmota firmware? I saw something where you upload a firmware in their docs but didn't fully understand it as it is probably for OEMs only.

plantroon avatar Aug 18 '22 13:08 plantroon

Same problem here, is a baterry doorbell and when try to connect give me an error "no data point found" and in the logs this

Traceback (most recent call last):
  File "/config/custom_components/localtuya/pytuya/__init__.py", line 539, in detect_available_dps
    data = await self.status()
  File "/config/custom_components/localtuya/pytuya/__init__.py", line 481, in status
    status = await self.exchange(STATUS)
  File "/config/custom_components/localtuya/pytuya/__init__.py", line 466, in exchange
    payload = self._decode_payload(msg.payload)
  File "/config/custom_components/localtuya/pytuya/__init__.py", line 583, in _decode_payload
    raise Exception(f"Unexpected payload={payload}")
Exception: Unexpected payload=b'H \x9a\xeb\xfe\x03-\x17I%\xc0\xb4|\x98\xec\xa5q\xeeG\xddE\xc7\xd5tn\xdb\t\xeeD\xfas\xe2'

Oliverdx avatar Aug 22 '22 18:08 Oliverdx

I got the DP's from my device in Tuya ioT Platform, could this help? Anyway I can use this DP's to setup a device?

{
  "result": {
    "category": "sp",
    "functions": [
      {
        "code": "basic_flip",
        "dp_id": 103,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "basic_osd",
        "dp_id": 104,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "sd_format",
        "dp_id": 111,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "wireless_awake",
        "dp_id": 149,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "pir_switch",
        "dp_id": 152,
        "type": "Enum",
        "values": "{\"range\":[\"0\",\"1\",\"2\",\"3\"]}"
      },
      {
        "code": "basic_anti_flicker",
        "dp_id": 188,
        "type": "Enum",
        "values": "{\"range\":[\"0\",\"1\",\"2\"]}"
      }
    ],
    "status": [
      {
        "code": "alarm_message",
        "dp_id": 185,
        "type": "Raw",
        "values": "{}"
      },
      {
        "code": "basic_flip",
        "dp_id": 103,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "basic_osd",
        "dp_id": 104,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "sd_storge",
        "dp_id": 109,
        "type": "Integer",
        "values": "{\"maxlen\":255}"
      },
      {
        "code": "sd_status",
        "dp_id": 110,
        "type": "Integer",
        "values": "{\"unit\":\"\",\"min\":1,\"max\":5,\"scale\":1,\"step\":1}"
      },
      {
        "code": "sd_format",
        "dp_id": 111,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "movement_detect_pic",
        "dp_id": 115,
        "type": "Raw",
        "values": "{}"
      },
      {
        "code": "sd_format_state",
        "dp_id": 117,
        "type": "Integer",
        "values": "{\"unit\":\"\",\"min\":-20000,\"max\":20000,\"scale\":1,\"step\":1}"
      },
      {
        "code": "doorbell_active",
        "dp_id": 136,
        "type": "String",
        "values": "{\"maxlen\":255}"
      },
      {
        "code": "wireless_electricity",
        "dp_id": 145,
        "type": "Integer",
        "values": "{\"unit\":\"\",\"min\":0,\"max\":100,\"scale\":1,\"step\":1}"
      },
      {
        "code": "wireless_powermode",
        "dp_id": 146,
        "type": "Enum",
        "values": "{\"range\":[\"0\",\"1\"]}"
      },
      {
        "code": "wireless_awake",
        "dp_id": 149,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "pir_switch",
        "dp_id": 152,
        "type": "Enum",
        "values": "{\"range\":[\"0\",\"1\",\"2\",\"3\"]}"
      },
      {
        "code": "basic_anti_flicker",
        "dp_id": 188,
        "type": "Enum",
        "values": "{\"range\":[\"0\",\"1\",\"2\"]}"
      }
    ]
  },
  "success": true,
  "t": 1666946358375,
  "tid": "02fd1604569c11edb3e2e68f1605df98"
}

FragMenthor avatar Oct 28 '22 09:10 FragMenthor

Same problem here, "Connection to device succeeded but no datapoints found, please try again. Create a new issue and include debug logs if problem persists."

edionek avatar Mar 07 '23 10:03 edionek

+1

antkowiakit avatar Apr 27 '23 20:04 antkowiakit

+1 from me as well.

kheerand avatar May 28 '23 07:05 kheerand

When this gets added i install local tuya!!

labaland avatar Jun 01 '23 16:06 labaland

+1

dee-o-cun avatar Jun 13 '23 15:06 dee-o-cun

Upz +1

fusionstream avatar Jun 28 '23 16:06 fusionstream

+1

The-cpu-max avatar Jul 26 '23 07:07 The-cpu-max

@alexcodelab what kind of doorbell is it? Maybe try to check the TuyaLocal integration...?

I have this model of doorbell and I can not integrate it with Home Assistant too... :( domofon

karolzamosc avatar Jul 28 '23 15:07 karolzamosc

@karolzamosc This device i have Screenshot_20230728-172608

alexcodelab avatar Jul 28 '23 15:07 alexcodelab

@alexcodelab try to integrate through TuyaLocal

If you can provide the datapoints to the author he will probably add the integration. Unfortunately I can not do it with my doorbell :⁠-⁠(

karolzamosc avatar Jul 28 '23 15:07 karolzamosc

Screenshot_20230728_184528_AliExpress It's what I have

The-cpu-max avatar Jul 28 '23 15:07 The-cpu-max

@The-cpu-max can you check the datapoints in your doorbell (a little similiar to mine so maybe datapoints are the same)? I am trying to find how to integrate my doorbell localy, connection was established properly but no datapoint was found...

karolzamosc avatar Jul 29 '23 11:07 karolzamosc

@The-cpu-max can you check the datapoints in your doorbell (a little similiar to mine so maybe datapoints are the same)? I am trying to find how to integrate my doorbell localy, connection was established properly but no datapoint was found...

I talked to the seller, he said that what I have is not supported. He suggested that I upgrade, finally he said that he didn't need to - and that he needed to open something remotely for it to work, I'll update as soon as it works

The-cpu-max avatar Jul 29 '23 15:07 The-cpu-max

@The-cpu-max do you have an iot tuya account? I am afraid that the seller is not a good person to ask about unofficial tuya integration... 😉

karolzamosc avatar Jul 29 '23 15:07 karolzamosc

@The-cpu-max do you have an iot tuya account? I am afraid that the seller is not a good person to ask about unofficial tuya integration... 😉

Yes I have But he doesn't let it be set in the smart home

The-cpu-max avatar Jul 29 '23 16:07 The-cpu-max

@The-cpu-max I don't understand... Your doorbell works in Tuya system or not?

If yes please try to get the datapoints using these instructions.

karolzamosc avatar Jul 29 '23 17:07 karolzamosc

@The-cpu-max I don't understand... Your doorbell works in Tuya system or not?

If yes please try to get the datapoints using these instructions.

yes

The-cpu-max avatar Jul 29 '23 17:07 The-cpu-max