Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Camera TSL-CAM-B200 keeps rebooting when added #314

Closed
1 of 3 tasks
pduchnovsky opened this issue Jul 25, 2024 · 6 comments
Closed
1 of 3 tasks

[Bug]: Camera TSL-CAM-B200 keeps rebooting when added #314

pduchnovsky opened this issue Jul 25, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@pduchnovsky
Copy link

LocalTuya Version

2024.7.0

Home Assistant Version

2024.7.3

Environment

  • Does the device work using the Home Assistant Tuya Cloud component?
  • Is this device connected to another local integration, including Home Assistant and any other tools?
  • The devices are within the same HA subnet, and they get discovered automatically when I add them

What happened?

When this camera is added to localtuya, it goes in to reboot loop it seems, this started happening with version 2024.6.0 but does not happen with version 2024.5.0.

Steps to reproduce.

Add the camera to localtuya via autodiscovery
or just use existing camera and upgrade the localtuya from 2024.5.0 to 2024.6.0 or 2024.7.0

Relevant log output

2024-07-25 13:39:02.643 DEBUG (MainThread) [custom_components.localtuya.coordinator] [bfa...suu - Pestúnka (cam)] Trying to connect to: 10.10.56.15...
2024-07-25 13:39:02.725 DEBUG (MainThread) [custom_components.localtuya.coordinator] [bfa...suu - Pestúnka (cam)] Success: connected to: 10.10.56.15
2024-07-25 13:39:02.729 DEBUG (MainThread) [custom_components.localtuya.coordinator] [bfa...suu - Pestúnka (cam)] Reconnect succeeded on attempt: 8
2024-07-25 13:39:03.413 DEBUG (MainThread) [custom_components.localtuya.core.pytuya] [bfa...suu - Pestúnka (cam)] Connection lost: [Errno 104] Connection reset by peer
2024-07-25 13:39:03.418 DEBUG (MainThread) [custom_components.localtuya.coordinator] [bfa...suu - Pestúnka (cam)] Trying to connect to: 10.10.56.15...
2024-07-25 13:39:03.433 WARNING (MainThread) [custom_components.localtuya.coordinator] [bfa...suu - Pestúnka (cam)] Connection failed: [Errno 111] Connect call failed ('10.10.56.15', 6668)
2024-07-25 13:39:06.418 INFO (SyncWorker_48) [custom_components.localtuya.coordinator] [bfa...suu - Pestúnka (cam)] Disconnected due to: [Errno 104] Connection reset by peer
2024-07-25 13:39:08.434 DEBUG (MainThread) [custom_components.localtuya.coordinator] [bfa...suu - Pestúnka (cam)] Trying to connect to: 10.10.56.15...
2024-07-25 13:39:13.448 DEBUG (MainThread) [custom_components.localtuya.coordinator] [bfa...suu - Pestúnka (cam)] Trying to connect to: 10.10.56.15...
2024-07-25 13:39:18.465 DEBUG (MainThread) [custom_components.localtuya.coordinator] [bfa...suu - Pestúnka (cam)] Trying to connect to: 10.10.56.15...
2024-07-25 13:39:23.489 DEBUG (MainThread) [custom_components.localtuya.coordinator] [bfa...suu - Pestúnka (cam)] Trying to connect to: 10.10.56.15...
2024-07-25 13:39:28.507 DEBUG (MainThread) [custom_components.localtuya.coordinator] [bfa...suu - Pestúnka (cam)] Trying to connect to: 10.10.56.15...
2024-07-25 13:39:33.521 DEBUG (MainThread) [custom_components.localtuya.coordinator] [bfa...suu - Pestúnka (cam)] Trying to connect to: 10.10.56.15...
2024-07-25 13:39:36.522 WARNING (MainThread) [custom_components.localtuya.coordinator] [bfa...suu - Pestúnka (cam)] Connection failed: [Errno 113] Host is unreachable ('10.10.56.15', '6668')
2024-07-25 13:39:41.523 DEBUG (MainThread) [custom_components.localtuya.coordinator] [bfa...suu - Pestúnka (cam)] Trying to connect to: 10.10.56.15...
2024-07-25 13:39:49.526 DEBUG (MainThread) [custom_components.localtuya.coordinator] [bfa...suu - Pestúnka (cam)] Trying to connect to: 10.10.56.15...
2024-07-25 13:39:49.624 DEBUG (MainThread) [custom_components.localtuya.coordinator] [bfa...suu - Pestúnka (cam)] Success: connected to: 10.10.56.15
2024-07-25 13:39:49.628 DEBUG (MainThread) [custom_components.localtuya.coordinator] [bfa...suu - Pestúnka (cam)] Reconnect succeeded on attempt: 8
2024-07-25 13:39:50.333 DEBUG (MainThread) [custom_components.localtuya.core.pytuya] [bfa...suu - Pestúnka (cam)] Connection lost: [Errno 104] Connection reset by peer
2024-07-25 13:39:50.334 DEBUG (MainThread) [custom_components.localtuya.coordinator] [bfa...suu - Pestúnka (cam)] Trying to connect to: 10.10.56.15...
2024-07-25 13:39:50.349 WARNING (MainThread) [custom_components.localtuya.coordinator] [bfa...suu - Pestúnka (cam)] Connection failed: [Errno 111] Connect call failed ('10.10.56.15', 6668)
2024-07-25 13:39:53.336 INFO (SyncWorker_2) [custom_components.localtuya.coordinator] [bfa...suu - Pestúnka (cam)] Disconnected due to: [Errno 104] Connection reset by peer
2024-07-25 13:39:55.351 DEBUG (MainThread) [custom_components.localtuya.coordinator] [bfa...suu - Pestúnka (cam)] Trying to connect to: 10.10.56.15...

Diagnostics information.

No response

@pduchnovsky pduchnovsky added the bug Something isn't working label Jul 25, 2024
@xZetsubou
Copy link
Owner

can you post the device diagnostics

Copy link

This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the stale label Aug 11, 2024
@pduchnovsky
Copy link
Author

pduchnovsky commented Aug 11, 2024

So I tried it again, updated version to newest and tried adding the camera again, now it even fails to configure at all.

Began adding the cam, defined manual DPSs, gathered from tuya portal using this guide https://www.zigbee2mqtt.io/advanced/support-new-devices/03_find_tuya_data_points.html#_8-find-your-data-point:

101,103,104,105,106,108,109,110,111,115,116,117,119,134,136,138,139,140,141,142,143,150,151,154,160,161,167,168,169,185,212,231,232,233,234,235,236,237,238,239,240,253,254,255

After confirming discovery it gets in to error
image

no device is added and tuyalocal can no longer be started, debug log:

2024-08-11 13:06:36.437 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry localtuya for localtuya
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/homeassistant/config_entries.py", line 604, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/localtuya/__init__.py", line 362, in async_setup_entry
    await setup_entities(entry.data[CONF_DEVICES])
  File "/config/custom_components/localtuya/__init__.py", line 327, in setup_entities
    if check_if_device_disabled(hass, entry, dev_id):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/localtuya/__init__.py", line 464, in check_if_device_disabled
    return dr.async_get(hass).async_get(ha_device_id).disabled
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'disabled'

The device is also not visible (should be 5th device, only shows 4), can not be removed and thus entire tuyalocal becomes stuck,broken

Btw, full list of DP IDs:

{
  "101": "Indicator",
  "103": "Vision Flip",
  "104": "OSD Watermark",
  "105": "Private Mode",
  "106": "Motion Sensitivity",
  "108": "Night Vision",
  "109": "Get Memory Card Capacity",
  "110": "Memory Card Status",
  "111": "Format Memory Card",
  "115": "Motion Detected",
  "116": "PTZ Stop",
  "117": "Formatted State",
  "119": "PTZ Direction",
  "134": "Motion Alert",
  "136": "Doorbell Active",
  "138": "Light Switch",
  "139": "Sound Detection Switch",
  "140": "Sound Sensitivity",
  "141": "Sound Detected",
  "142": "Temperature",
  "143": "Humidity",
  "150": "Record Switch",
  "151": "Recording Mode",
  "154": "Doorbell Snapshot",
  "160": "Device Volume Control",
  "161": "Motion Tracking Switch",
  "167": "Cry Detection Switch",
  "168": "Motion Area Switch",
  "169": "Motion Area",
  "185": "Alarm Report",
  "212": "Message",
  "231": "摇篮曲",
  "232": "摇篮曲模式",
  "233": "摇篮曲音量",
  "234": "摇篮曲控制",
  "235": "music 1",
  "236": "摇篮曲播放指令",
  "237": "检测到婴儿哭声",
  "238": "彩光控制",
  "239": "light mode",
  "240": "floodlight mode",
  "253": "密码修改",
  "254": "onvif IP上报",
  "255": "onvif switch"
}

@pduchnovsky
Copy link
Author

pduchnovsky commented Aug 11, 2024

Meanwhile I've resolved my problem, took the config from version 2024.5 and just removed all the DPS entries I was not utilizing, leaving only few, seems some of those were causing the problem, now it runs fine with newest version and I can control what I want on the camera via localtuya. (most important for me is enabling onvif and PTZ control)

{
    "101": "Indicator",
    "104": "OSD Watermark",
    "105": "Private Mode",
    "108": "Night Vision",
    "116": "PTZ Stop",
    "119": "PTZ Direction",
    "139": "Sound Detection Switch",
    "255": "onvif switch"
}

@xZetsubou
Copy link
Owner

for now you can fix this manually by going to custom_integrations/localtuya/__init__.py and remove the two lines 327 and 328

@xZetsubou xZetsubou added master/next-release Fixed in master branch, Will be ready in the next release and removed stale labels Aug 11, 2024
xZetsubou added a commit that referenced this issue Aug 23, 2024
* rename and cleansup variables usages.

* fix cloud api

* flake8

* revert flake8

* names

* Fix if device entry doesn't exists #314

* Add fail attempt on heartbeats

* Cleans up
Copy link

github-actions bot commented Sep 1, 2024

This issue was closed because it was resolved on the release: 2024.9.0

@github-actions github-actions bot added stale and removed master/next-release Fixed in master branch, Will be ready in the next release stale labels Sep 1, 2024
@github-actions github-actions bot closed this as completed Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants