หน้านี้ยังไม่พร้อมใช้งานในภาษาท้องถิ่นของคุณ เรากำลังพยายามอย่างหนักเพื่อเพิ่มเวอร์ชันภาษาอื่น ๆ เพิ่มเติม ขอบคุณสำหรับการสนับสนุนเสมอมา

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ IoT Device Access/ Best Practices/ Device Management/ Automatically Adjusting Air Conditioner Temperature Through Device Shadow

Automatically Adjusting Air Conditioner Temperature Through Device Shadow

Updated on 2025-03-03 GMT+08:00

Scenarios

Using a constant-temperature control system, you can adjust the default temperature of air conditioners (regardless of whether they are powered on). After being powered on, the air conditioners automatically run at the default temperature. This is achieved by using the device shadow of the IoT platform. For any connected air conditioner, you can set the device shadow on the application or IoTDA console to deliver the preset temperature to the air conditioner. The air conditioner automatically adjusts the temperature after receiving the property modification request.

Developing a Product

  1. Visit the IoTDA service page and click Access Console. Click the target instance card.
  2. In the navigation pane, choose Products. In the search box, select the resource space to which the new product belongs.
  3. Click Create Product to create a constant-temperature air conditioner product, set the parameters, and click OK.

    Basic Information

    Product Name

    Enter a value, for example, aircondition.

    Protocol

    Select MQTT.

    Data Type

    Select JSON.

    Industry

    Customize the values.

    Device Type

  4. After the product is created, click the corresponding product to access its details.
  5. On the Basic Information tab page, click Customize Model and configure the product model based on the table below.

    Service data

    Service

    Service ID: Enter temperature.

    Service Type: You are advised to set this parameter to the same value as Service ID.

    Property

    Property Name: Enter temperature.

    Data Type: Select Integer.

    Access Permissions: Select Read and Write.

    Length: Enter 1.

  6. In the navigation pane, choose Devices > All Devices, and click Register Device. In the dialog box displayed, set the parameters based on the table below.

    Figure 1 Registering a device - MQTT

    Parameter

    Description

    Product

    Select the product created in 3.

    Node ID

    Set this parameter to the IMEI, MAC address, or serial number of the device. If the device is not a physical one, set this parameter to a custom character string that contains letters and digits.

    Device Name

    Customize the value.

    Authentication Type

    Select Secret.

    Secret

    Customize the secret used for device access. If the secret is left blank, the platform automatically generates a secret.

Configuring a Device Shadow

You can set a device shadow on the IoTDA console or by calling the API for configuring desired properties in a device shadow on the application side. This section describes how to set a device shadow on the IoTDA console.

  1. Log in to the IoTDA console, choose Devices > All Devices in the navigation pane, and click View in the row of the device registered in 6 to access its details.
  2. On the Device Shadow tab page, click Configure Property.
  3. In the dialog box displayed, enter the desired value of a property. In this example, the value of temperature is set to 25.

    Figure 2 Configuring a device shadow

Verifying Configurations

Method 1:

You can use MQTT.fx to simulate device verification.

  1. Use MQTT.fx to simulate a constant-temperature air conditioner and connect it to the platform. For details, see Developing an MQTT-based Simulated Smart Street Light Online.
  2. On the Subscribe tab page, enter topic=$oc/devices/{device_id}/sys/shadow/get/response/# of the device shadow (replace {device_id} with the device ID in 6), and click Subscribe.

  3. On the Publish tab page, enter Topic=$oc/devices/{device_id}/sys/shadow/get/request_id={request_id} of the device shadow.
  4. Enter a request for obtaining the device shadow and click Publish.
    Example:
    {
    	"object_device_id": "**********",
    	"service_id": temperature"
    }

  5. Click the Subscribe tab. The device shadow data delivered by the platform is displayed.

Method 2:

You can connect a physical device to the platform. The device will receive the device shadow configuration delivered by the platform and change the preset temperature accordingly.

เราใช้คุกกี้เพื่อปรับปรุงไซต์และประสบการณ์การใช้ของคุณ การเรียกดูเว็บไซต์ของเราต่อแสดงว่าคุณยอมรับนโยบายคุกกี้ของเรา เรียนรู้เพิ่มเติม

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback