8000 [Bug]: All connected devices will cause "default unavailable" from time to time and then automatically restore. Only version 2025.1.1 will not have this problem. · Issue #655 · xZetsubou/hass-localtuya · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[Bug]: All connected devices will cause "default unavailable" from time to time and then automatically restore. Only version 2025.1.1 will not have this problem. #655

New issue 8000

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

Open
2 of 3 tasks
hend1075 opened this issue May 20, 2025 · 9 comments
Labels
bug Something isn't working stale

Comments

@hend1075
Copy link

LocalTuya Version

2025.5.1

Home Assistant Version

2025.5.2

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?

1、All connected devices will cause "default unavailable" from time to time and then automatically restore. Only version 2025.1.1 will not have this problem.
2、There will be a lot of errors in the log

Steps to reproduce.

Use Tuya Account to obtain device information

Relevant log output

此错误来自自定义集成。

日志记录器: homeassistant
来源: custom_components/localtuya/switch.py:77
集成: Local Tuya (文档, 问题)
首次出现: 09:06:02 (393 次出现)
上次记录: 13:19:40

Error doing job: Exception in callback Entity._async_write_ha_state_from_call_soon_threadsafe() (None)
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/asyncio/events.py", line 89, in _run
    self._context.run(self._callback, *self._args)
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1010, in _async_write_ha_state_from_call_soon_threadsafe
    self._async_write_ha_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1141, in _async_write_ha_state
    self.__async_calculate_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1085, in __async_calculate_state
    if extra_state_attributes := self.extra_state_attributes:
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/localtuya/switch.py", line 77, in extra_state_attributes
    attrs[ATTR_CURRENT_CONSUMPTION] = None if val_cc is None else float(val_cc) / 10
                                                                  ~~~~~^^^^^^^^
ValueError: could not convert string to float: 'FLQA'

Diagnostics information.

No response

@hend1075 hend1075 added the bug Something isn't working label May 20, 2025
@xZetsubou
Copy link
Owner

the voltage is configured incorrectly for the switch the logs shows the voltage DP is string not a number! also this logs may not be the only issue, and attach the device diagnostics

@hend1075
Copy link
Author

@hend1075
Copy link
Author

Image

@xZetsubou
Copy link
Owner
xZetsubou commented May 20, 2025

technically this is sub-device not WiFi device, but I see no issues it might be sub-device losing connection from gateway so full logs is needed if there is an issue
Enable the debug for the integration and device and when issue occurs post them here. Report an issue

@hend1075
Copy link
Author

@Killi77
Copy link
Killi77 commented May 23, 2025

Most of the entities of devices works, like switch, sensor, binary sensor but none of "select" entities working. I have them separated by ; (semicolon). Is there some issue with select entities?

@xZetsubou
Copy link
Owner

by ; (semicolon). Is there some issue with select

nope it just you don't split the choices by commas instead each line represent a choice and friendly name e.g.

single: hello name # this will add hello "name choice" and if select "single" will sent to device

@Killi77
Copy link
Killi77 commented May 24, 2025

@xZetsubou 👍 Thank you. Works like charm. :)

6FF0 Copy link
github-actions bot commented Jun 8, 2025

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 Jun 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

3 participants
0