Open amithkk opened 1 month ago
Hey there @tuya, @zlinoliver, @frenck, mind taking a look at this issue as it has been labeled with an integration (tuya
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
tuya documentation tuya source (message by IssueLinks)
Exactly the same issue as described on Raspberry Pi4 with 24.3.1
Точно такая же проблема, как описана в Raspberry
I do have the same problem on a RPI4, I cannot see if it's turned on, to turn it off I have to click two times. In SmartLife everything is okay. When I use LocalTuya it do works normally with exception of groups.yaml, when I swith this entity off it works but on screen it's returning to the on-state while the lamps staying off. The problem exist after the last update 24.3.3 so I don't think it's a Tuya problem. Also my electricity meters won't update anymore, in SmartLife they do normally.
problem solved since last update (04-2024)
@F8VPE Can still reproduce issue on 2024.4.3. The same error is logged as well
2024-04-14 15:15:41.616 ERROR (MainThread) [homeassistant.util.logging] Exception in async_write_ha_state when dispatching 'tuya_entry_update_d7c88c9a319ecbb5efipav': ()
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 998, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1119, in _async_write_ha_state
state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1058, in __async_calculate_state
attr.update(self.state_attributes or {})
^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 1205, in state_attributes
data[ATTR_BRIGHTNESS] = self.brightness
^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/tuya/light.py", line 657, in brightness
brightness = self._brightness.remap_value_to(brightness)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/tuya/base.py", line 64, in remap_value_to
return remap_value(value, self.min, self.max, to_min, to_max, reverse)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/tuya/util.py", line 17, in remap_value
return ((value - from_min) / (from_max - from_min)) * (to_max - to_min) + to_min
~~~~~~^~~~~~~~~~
TypeError: unsupported operand type(s) for -: 'str' and 'int'
@amithkk I'm still using the Tuya cloud but with the last update of march I've got simulair problems. With 2024.4.3. everything is working normal again. Have to say that I changed the most entities using LocalTuya, works quicker and worked also before the latest update. Also the thermostats and electricity meters are working again now. You may try using the cloud again to find out if your problems are gone. If so contact Tuya directly.
@F8VPE the underlying problem is. not yet fixed. Migrating to tuya local is an option but tuya team basically had re-written the extension in their last update to make it work locally similar to tuya local. Now it do not need a cloud api key. that's where the problems actually started.
Thanks Gautam , I will still using the cloud untill this is problem is repaired.
Bumping this, since it's still completely broken
The problem
The Tuya integration no longer updates state on HA. This means that a light, for instance can be "turned on" from HA but the state continues to show that it is turned off. This also makes it impossible to turn off a light from the dashboard. (The "turn off" service works fine)
This is the new version of the Tuya integration which directly connects to the SmartLife app via a pairing code and is not connected to the Tuya IoT Cloud (therefore, this is not an issue of the app trial expiring on the Tuya Cloud)
There seems to be an error in the logs that is relevant. Perhaps the format of the data returned by the Tuya API has changed:
What version of Home Assistant Core has the issue?
core-2024.3.3
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Container
Integration causing the issue
tuya
Link to integration documentation on our website
https://www.home-assistant.io/integrations/tuya/
Diagnostics information
home-assistant_tuya_2024-03-24T09-45-26.004Z.log
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response