Tuya IoT Development PlatformApp DevelopmentDevice PanelPanel StudioTemperature Unit ConversionConvert Temperature Scale: Switch Between Celsius and Fahrenheit

Convert Temperature Scale: Switch Between Celsius and Fahrenheit

Last Updated on : 2023-10-12 07:59:53

Overview

A device might report the temperature in both Celsius (℃) or Fahrenheit (℉). The associated panel displays temperature in only one of the units. In this case, users can switch the temperature unit on the panel to check the temperature in each of the units. You can add style linking rules on the Panel Studio. These rules are used to switch the temperature unit.

DPs

Before you go to the Panel Studio, you must select specific data points (DPs) on the Function Definition tab on the Tuya IoT Platform. These DPs allow you to switch the temperature unit. You can click All in the Create Standard Functions dialog box to select all DPs. This way, you do not need to select required DPs one by one.
Convert Temperature Scale: Switch Between Celsius and Fahrenheit

Procedure

  1. Select components.
    Go to the Panel Studio, and drag the Temp Set, Temp Set F, and Temp Unit Convert components from the list of components to the canvas.
    Convert Temperature Scale: Switch Between Celsius and Fahrenheit
  2. Set style linking rules.
    On the canvas, select the component with the temperature unit that you want to hide. In the right-side pane of the page, click the Attribute tab and click Style linking. In the Style linking pane, click Add to open the Add pane. Then, set the rules to hide the specified temperature unit.
    Convert Temperature Scale: Switch Between Celsius and Fahrenheit
  3. View rule details.

Note: You can customize a rule name. After you select the component with the temperature unit that you want to hide, set the style linking rules for the component.

To hide the temperature in ˚C, set Temp Unit Convert to ˚F.
Convert Temperature Scale: Switch Between Celsius and Fahrenheit

To hide the temperature in ˚F, set Temp Unit Convert to .

Convert Temperature Scale: Switch Between Celsius and Fahrenheit
4. Show hidden components.

Note: The specified component is hidden based on the preceding settings. Select Show all elements above the canvas to show the hidden component.

Convert Temperature Scale: Switch Between Celsius and Fahrenheit