Page 1 of 1
Accessing rooms using the tuya-device-sharing-sdk
Posted: 2026年 May 22日 19:49
by novusdash123
Hello. We are working on an integration for Home Assistant that connects to tuya energy metering devices. We are using the official tuya-device-sharing-sdk for this: https://github.com/tuya/tuya-device-sharing-sdk.
For now, this sdk offers everything we need except the ability to query rooms. It currently has an option to query homes and query devices by home, but it does not support rooms. Is there a way to query rooms using this same SDK? If not, is it possible for the Tuya team to add this functionality into the SDK?
Re: Accessing rooms using the tuya-device-sharing-sdk
Posted: 2026年 May 22日 19:59
by JamesG
Hello. The home and room hierarchy belongs to the data model of the Tuya app, not Home Assistant. Please use the local configuration within Home Assistant if you need relevant room data models.
Re: Accessing rooms using the tuya-device-sharing-sdk
Posted: 2026年 May 22日 20:02
by novusdash123
Thank you for your reply. The room/home data hierarchy does indeed belong to the tuya smart app. Since we are building an integration that would make use of this data and sync it to home assistant, we need access to them. The home data is already accessible by default using the previously mentioned tuya-device-sharing-sdk, but room is not. What I need is a way to also fetch the room data in the same way so that I can sync them between the tuya smart app and home assistant (the same way it is currently available for home).
Re: Accessing rooms using the tuya-device-sharing-sdk
Posted: 2026年 May 22日 20:05
by novusdash123
I also claim that adding this feature will be very useful for lots of integrations in home assistant as this will allow them to get access to this important data hierarchy, including the official tuya integration as well.
Re: Accessing rooms using the tuya-device-sharing-sdk
Posted: 2026年 May 22日 20:16
by JamesG
Could you elaborate on how you intend to use the room data in Home Assistant?
Re: Accessing rooms using the tuya-device-sharing-sdk
Posted: 2026年 May 22日 20:34
by novusdash123
Sure. Currently the default tuya integration does not group devices into hierarchies the same way they are grouped in the tuya app. For example if I have a 100 devices that are grouped into 2 homes and 5 rooms for each home, they will just be all mixed together in Home Assistant. An option to handle this is to manually group the devices into Floors and Areas (the native way to group devices in Home Assistant). This works, but every time I need to add a device or move it to another home, I will need to manually add the device or move it in Home Assistant. For this reason, it would make sense to sync rooms/homes to Home Assistant (for example homes -> floors and rooms -> areas).
Other ways to utilize this data can be possible, for example grouping devices in the same room into one dashboard, or allowing home assistant to turn on/off all devices in a specific room using a custom integration... The ways this can be utilized by integration developers is countless, these are few ideas that comes to mind. The first use case is what I am personally trying to achieve.
Re: Accessing rooms using the tuya-device-sharing-sdk
Posted: 2026年 May 22日 20:41
by JamesG
Okay, got it. We will discuss this scenario next week and get back to you later.
Re: Accessing rooms using the tuya-device-sharing-sdk
Posted: 2026年 May 22日 20:42
by novusdash123