English
English
简体中文
Contact Us
Register
Log In
Tuya IoT Development PlatformApp DevelopmentPanel StudioShift temperature scaleConvert Temperature Scale: Follow the App Account Center

Convert Temperature Scale: Follow the App Account Center

Last Updated on : 2022-03-01 07:55:20

Users can set the Temperature Unit field on the Settings page of the Tuya Smart app to display their preferred temperature unit on the control panel. This topic describes how to implement this function by enabling Shift temperature scale - Follow the App Account Center in the Panel Studio.

Overview

After you enable Shift temperature scale - Follow the App Account Center for multiple products, once users set a preferred temperature unit on the Tuya Smart app, the control panel of these products automatically displays temperature in the users’ preferred unit. For more information about the conversion of units of temperature, see the section Temperature conversion rules. The following figure shows the temperature scale changes on the panel after the temperature unit is changed in the Tuya Smart app. Convert Temperature Scale: Follow the App Account Center

Set functions

Before you enable Shift temperature scale - Follow the App Account Center in the Panel Studio, you must select temperature-related data points (DPs) either in Celsius (℃) or Fahrenheit (℉) on the Tuya IoT Platform. Perform the following steps:

Before you begin

Log in to the Tuya IoT Platform. In the left-side navigation pane, choose Products > Development. On the Smart Products page, click Create to create a product. Then, specify the required DP in the Create Standard Functions dialog box. The specified DP appears on the Function Definition tab.

Example

DP: Current Temperature or Current Temperature_F.

Note: You must select DP either in Celsius (℃) or Fahrenheit (℉).

Convert Temperature Scale: Follow the App Account Center

Procedure

  1. Go to the Panel Studio, choose More > Shift temperature scale in the top right corner of the page.
  2. In the dialog box that appears, click Yes in the Use the temperature scale in app account center? section. On the message that appears, click Confirmed.

Convert Temperature Scale: Follow the App Account Center
3. Log in to the Tuya Smart app. Tap Me at the bottom of the homepage. On the page that appears, tap the Settings icon in the top right corner of the page. On the Settings page, set Temperature Unit to .

Note: After the preceding settings, the temperature that appears on the panel is changed from 12℃ to 53℉.

Convert Temperature Scale: Follow the App Account Center

Temperature conversion rules

Temperature conversion formulas

  • Fahrenheit to Celsius: [℃] = ([℉] − 32) × ​5/9
  • Celsius to Fahrenheit: [℉] = [℃] × ​9/5 + 32

Round values

  • If the original unit of the DP for the specified product ID (PID) is ℃, the temperature value is rounded down after the unit is changed to ℉.
  • If the original unit of the DP for the specified product ID (PID) is ℉, the temperature value is rounded up after the unit is changed to ℃.
  • If the scale is set to 0, the temperature value is rounded to an integer. If the scale is set to 1, the temperature value is rounded to one decimal place. By default, the scale is set to 0.

Example 1: set the scale to 0

If the current temperature is 11℃ and the temperature is converted into 51.8℉, the temperature is displayed as 51℉ on the panel. If the current temperature is 12℃ and the temperature is converted into 53.6℉, the temperature is displayed as 53℉ on the panel.

℃ (scale=0, step=1) Calculated ℉ Displayed ℉
11 51.8 51
12 53.6 53

If the scale is set to 0, the current temperature 11℃ is displayed as 51℉ and the current temperature 12℃ is displayed as 53℉ on the panel.

Convert Temperature Scale: Follow the App Account Center

Convert Temperature Scale: Follow the App Account Center

Example 2: set the scale to 1

If the scale is set to 1, the current temperature 11℃ is displayed as 51.8℉ and the current temperature 12℃ is displayed as 53.6℉ on the panel.

Convert Temperature Scale: Follow the App Account Center

Convert Temperature Scale: Follow the App Account Center

Notes

If the unit of the DP is invalid or not specified, the preceding rules cannot take effect. Each temperature unit is one sole character, rather than a sequence of a degree sign and a letter. The following units are supported:

  • Degree Celsius:
  • Degree Fahrenheit: