willemwouters / localtuya_synced

local handling for Tuya devices, clone with: git clone --recursive https://github.com/willemwouters/localtuya_synced.git and follow manual installation steps
GNU General Public License v3.0
5 stars 3 forks source link

3.4 devices can be switched off but can not be switched back on #2

Open Monacoslo opened 1 year ago

Monacoslo commented 1 year ago

The problem

Environment

Steps to reproduce

The integration was included using those steps: git clone --recursive https://github.com/willemwouters/localtuya_synced.git copy localtuya_synced/custom_components/localtuya into your HA instance custom_components/localtuya overriding files Restart HA Add new device from Integrations, and protocol 3.4 shows up Devices added to HA and turned off and on via Lovelace or calling services via automations

wrapper commented 1 year ago

Not sure if this is related but I had the same problem with a climate device, turned out I was just adding the climate entity and not the switch entity.

yundin2000 commented 1 year ago

same problem here

Rotekoppen commented 1 year ago

I have the same problem but find this in my log?

NameError: name 'state' is not defined

2022-12-24 00:45:05.840 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved

Traceback (most recent call last):

  File "/config/custom_components/localtuya/common.py", line 317, in _async_refresh

    await self._interface.update_dps()

  File "/config/custom_components/localtuya/tinytuya/tinytuya/__init__.py", line 179, in update_dps

    await self.device.device.updatedps(state, dp_index)

NameError: name 'state' is not defined