Define Functions

Last Updated on : 2022-06-21 02:33:18download

After a product is created, define its functions first.

You can set functions, including standard functions, custom functions, and advanced functions.

Standard functions

Standard functions indicate the common functions in a specified category to implement standard device interconnection.

Standard functions

Data point (DP) ID DP Identifier Data transfer type Data type Property
1 Switch 1 switch_1 Send and report bool
2 Countdown 1 countdown_1 Send and report value Value Range: 0-86400, Pitch: 1, Scale: 0, Unit: s
3 Add Electricity add_ele Send and report value Value Range: 0-50000, Pitch: 100, Scale: 3, Unit: kwh
4 Current cur_current Report only value Value Range: 0-30000, Pitch: 1, Scale: 0, Unit: mA
5 Power cur_power Report only value Value Range: 0-50000, Pitch: 1, Scale: 1, Unit: W
6 Voltage cur_voltage Report only value Value Range: 0-5000, Pitch: 1, Scale: 1, Unit: V
7 Test Bit test_bit Report only value Value Range: 0-5, Pitch: 1, Scale: 0, Unit:
8 Power coe voltage_coe Report only value Value Range: 0-1000000, Pitch: 1, Scale: 0, Unit:
9 Electric coe electric_coe Report only value Value Range: 0-1000000, Pitch: 1, Scale: 0, Unit:
10 Power coe power_coe Report only value Value Range: 0-1000000, Pitch: 1, Scale: 0, Unit:
11 Electricity coe electricity_coe Report only value Value Range: 0-1000000, Pitch: 1, Scale: 0, Unit:
12 Fault fault Report only fault Valid values: ov_cr, ov_vol, ov_pwr, ls_cr, ls_vol, and ls_pow.
13 Switch switch_led Send and report bool
14 remote_id remote_id Send and report string
15 Mode mode Send and report Enum Enum Value: cold, warm, auto, air, and dehumid
16 Temperature target_temp Send and report Enum Value Range: 0-100, Pitch: 1, Scale: 1, Unit:
17 Fan fan_level Send and report string Enum Value: auto, low, middle, and high.
18 infrared switch infared_sw Send and report Boolean
19 Learning code report parameter study_code Report only Raw
20 Learning code parameter key_study Send only Raw
21 Control commands control Send and report Enum Enum Values: send_ir, study, study_exit, and study_key.
22 key_id key_id Send and report Value Value Range: 1-9999, Pitch: 1, Scale: 1, Unit:

The listed functions are required.

Description of DPs

1. Switch (required): DP ID 1

2. Countdown (required): DP ID 2

Switch countdown: value type, Wi-Fi, values ranging from 0 to 24 in hours.

3. Electrical metering: DP IDs 3 to 12

  1. Add Electricity: reports incremental power consumption of the device.

  2. Current, voltage, and power: real-time parameters of the device. If a certain threshold is exceeded, actual values are reported to improve data accuracy.

  3. Power coe, Electric coe, and Electricity coe: calibrates metering data.

  4. Fault: reports over-power and other faults.

4. Air conditioning (required): DP IDs 13 to 17

  1. Switch: switches an air conditioner on or off.
  2. remote_id: matches the remote control ID of an air conditioner.
    3): Mode: cool, warm, auto, air, and dehumid
  3. Temperature: ranges from 0 to 100, with a pitch of 1 and a scale of 1.
  4. Fan: auto, low, middle, and high

5. Infrared remote control (required): DP IDs 18 to 22

  1. Infared switch: switches an air conditioner on or off with remote control.
  2. Learning code report parameter: sends infrared code content.
  3. Learning code parameter: receives and sends command content.
  4. Control commands: sends infrared codes, performs learning and infrared coding, and exits learning.
  5. key_id: infrared code ID.

Advanced functions

With CloudTiming enabled, you can set recurring tasks from Monday to Sunday to regularly switch on or off a device. The scheduled tasks support automatic adjustment for daylight saving time (DST).

Define Functions