Core: Tuya - Still having the toggle state issue - Hassio 0.98.2

Created on 3 Sep 2019  Â·  53Comments  Â·  Source: home-assistant/core

Home Assistant release with the issue:
0.98.2

Component
https://www.home-assistant.io/components/tuya/

Operating environment (Hass.io/Docker/Windows/etc.):
Rpi 3 - Hass.io

Description of problem:
Even being on 0.98.2, wich contain the potential fix : https://github.com/home-assistant/home-assistant/issues/25992 I'm still having the same issue.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

# SmartLife
tuya:
  username: !secret smartlife_username
  password: !secret smartlife_pwd
  country_code: "33"
  platform: "smart_life"
tuya

Most helpful comment

@PaulAnnekov The code is fixed in the RC branch (see here). It will be updated in 0.98.4

All 53 comments

Its not just tuya, I am having issues with my mqtt lights not maintaining their states after upgrading to 98.2

I've start a discussion here https://community.home-assistant.io/t/tuya-smartlife-smart-plug-auto-toggle-itself/135269 and someone say that, for Tuya, it was fixed in 0.98.1 but broke again in 0.98.2.
(or maybe the API changed in the few previous hours..)

Having this issue on 0.98.3 also.

Broken 0.98.3 too

I reverted back to 0.98.1 and it works fine. The issue seems to be in 0.98.2 and 0.98.3

It indeed is broken. However, for some reason, if I use it as a custom_component, it works fine for me. Here are the files that I am using.

I'm going to test those files and update to 98.3
thank you

I am on 0.98.3 with those files and it is working fine for me. Here's the diff that is probably causing the issue.

it really works for me, thanks

when updating to 98.3 i lose all interface controls with tuya devices. go back to 97.3 it all good

@balloob please, remove this hack https://github.com/home-assistant/home-assistant/commit/5676f6fb86abbbaa6d34784cede1bc8b618a6d24. The issue was fixed in tuyaha and it doesn't work as expected now. I can't remove it, because it's not in dev branch.

but in 98.2 / 3, it failed, and in 98.0 / 1 no, why now?

The whole story:
0.98.0 - dirty fix in tuyaha library when Tuya Inc. broke their API
0.98.1 - users found dirty fix makes HA freeze on each update for several seconds, balloob added this hack to make it work
0.98.2 - I made a better fix in tuyaha which doesn't freeze HA. But it required balloob's hack to be removed. It was not removed, I didn't even know balloob added this hack :smile:. Issue re-appeared
0.98.3 - no changes

@PaulAnnekov The code is fixed in the RC branch (see here). It will be updated in 0.98.4

Thanks,goog job

when is 0.98.4 due to be released?

I did the changes in switch.py file and I confirm that it solves the problem. Using switches connected with Smart Life app and account. About 15-20 seconds latency to update the UI when the change is done outside HA. All good to me. Thank you!

.4 is released with the fix.

Updated this morning to .4
Works like a charm. Excellent job!

Work perfect thanks

On Fri, Sep 6, 2019 at 7:52 PM Torpi notifications@github.com wrote:

Updated this morning to .4
Works like a charm. Excellent job!

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/home-assistant/home-assistant/issues/26373?email_source=notifications&email_token=AMKHNPBULXT2RWZ4EVKFBX3QILUKBA5CNFSM4ITEBGW2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6EKMZY#issuecomment-529049191,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AMKHNPDBUSIQOJUUT4BSOI3QILUKBANCNFSM4ITEBGWQ
.

I am still having an issue with Tuya switches not responding and displaying correctly on 0.98.4

working perfect for me were you ok before updates

On Wed, 11 Sep 2019 at 00:42, youngy00 notifications@github.com wrote:

I am still having an issue with Tuya switches not responding and
displaying correctly on 0.98.4

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/home-assistant/home-assistant/issues/26373?email_source=notifications&email_token=AMKHNPCQAEIM4HGIS3AZZPLQJBZLZA5CNFSM4ITEBGW2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6NHOWI#issuecomment-530216793,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AMKHNPG2PGAT2L3A4IMC5JLQJBZLZANCNFSM4ITEBGWQ
.

