Error connecting to power meter
Description
I have a power meter that I had previously connected to home assistant. After some time it stopped working (not 1005 sure if related to my Tuya Cloud subscription ending). I extended the subscription, but whenever I try to connect again I get this error
Logger: homeassistant.config_entries
Source: config_entries.py:761
First occurred: 26 October 2025 at 17:08:14 (3 occurrences)
Last logged: 09:28:15
Error setting up entry Energy meter for tuya_local
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 761, in __async_setup_with_context
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/tuya_local/__init__.py", line 645, in async_setup_entry
await device.async_refresh()
File "/config/custom_components/tuya_local/device.py", line 451, in async_refresh
await self._retry_on_failed_connection(
...<2 lines>...
)
File "/config/custom_components/tuya_local/device.py", line 604, in _retry_on_failed_connection
retval = await self._hass.async_add_executor_job(func)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
asyncio.exceptions.CancelledError
this happens after adding the device - when I try to initialise it.
Any ideas what I might be doing wrong?
Steps to reproduce
No response
Expected behaviour
No response
Additional context
No response
Confirmation
-
[x] I am sure this is a bug or improvement, that is well enough described that it can be implemented.
-
[x] This report is for tuya-local, not for localtuya.
-
[ ] If this is for a specific device, the device config filename is mentioned above, or diagnostics are included.
-
[ ] Log messages or diagnostics relevant to the issue are included.
-
[x] This is not requesting addition of a new device.
Cancelled error indicates that the integration was reloaded. It may happen to the test connection when switching back to normal operation, but that should not interfere with ongoing normal operation.
Is it just the error in the log you are reporting, or is the device not working? What about after an HA restart? It sounds like you got through the configuration steps, so probably not a general connection issue (#522)
Cancelled error indicates that the integration was reloaded. It may happen to the test connection when switching back to normal operation, but that should not interfere with ongoing normal operation.
Is it just the error in the log you are reporting, or is the device not working? What about after an HA restart? It sounds like you got through the configuration steps, so probably not a general connection issue (#522)
For fuck sake. I restarted and now it works just fine, hahahaha. Stupid me.
Before restart it basically wasn't showing the power
I still think there could be a race condition there that stops the device from working immediately after the configuration step, so I will leave this open to look at as part of the connection handling rewrite for upcoming tinytuya 2.0.0