English
English
简体中文
Contact Us
Register
Log In
layoutIndex

Function Definition

Last Updated on : 2022-06-21 01:47:33download

Types of data point (DP)

After the feeder is defined, the corresponding functions need to be abstracted into different DP function points to realize data transmission and control. For pet feeders, take the public version product definition as an example. The corresponding relationship between functions and DP is shown in the following table.

DP
ID
DP Identifier Data
transmission
type
DP
type
DP
property
Remarks
1 Meal plan meal_plan Send/report RAW - Synchronize to the local device of the device, even if the device is offline, it can still feed and deliver food normally. The meal plan supports up to 10 meal plans.
2 Fast feeding quick_feed Send/report Bool - Fast feeding: Fast feeding function. Click to send feeding. The specific number of servings is determined by the MCU and the default parameters
3 Manual feeding manual_feed Send/report Integer The value ranges from 1 to 12, with a pitch of 1 and a scale of 0. Unit: serving.


Manual feeding: Manually select the number of feeding portions.
4 Feeding status feed_state Report only Enum Enum value
standby
feeding
done
Feeding status: The feeding status of the device, including standby, feeding, and feeding completion, etc.;
supports custom feeding status.
5 Unit conversion unit Send/report Enum Enum value
cup
oz
grid
Unit conversion: Used to switch food units.
6 Slow feeding slow_feed Send/report Bool - Enable the switch and turn on the device to perform slow feeding.
7 Calibration of output grain export_calibrate Send/report Bool - Click on the disbursement calibration switch and the device will automatically execute it. After the execution is completed, it will automatically close.
8 Calibration of remaining grain weight_calibrate Send/report Bool - Click on the remaining food calibration switch and the device will automatically execute it. After the execution is completed, it will automatically close.
9 Restore to factory defaults factory_reset Send/report Bool - Restore to factory settings: Restore the device to factory settings.
10 Calibration status of output grain export_state Report only Enum Enum value
true
false
Calibration status report of output grain
11 Battery capacity battery_percentage Report only Integer The value ranges from 0 to 100, with a pitch of 1 and a scale of 0. Unit: serving.


When the device is powered off, it will automatically switch to battery mode, supporting the display of battery power.
12 Charging status charge_state Report only Bool - Charging status display. Charging or fully charged.
13 Status of feeding cover cover_state Report only Enum Enum value
on
off
Report the status of the feeding cover, and the app can display the opening status of the feeding cover.
14 Fault alarm fault Report only Fault Fault value
e1
e2
e3
Displays fault alerts of the device.
15 Feeding result report feed_report Report only Integer The value ranges from 1 to 12, with a pitch of 1 and a scale of 0. Unit: serving.


Report the feeding results for data statistics.
16 Remaining grain in the bucket surplus_grain Report only Integer The value ranges from 0 to 100, with a pitch of 1 and a scale of 0. Unit: serving.


Report remaining percentage.
17 Weight of remaining grain weight Report only Integer The value ranges from 0 to 10,000, with a pitch of 1 and a scale of 0. Unit: serving.


Report the remaining grain weight and support unit switching.
18 Voice prompt times voice_times Send/report Integer The value ranges from 1 to 12, with a pitch of 1 and a scale of 0. Unit: serving.


Set the play times, voice call pets to come and eat before each feeding.
19 Night light light Send/report Bool - Night light switch.
20 Switch switch Send/report Bool - Device master switch.

Description of DPs

Meal plan function description

RAW format convention: Implement local timing according to period, time, the number of servings and switch. It is shown as follows:

  • The first 7 bits represent Monday to Sunday, binary to hexadecimal, occupying one byte, 0 means not set, 1 means set, such as 0000001, means Sunday is effective, and converted to hexadecimal is 01.
  • The time is in the format of hours and minutes, occupying 2 bytes, minutes and hours, from decimal to hexadecimal, such as 18:50, to hexadecimal to 1232.
  • The number of servings occupies 1 byte, converts a decimal to hexadecimal, such as 12, converts to hexadecimal to be 0c.
  • The switch occupies 1 byte. 00: Disabled. 01: Enabled.

In the above example, the result issued by the app terminal time is 0112320c01, which means that on Sunday, 18:50, 12 servings are fed, and it is turned on.

Feeding result report

The device reports the number of servings per feeding through the feeding result report DP, and Tuya Cloud will record each feeding record and display it on the app.

Manual feeding and quick feeding function description

When the number of servings is not selected on the app, click the Feed button to issue the Fast Feeding DP. When the number of servings is not selected on the app, click the Feed button to issue the Manual Feeding DP.

Local timing (meal plan) and cloud timing function description

  • Local timing (meal plan): When adding meal plan DP, regardless of whether the cloud timing function is checked or not, the device local timing is enabled at this time.

    Function Definition

  • Cloud timing: When the meal plan DP is not added and the cloud timing function is checked, the cloud timing function is enabled at this time. Supported comments and push notifications of scheduled tasks.

    Function Definition

    Function Definition