Awesome
Smart Life (Beta) Home Assistant Integration
If you like Tuya Smart Life (Beta) Integration, please give it a star or fork it and contribute!
Smart Life(Beta)Integration Documentation
<p align="center"> <img src="https://images.tuyacn.com/app/hass/ha_tuya.png" width="70%"> </p>The Smart Life(Beta)integration is developed for controlling Powered by Tuya (PBT) devices using the tuya-device-sharing-sdk, and maintained by the official Tuya Developer Team.
It is currently in beta testing, and there is still room for improvement in terms of functionality and stability. Feel free to install and try it out.
We really appreciate your contributions and awesome ideas to this project. We are happy to hear your voices at GitHub Discussions to make our integration better.
Please provide feedback to Tuya through Github Issues to help us improve and optimize it.
Important Note
What's the difference between "Tuya" and "Smart Life" Integrations?
-
Tuya Integration relies on Tuya IoT Core Service subscription, if the subscription has expired, the integration will stop working. Users are required to manually extend the trial subscription period, which can be inconvenient and frustrating.
-
Tuya Smart Life (Beta) integration has removed the Tuya cloud development workflow, allowing users to simply scan and log in using the Smart Life app, and then seamlessly sync their IoT devices directly to Home Assistant. It offers a simplified and efficient solution.
Note: If you are transitioning from the Tuya Integration to the Smart Life (Beta) integration, it may be necessary to set up all your devices again within your Smart Life app account. The migration process does not support directly transferring devices from one integration to the other.
Installation Guide
How to Install Smart Life Integration (Beta)
Video Guide
Prerequisites
Your devices need to first be added in the Smart Life app.
Supported Tuya Device Categories
Seven primary categories, 50 secondary categories are supported now!
:clap: Supported Device Category
Category/Standard Instruction Set Expansion Development
When developers find that a certain functionality is not supported in Smartlife, developers can develop that support following these steps:
Step 1: Download and Review Diagnostic File
Download the diagnostic file and review the category and supported standard instruction set data of the device.
data["category"]
: Device categorydata["function"]
anddata["status_range"]
: Standard instruction set's Data type and Value descriptiondata["status"]
: Value of the standard instruction set- See the Standard Instruction Set Document available in the Home Assistant Entity Development Guide for more details.
Step 2: Refer to Smartlife's Supported Entity Code Files
Smartlife supports 16 entity code files: Code file address
alarm_control_panel.py
binary_sensor.py
button.py
camera.py
climate.py
cover.py
fan.py
humidifier.py
light.py
number.py
scene.py
select.py
sensor.py
siren.py
switch.py
vacuum.py
Add the entity's support in the relevant file(s) as per the Standard Instruction Set in the Home Assistant Entity Development Guide. If the existing files don't suffice, you can add new entity files to accommodate new entity types.
Step 3: Test Before Submitting PR
Finally, ensure that the modifications are tested locally before submitting your PR.
Example - Adding Functionality
As an example, you may need to add numeric display functionality for the standard instruction "cur_current" under the "dlq" category in sensor.py
. Locate the "dlq" category in the SENSORS dictionary (add it if not already present), and implement support for the standard instruction "cur_current".
Code Linking
Pull Requests Workflow
-
Fork the project: Developers first need to fork the
dev
branch of our project smartlife on GitHub to their own accounts. -
Start development: On the newly forked branch, developers make modifications and further developments to category and standard instruction sets.
-
Commit changes: After the development is accomplished, developers need to commit their changes to their GitHub repositories.
-
Create a Pull Request: Developers then need to create a Pull Request in their GitHub repository, requesting their modifications to be merged into your
dev
branch. -
Review the Pull Request: The submitted Pull Requests need to be reviewed.
-
Testing: The internal staff regularly carry out tests.
-
Merge to
main
: If the tests on thedev
branch show no issues, then the changes are merged into themain
branch. -
Release a new version: On the
main
branch, release a new version for users.
Follow Us
Follow us to get more information and leading technology on the Internet of Things, as well as updates and activities on the Tuya IoT Developer Platform
Issue Feedback
You can give feedback on issues you encounter for the project via GitHub Issue.
Related Projects
LICENSE
For more information, please refer to the LICENSE file.