Worked perfectly for the last 6 months until about 0.98.1 Tried 0.98.2-0.98.4 still the same issue on all versions. rolled back to 0.98.1 but still had issues. Currently on 0.98.4

Still not working as before for me, it kind of works sometimes. Is there a timeout for checking status of the device? I am in Australia and was wondering if the problem is due to latency.

You will get a warning in logs in case of a timeout.

Sorry to hear that wish I could help once I got it setup in home assistant
I had no issue as long as the host ip is set right and password it works
...... I don’t think where you are has anything to do with it

On Sun, Sep 22, 2019 at 5:27 PM Paul Annekov notifications@github.com
wrote:

You will get a warning in logs in case of a timeout.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/home-assistant/home-assistant/issues/26373?email_source=notifications&email_token=AMKHNPB5CBXKXH3GQZBM33LQK7PKRA5CNFSM4ITEBGW2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7JPTNI#issuecomment-533920181,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AMKHNPG3DFW6DBO2XJTJZHTQK7PKRANCNFSM4ITEBGWQ
.

Seems like it's broken again, right ?

I have a feeling Tuya servers were having problems all weekend. I had at least 3 dimmer switches that were showing a red wifi status light on them.

I had an issue last week like this with some three way switches . I really
wish all my devices would show up in home assistant like my garage door
opener using web hook sucks what to slow

On Mon, Sep 23, 2019 at 4:10 PM Scope666 notifications@github.com wrote:

I have a feeling Tuya servers were having problems all weekend. I had at
least 3 dimmer switches that were showing a red wifi status light on them.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/home-assistant/home-assistant/issues/26373?email_source=notifications&email_token=AMKHNPAALTRWHLMYP7GR6V3QLEPB7A5CNFSM4ITEBGW2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7MDMCQ#issuecomment-534263306,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AMKHNPHOJI7GJIJHPUFMHRTQLEPB7ANCNFSM4ITEBGWQ
.

Just throwing my hat in the ring that I am also having these issues, 2 bulbs and 2 outlets that just keep losing their state. On 99.2

This is happening again on 0.101.2

Can still control light if you flip on/off or off/on, but it's not showing the correct state.

For me it's only my single outlet smart switches that have the problem. My multiple outlet outdoor switches are fine, as are my smart in-wall dimmers.

Yup, problem still here

Having this issue with one brand of smartlights, but not with a different brand + style of bulb, and switches all work fine.

the bulbs that dont respond correctly always show as off, I am able to turn them on in the ui, but not turn them off.

I'm having weird log entries in Hassio 0.101.3

No idea what they mean or how to stop them bit they are clogging up my log file.

