Tuya Component Problems

Hi everyone,

i have Home Assistant 0.93.2. I have tried to enable Tuya component with these settings:

tuya:
username: ‘’
password: ‘’
country_code: ‘39’
platform: ‘tuya’

I have tried with phone-number and email as username.
When i run HA the status is:

May 25 17:14:36 hassbian systemd[1]: Started Home Assistant for homeassistant.
May 25 17:14:49 hassbian hass[3515]: 2019-05-25 17:14:48 ERROR (MainThread) [homeassistant.config] Invalid config for [homeassistant]:
May 25 17:14:49 hassbian hass[3515]: 2019-05-25 17:14:49 INFO (MainThread) [homeassistant.core] Starting Home Assistant
May 25 17:14:49 hassbian hass[3515]: 2019-05-25 17:14:49 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was ne
May 25 17:14:49 hassbian hass[3515]: Traceback (most recent call last):
May 25 17:14:49 hassbian hass[3515]: File “/srv/homeassistant/lib/python3.7/site-packages/homeassistant/core.py”, line 1118, in async
May 25 17:14:49 hassbian hass[3515]: raise ServiceNotFound(domain, service) from None
May 25 17:14:49 hassbian hass[3515]: homeassistant.exceptions.ServiceNotFound: (ServiceNotFound(…), 'Service persistent_notification.
May 25 17:14:49 hassbian hass[3515]: 2019-05-25 17:14:49 INFO (MainThread) [homeassistant.core] Timer:starting

Why i have these problems?
D

Summary

This text will be hidden

o I need to install the component?
Can anyone help me?

Thanks.

Can you format your code correctly?

Also you appear to have an extra bit to your config:
platform: ‘tuya’

My code is correct. “platform: ‘tuya’” is extra definition of app between ‘tuya’, ‘smart_life’ and ‘jinvoo’.
Even without this code, Home Assistant does not start.
I wrote my code in customize.yaml…

Any help?

Hi,

When he says format your code he means like I have below (see the top of the page explaining how to do this). This is how I use tuya components. You put this in your configuration.yaml file:

tuya:
  username: "[email protected]"
  password: "yourpassword"
  country_code: "86"
  platform: "smart_life"

You need to obviously change your country code and platform to the correct ones (the country code is the one you used when you signed up).

1 Like

You said customize.yaml - it should be in configuration.yaml

Ok. Tonight i will try in configuration.yaml with your example code…

I will warn you though - I have found it very unreliable and slow especially for my light bulb. The issue is you are forced to use their servers which is the problem. It seems like there used to be a way to control them locally but if I remember correctly that project is kind of dead now.

If you know what you are doing you may be able to reflash it with tasmota or similar - but unless you are confident in what you are doing I wouldn’t recommend this.

Hi Gary,

writing code in configuration.yaml, now Tuya Component is OK…

Thank you!

Hi all,
I’m running the most up2date version of HA 0.94.3.
I have added the tuya config in my configuration.yaml and get the following error:
has anyone an idea what this could be ?

[configuration.yaml:]

tuya:
  username: "[email protected]"
  password: "mypassword"
  country_code: "31"
  platform: "smart_life"

[ERROR LOG]

Error during setup of component tuya
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 156, in _async_setup_component
    component.setup, hass, processed_config)  # type: ignore
  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 58, in setup
    tuya.init(username, password, country_code, platform)
  File "/usr/local/lib/python3.7/site-packages/tuyapy/tuyaapi.py", line 44, in init
    self.get_access_token()
  File "/usr/local/lib/python3.7/site-packages/tuyapy/tuyaapi.py", line 68, in get_access_token
    raise TuyaAPIException(message)
tuyapy.tuyaapi.TuyaAPIException: Get accesstoken failed. Username or password error!

Remove the doublequotes (") around username, password, country_code and platform, should work

Done so, but without luck…

tuya:
  username: [email protected]
  password: mypassword
  country_code: 31
  platform: smart_life
1 Like

and is the error message the same as before? IT appears so far that your credentials aren’t accepted.
Also you’ve added smart_life as a platform. Are you 100% this is the platform that you need?
I can’t see what else to try.

Yes, life_smart is the app platform needed for my Aiconditioner

checking the log.

Looks like same error

Got reply from tuya support… No supported device…
Huh? Not taking this answer. Hence the problem seems to be related to authentication…

Received this to inquire this bug…
https://iot.tuya.com/index

Let see if my luck is getting me anywhere

You can literally just start again using the Tuya Smart app. It’s essentially a rebranded version of smart life except it just works better. Give it a try. The only reason manufacturers use the Smart Life app is because they want it to look like there own generic app. They dont want consumers to know that they are just using some cheaply licensed smart tech / software. Give Tuya a try.

Works like a charm ! thanks Phil!

1 Like

Glad to be of help. I read elsewhere about using Tuya and I was damned if I was going to switch. I spent ages trying to get Smart Life app to work but ultimately failed. I spent 10-15 mins switching everything over to Tuya and it all worked straight away.

I really just hope I can save people a lot of time and despair.

This topic has saved me a lot of troubleshooting. Thank you @Phill_Healey

platform: smart_life just doesn’t work. No matter how I configure it. It always reports auth issues in the HA logs. I have an account and I am able to control the switches with the Nedis app.

Switching from Nedis to Tuya worked better, but I’m unable to get correct status of the device I’m using (WIFIP310FWT). The four switches status is always off no matter what I do. I can however control the switches by using switch.turn_on and switch.turn_off. This will correctly switch the selected entity on or off. But the status does not change in HA.
switch.toggle on the other hand does nothing.


Anyone else experiencing this or have any clue what I can do to fix the issue?

I’m on the latest HA 0.97.2.

@mindtripper, you seem to be having the same issue as a handful of other people, myself included, and it’s starting to look like maybe it’s a Tuya API issue. The issue was reported here and here if you want to comment and help get the issue noticed.

2 Likes