Tuya integration - Multiple accounts

I finally managed to get HA to pick up my Tuya devices (not sure how, it just started seeing devices). However, I had an issue with one device that refused point-blank to connect using the Smart Life app. In the end, I used the Tuya app. From the integration’s perspective, it sees 2 accounts:
image

Clicking on the first account:
image

However, clicking on the second account:
image
No devices. However, clicking … > reload:

image
My device is found.

But, my 11 devices are lost.

It’s not some UI bug as I have set up a script to toggle the switch on one of the 11 devices and the single device. The script only actions devices in the “reloaded” account.

This feels like a bug in the integration, as it’s able to detect two accounts. Apart from re-syncing all 11 devices from Smart Life to Tuya, can anybody suggest a solution, please?

In the logs I see:
When account with 1 device is “reloaded”:

2022-12-12 23:43:55.633 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities switch.back_door_light_socket_1 or it is/they are currently not available

When account with 11 devices is “reloaded” (this is the 1 device):

2022-12-13 00:00:22.352 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities switch.garage_ext_lights_switch_1 or it is/they are currently not available

T.I.A.

Hi have the same issue, did you find a solution ?
I want to link my Smart Life and Tuya app. In the IOT plaform they are linked but in HA It’s the issue as explained above.

1 Like

Sorry for not replying sooner.

In the end, the SmartLife app decided to behave itself.

I guess the Tuya Integration maintainers don’t frequent these forums too often and the GiHub repo covers the whole of Home Assistant, so there are 2000+ open issues. One can filter by integration and that leaves 110 issues for Tuya, so I guess a request to properly support multiple instances or fix the bug (depending on how one looks at it), is low on the list.

Sorry, I can’t be of any assistance here.

1 Like

Same problem here. I can’t use Tuya Smart and Smart Life on the same Tuya integration, because only one at a time can have devices connected.

2 Likes

Anyone managed to find any solution to this problem?

1 Like

SOLUTION:

Scenario:
Two Tuya accounts (account_1, account_2) with respective devices/scenes etc

Solution:
create an account_3
in account_1, configure a family with own devices of account_1.
in account_2, configure a family with own devices of account_2
in account_1, invite account_3 to family as admin
in account_2, invite account_3 to family as admin
in account_3, accept both family invites
in HA, include ONLY account_3 using Official tuya Integration, all devices from both accounts will be included

NOTES:
2. Only compatible with same app (2 Tuya accounts OR 2 Smartlife accounts)
1.Currently working fine in my HA, needs more testing, especially with devices that have the same name in both accounts. (HA puts _2 in entity but I’m not sure it’s guaranteed to point to the correct device)

3 Likes

Thankyou rafareusch (Rafael)
Today I run in to it, and took your solution and all works just fine. Great idea.

1 Like