To help smart socket developers easily integrate apps with their devices, the platform provides a complete set of standard, no-code app interfaces. This allows developers to focus solely on device-side development, because no cloud or app development is needed to create a demo.
Solution overview
This solution uses the public app provided by the platform and includes the following basic features.
- Support for multiple socket standards, such as Chinese, US, Japanese, international, and European.
- On/off control
- Scheduling (cloud, local, random, and loop timers)
- Countdown (local)
The following image shows the interface for a socket. Currently, only single-outlet sockets are supported.

Feature definitions
Create a product in the console. Select Socket as the category and choose the following standard features.
If you use a multi-outlet power strip, add the required number of PowerSwitch properties based on your product's attributes. There is no limit to the number of properties you can add.
For example, for a 6-outlet power strip, you need to add five additional power switch properties, Power Switch_1 through Power Switch_5, in addition to the mandatory power switch. These are identified as PowerSwitch_1 through PowerSwitch_5.
| Feature Name | Identifier | Data Type | Required | Data Definition |
| Requires a power switch | PowerSwitch | Boolean | No |
|
| Power Switch_1 (for multi-outlet power strips) | PowerSwitch_1 | Boolean | No |
|
| Local Timer | LocalTimer | Array | No | Element type: JSON array |
| Countdown List | CountDownList | General-purpose | No | JSON object |
| Real-time Power | RealTimePower | Float | No | To display metering statistics on the app page, add this property to the feature definitions. |
| Unit Power Consumption | UnitPowerConsumption | Float | No | To display metering statistics on the app page, add this property to the feature definitions. |
| Loop Timer | PeriodTimer | JSON | No | Can correspond to PowerSwitch |
| Loop Timer 1 | PeriodTimer_1 | JSON | No | Can correspond to PowerSwitch_1 You can add up to nine timers, through PowerSwitch_9. |
| Random Timer | RandomTimer | JSON | No | Can correspond to PowerSwitch |
| Random Timer 1 | RandomTimer_1 | JSON | No | Can correspond to PowerSwitch_1 You can add a maximum of 9 items, up to PowerSwitch_9. |
| Current Voltage | CurrentVoltage | Float | No | To display the voltage on the app page, add this property to the feature definitions. |
| Current | Current | Float | No | To display the current on the app page, add this property to the feature definitions. |
Interface logic
- Switch
You can click the image in the center of the page or the switch button to turn the socket on or off.
- Timer
You can choose between Cloud Timer and Local Timer. If you add the Local Timer standard property in the feature definitions, the local timer feature is enabled by default on the page. If you do not add this property, the Cloud Timer is used by default.
- Cloud Timer: After a user sets a timer, the task is saved in the cloud. When the scheduled time arrives, the cloud sends an instruction to the device to execute the task. The advantage is that the device does not need to handle complex timer logic and only needs to implement basic device features. The disadvantage is that the task cannot be executed in weak network conditions or when the device is offline.
- Local Timer: After a user sets a timer, the task is saved on the device. When the scheduled time arrives, the device executes the instruction itself. The advantage is that the device can execute the task even in weak network conditions or when offline. The disadvantage is that you must implement the timer logic on the device. For more information, see Develop the local timer feature for a device.
- Countdown
The countdown timer is a local timer. This means the countdown task is saved on the device, not in the cloud. For more information, see Develop the local countdown feature.
- Electricity and power statistics
After you add the Real-time Power and Unit Power Consumption properties in the feature definitions, the app's device panel for the socket or power strip can display daily and monthly electricity consumption and the device's current real-time power. The device reports this data.
- Voltage and current
After you add the Current Voltage and Current properties in the feature definitions, the standard socket panel displays the real-time voltage and current. The device reports the data.
- Loop timer
After you add the Loop Timer property in the feature definitions, an entry for the loop timer appears on the socket or power strip panel when you click the timer button. After a user sets a loop timer, the device repeatedly turns on and off during the specified period.
The data structure is as follows.
PeriodTimer:{ StartTime:'13:01', // Start time, must be 5 bytes EndTime:'20:02', // End time, must be 5 bytes TimeZoneOffset:28400, // The difference between UTC and local time, in seconds RunTime:30, // Data type is int, unit is minutes SleepTime:20, // Data type is int, unit is minutes Repeat:'', // Indicates no repeat Enable:0, // Specifies whether to enable the timer // '1,2,4,5' indicates that the timer runs on Monday, Tuesday, Thursday, and Friday } - Random timer
After you add the Random Timer property in the feature definitions, an entry for the random timer appears on the socket or power strip panel when you click the timer button. After a user sets a random timer, the task does not execute at the exact scheduled time. Instead, it runs at a random time within 30 minutes before or after the set time.
The data structure is as follows.
RandomTimer: { StartTime:'13:01', // Start time, must be 5 bytes EndTime:'20:02', // End time, must be 5 bytes TimeZoneOffset:28400, // The difference between UTC and local time, in seconds Repeat:'', // Indicates no repeat Enable:0, // Specifies whether to enable the timer // '1,2,4,5' indicates that the timer runs on Monday, Tuesday, Thursday, and Friday }
Standard panel app screenshots
-
Single-outlet socket

- Multi-outlet power strip

- Power and electricity statistics charts

- Random and loop timers