e.g.:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 720, in urlopen
    method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
  File "/usr/local/lib/python3.7/site-packages/urllib3/util/retry.py", line 436, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='px1.tuyaeu.com', port=443): Max retries exceeded with url: /homeassistant/skill (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x6ec19910>: Failed to establish a new connection: [Errno -3] Try again'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 270, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 450, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/tuya/__init__.py", line 150, in update
    self.tuya.update()
  File "/usr/local/lib/python3.7/site-packages/tuyaha/devices/switch.py", line 22, in update
    devices = self.api.discovery()
  File "/usr/local/lib/python3.7/site-packages/tuyaha/tuyaapi.py", line 108, in discovery
    response = self._request('Discovery', 'discovery')
  File "/usr/local/lib/python3.7/site-packages/tuyaha/tuyaapi.py", line 165, in _request
    json = data
  File "/usr/local/lib/python3.7/site-packages/requests/api.py", line 116, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='px1.tuyaeu.com', port=443): Max retries exceeded with url: /homeassistant/skill (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x6ec19910>: Failed to establish a new connection: [Errno -3] Try again'))

Hi, I think issue is happening again. Running on 0.111.3, I have Smartlife devices which are not updating status. Anyone facing same issue?
Thanks

i always had issues so i changed everything to ESP home i understand this
is not helping you but ESP home is the real answer

On Tue, 16 Jun 2020 at 10:35, hybrixxx notifications@github.com wrote:

Hi, I think issue is happening again. Running on 0.111.3, I have Smartlife
devices which are not updating status. Anyone facing same issue?
Thanks

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/home-assistant/core/issues/26373#issuecomment-644805889,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AMKHNPBNZ3AXLQBLQF7YR2DRW57M7ANCNFSM4ITEBGWQ
.

i always had issues so i changed everything to ESP home i understand this is not helping you but ESP home is the real answer
…

I've always thought about doing this but I have a LOT of devices including in-wall dimmers, multi-port outdoor switches, etc.

@hybrixxx works on 0.109.3 (not the status but we can open/close..). When I see previous messages, I will wait before upgrade HA... Seems that nobody manage this component anymore :(

@tod what do you mean by ESP?

Yes I think you can do it ota so you won’t have to remove them

On Tue, Jun 16, 2020 at 10:49 AM Anthony notifications@github.com wrote:

@hybrixxx https://github.com/hybrixxx works on 0.109.3 (not the status
but we can open/close..). When I see previous messages, I will wait before
upgrade HA... Seems that nobody manage this component anymore :(

@tod https://github.com/tod what do you mean by ESP?

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/home-assistant/core/issues/26373#issuecomment-644814147,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AMKHNPATHPONIB5KLYZ55OTRW6BAPANCNFSM4ITEBGWQ
.

Hi, I think issue is happening again. Running on 0.111.3, I have Smartlife devices which are not updating status. Anyone facing same issue?
Thanks

I just tried on my .111.1 install, I can toggle a Tuya Switch "On" and it comes on and the HA Status shows "On" If I then toggle the switch "Off" in Smart Life App, the HA status remains "On" I turned it back "On" using SL and try to turn "Off" in HA which it does, but the toggle immediately returns to "On" position...

I've waited ~5 minutes and HA is still not updated.

@hybrixxx works on 0.109.3 (not the status but we can open/close..). When I see previous messages, I will wait before upgrade HA... Seems that nobody manage this component anymore :(

@tod what do you mean by ESP?

Actually you can turn on/off with switch.turn_on/off service, only issue is the status updates.
Regarding ESP, I have around 15, I did It soldering+tasmota for the first blitzwolf to skip Smartlife but It took me long so I started using tuya intrgration for the new ones.

Hi, I think issue is happening again. Running on 0.111.3, I have Smartlife devices which are not updating status. Anyone facing same issue?
Thanks

I just tried on my .111.1 install, I can toggle a Tuya Switch "On" and it comes on and the HA Status shows "On" If I then toggle the switch "Off" in Smart Life App, the HA status remains "On" I turned it back "On" using SL and try to turn "Off" in HA which it does, but the toggle immediately returns to "On" position...

I've waited ~5 minutes and HA is still not updated.

Exactly same behavior.

Yes I think you can do it ota so you won’t have to remove them
…

I was always under the impression you had to solder or use jumpers to convert them to ESP Home like hybrixxx mentioned.

I did mine ota

On Tue, Jun 16, 2020 at 10:59 AM Scope666 notifications@github.com wrote:

Yes I think you can do it ota so you won’t have to remove them
… <#m_-5364017257651490331_>

I was always under the impression you had to solder or use jumpers to
convert them to ESP Home like hybrixxx mentioned.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/home-assistant/core/issues/26373#issuecomment-644819972,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AMKHNPEXSAWBPXWD25VOMF3RW6CEPANCNFSM4ITEBGWQ
.

Look for home assistant tuya ota convert on you tube I used a spare Pi to
do mine as I am running home assistant on a pc

On Tue, Jun 16, 2020 at 11:23 AM Scope666 notifications@github.com wrote:

I did mine ota
… <#m_4398922827605264476_m_-7966510289060834283_>

Trying to install but looks like it's been removed from the official
add-on store. HACS is complaining about the structure:

[image: image]
https://user-images.githubusercontent.com/31927547/84793955-b21dc380-afc3-11ea-9270-acf6cf84645b.png

https://esphome.io/guides/getting_started_hassio.html#installation

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/home-assistant/core/issues/26373#issuecomment-644835036,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AMKHNPHZW4FZPSQMRTP6A4TRW6E6PANCNFSM4ITEBGWQ
.

I took me hours as I had over 40 units lol

On Tue, Jun 16, 2020 at 11:28 AM Tod Denneny toddenneny@gmail.com wrote:

Look for home assistant tuya ota convert on you tube I used a spare Pi to
do mine as I am running home assistant on a pc

On Tue, Jun 16, 2020 at 11:23 AM Scope666 notifications@github.com
wrote:

I did mine ota
… <#m_-8651707005918157971_m_4398922827605264476_m_-7966510289060834283_>

Trying to install but looks like it's been removed from the official
add-on store. HACS is complaining about the structure:

[image: image]
https://user-images.githubusercontent.com/31927547/84793955-b21dc380-afc3-11ea-9270-acf6cf84645b.png

https://esphome.io/guides/getting_started_hassio.html#installation

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/home-assistant/core/issues/26373#issuecomment-644835036,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AMKHNPHZW4FZPSQMRTP6A4TRW6E6PANCNFSM4ITEBGWQ
.

I'm on 0.111.3 and switches are not updating their state. I have to restart the HAS in order for the states to update.

This is happening to me with my Tuya Smart Life connected TreatLife 3-Way Switches. It's annoying because these are the last Tuya devices I have that I haven't converted to Tasmota (Tuya Convert doesn't work and I'm not willing to dig these devices out to try to solder them).

I'm running the Home Assistant Core Docker image 0.111.0

I took me hours as I had over 40 units lol
…

Well, one out of two ain't bad I guess. The first one I tried, a Teckin SP20 is bricked, I've tried every possible thing listed on the internet and I can't get it to recover. I'll probably have to cut a hole in it to get to the pins if I want to save it. The other one, a GoSund WP3 worked perfectly, and I already have it in Home Assistant for a test run.

image

Try to push reset for 45 secs

El jue., 18 jun. 2020 6:27, Scope666 notifications@github.com escribió:

I took me hours as I had over 40 units lol
… <#m_7534628816459762773_>
On Tue, Jun 16, 2020 at 11:28 AM Tod Denneny @.> wrote: Look for home
assistant tuya ota convert on you tube I used a spare Pi to do mine as I am
running home assistant on a pc On Tue, Jun 16, 2020 at 11:23 AM Scope666 @.
>
wrote: > I did mine ota > …
<#m_-8651707005918157971_m_4398922827605264476_m_-7966510289060834283_> > >
Trying to install but looks like it's been removed from the official >
add-on store. HACS is complaining about the structure: > > [image: image] >
https://user-images.githubusercontent.com/31927547/84793955-b21dc380-afc3-11ea-9270-acf6cf84645b.png

https://esphome.io/guides/getting_started_hassio.html#installation > >

Well, one out of two ain't bad I guess. The first one I tried, a Teckin
SP20 is bricked, I've tried every possible thing listed on the internet and
I can't get it to recover. I'll probably have to cut a hole in it to get to
the pins if I want to save it. The other one, a GoSund WP3 worked
perfectly, and I already have it in Home Assistant for a test run.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/home-assistant/core/issues/26373#issuecomment-645764286,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ALIVYA5CTWWUOTGSTOF6XPTRXGJTRANCNFSM4ITEBGWQ
.

Try to push reset for 45 secs El jue., 18 jun. 2020 6:27, Scope666 notifications@github.com escribió:
…

Just tried that, no difference. From the logs people think it's stuck at "stage 1" but I have tuya-convert running and it's simply not attempting to resume. The mac address we're looking for starts with cc:50:e3

Screenshot from 2020-06-18 06-52-48

Got 3 done so far, all different models, no problems.... I guess the Teckin SP20's are cursed. I have 3 more but afraid to try on those. I have a serial flasher coming Saturday, we'll see if I can recover the bricked one that way.

image

Please do not use old issues for discussions. If you have a question, use the forums or Discord. IF you have a new issue, open a new issue.

Was this page helpful?
0 / 5 - 0 ratings