Last Updated on : 2024-06-19 02:17:57download
A placeholder is a small piece of code that will be replaced with specific property values. You can use placeholders in different setting fields of notification when editing notification templates. Placeholders make it possible to personalize the notifications and deliver useful information to end users.
For example, the ordinary message to alert users of high temperature is High temperature is detected, attention!
. If you want to provide more details, such as the detected temperature, you can add a placeholder to the template to represent the variable for temperature.
Placeholder | Description |
---|---|
Device name ${device} | The name of a device. |
Username ${username} | The username of an end user. |
Rule name ${rule} | The title of a notification rule. |
DP value ${dp**} | The value of a data point (DP). For example, the values reported by the DPs such as temperature and wind level. |
DP name ${DP**_name} | The name of a DP. For example, the name of a DP such as temperature or wind level. |
Log in to the Tuya Developer Platform. Choose Product > Device > Notifications. Click Create Notification.
Edit the template as needed.
Click Add Placeholder to insert a placeholder.
To use ${dp**}
and ${DP**_name}
, you need to specify the corresponding DP ID. The asterisk symbols (**) are replaced with the value of the DP ID.
The placeholders only support DPs of value type and string type.
We recommend you use DP value for temperature related notifications, so that end users can be informed of the detected temperature.
Configure templates
Title: High temperature warning
Content: Your device ${device} temperature has reached ${dp**}.
**
represents the DP ID. Make sure to replace the **
with the value of the corresponding DP ID.
Sample
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback