With smart switches, users can remotely control connected appliances with a mobile app or voice and view appliance status at a glance. This demo describes how to quickly prototype a smart switch with the Tuya Sandwich development board.
AC on/off control and energy monitoring.more
You can download different types of Zigbee SoC no-code firmware from the Tuya IoT Platform and use them with applicable function boards. You can also develop firmware based on the SDK.more
Power other components of the Tuya Sandwich Evaluation Kit.more
Power the power board.more
Log in to the Tuya IoT Platform.
See Create Products to create a Zigbee switch with a custom solution.
Select functions for the switch. In this demo, the selected functions are shown in the following figure.
Select a device panel. For more information, see Design App UI.
In the step of Hardware Development, select the Self-developed Module SDK, and complete the relevant information.
In the Download Documents area, you can download the SDK.
After you extract the SDK, you can find the demo and documentation in the apps
folder.
You can refer to the sample_switch1
demo for the EFR32MG21A020F768
chip in the switch
directory and modify the code to implement switch functionality.
Modify the firmwareInfo
in the package.json
, including pid
, model_id
, and manufacture_name
. The specific description is as follows:
pid
is generated when you create a product in Step 1.
The values of model_id
and manufacture_name
for switches can be found in the Zigbee Protocol Specification.
In this demo, fill TS0001
in model_id
field and TZ3000
in manufacture_name
field.
The following figure shows the modified firmwareInfo
in the package.json
file.
Modify the ioConfig
in the package.json
file according to circuit parameters. The following figure shows the modified values.
When you have finished modifying package.json
, you can compile the IAR project. The system will automatically apply the modified values to the application code and generate the firmware for production and updates in the exe
folder under the build
folder.
Test stage
With the Simplicity Commander provided by Silicon Labs, you can program the production firmware generated in Step 2 to the development board for testing. The authorization is only valid for seven days. The following section describes how to have the firmware authorized permanently.
Production stage
Go to Tuya Service & Support and submit a technical ticket for assistance. Tuya’s technical staff will help you upload the firmware and apply for an authorization code for programming and authorizing.
After you get the authorization code, you can proceed with programming and authorizing. For more information, see Firmware Programming and Authorization. An authorized module can be connected to the Tuya IoT Platform.
Zigbee devices are connected to the network through a Zigbee gateway.
Connect the Zigbee gateway to the cloud with the Tuya Smart app.
Enable the device to be pending for pairing according to the pairing setting specified in the code. In this demo, you can press and hold the button on the Zigbee SoC master control board (ZS3L) until the indicator flickers fast.
Open the Tuya Smart app, select the added gateway, and tap Add subdevice.
Follow the prompts to operate. When the device is connected to the cloud, you can control the switch with the Tuya Smart app.
You can integrate popular voice assistants into your products. Go to Tuya Value Added Service and click Smart Voice to find more.
After your device is certified, you will see the voice assistant logo on the product information page. See the Quick Guide of Using Amazon Echo to Control Smart Devices to bind the device to the voice assistant platform and enable device control with voices.
For more information, see Third-Party Access.
You have prototyped a smart switch successfully. Based on the Tuya IoT Platform, you can quickly and easily build a smart prototype from scratch with Tuya Sandwich Evaluation Kit.
Is this page helpful?
YesSuggestions