The content of this page has been automatically translated by AI. If you encounter any problems while reading, you can view the corresponding content in Chinese.

Calling Mini Program Capacity

Last updated: 2025-04-28 11:02:13

Standard Device Details Page for Mini Program Redirection

API definition
sdk.goDeviceDetailPage({
reload?: boolean,
deviceId?: string,
isShareDevice?: boolean,
shareParams?: object | string,
}) => Promise
Parameter Description
Parameter Name
Parameter Description
Type
Required
reload
If true, the data of the device will be re-pulled once after entering the details page.
If false, the cached device data will be used after entering the details page.
boolean
No
deviceId
Optional. If not provided, use the device ID of the current device.
string
No
isShareDevice
Optional. Whether the device is a shared device. If not provided, use the current sdk.isShareDevice.
boolean
No
shareParams
Optional. Custom share parameters for the device.
object
string
No
Return Value
Return a Promise.

Gateway for Mini Program Redirection - Add Sub-Device Page

API definition
sdk.goGatewayAddSubDevicePage(gatewayDeviceId: string);
parameter description
Parameter Name
Parameter Description
Type
Required
gatewayDeviceId
Gateway device ID.
string
Yes
Return Value
Return a Promise.

Feedback Page for Mini Program Redirection

API definition
sdk.goFeedBackPage() => Promise
return value
Return a Promise.

Device Information Page for Mini Program Redirection

API definition
sdk.goDeviceInfoPage({ deviceId?: string }) => Promise
Parameter Description
Parameter Name
Parameter Description
Type
Required
deviceId
Optional. If not provided, use the device ID of the current device.
string
No
return value
Return a Promise.

Mini Program Redirection - Modify Device Name Page

API definition
sdk.goEditDeviceNamePage({ deviceId?: string, name?: string }) => Promise
Parameter Description
Parameter Name
Parameter Description
Type
Required
deviceId
Optional. If not provided, use the device ID of the current device.
string
No
name
Optional. If not provided, use the aliasName of the current device.
string
No
Return Value
Return a Promise.

Dashboard Page for Other Devices Redirection

API definition
sdk.goDevicePanelPage(deviceId: string, customParams?: { passThroughParams: Record<string, string> }) => Promise
parameter description
Parameter Name
Parameter Description
Type
Required
deviceId
The device ID to redirect to the panel.
string
Yes
passThroughParams
It will be parsed into a query string and appended to the address of the panel to be redirected to.
Record<string, string>
No
return value
Return a Promise.

Mini Program Redirection - Room Settings Page

API definition
sdk.goRoomSettingPage({ deviceId?: string }) => Promise
Parameter Description
Parameter Name
Parameter Description
Type
Required
deviceId
Optional. If not provided, use the device ID of the current device.
string
No
return value
Return a Promise.

Jump to the Device Sharing Page of the Mini Program

API definition
sdk.goShareDevicePage({ deviceId?: string }) => Promise
Parameter Description
Parameter Name
Parameter Description
Type
Required
deviceId
Optional. If not provided, use the device ID of the current device.
string
No
return value
Return a Promise.

Refresh Data in the Mini Program

Require the mini program to perform a data refresh once after the current H5 panel is closed.
API definition
sdk.reloadAfterUnmount() => Promise
return value
Return a Promise.

Navigate to Another Mini Program

Navigate to another mini program. Applicable to scenarios such as in-panel purchase of added services. For input parameters and descriptions, see wx.navigateToMiniprogram.
Note:
Only after adding the appid of the target mini program to the allowlist can you call this API. If necessary, please contact customer service to enable it.
API definition
sdk.navigateToMiniprogram({ appid, extraData, envVersion }) => Promise
return value
Return a Promise.

Return to the Previous Level Page of the Mini Program

Can be used to proactively close the H5 panel.
API definition
sdk.navBack() => Promise
return value
Return a Promise.

Set the Sharing Content of the Current Page

Set the share content of the current page and push sharing information to the mini program through wx.miniProgram.postMessage. For details, refer to Mini Program Page Sharing Documentation.
API definition
sdk.setShareConfig({ title: string, imgUrl: string? }) => Promise
Parameter Description
Parameter Name
Parameter Description
Type
Required
title
Title for sharing.
string
Yes
imgUrl
The address for sharing an image will, by default, be a screenshot of the current page.
string
No
return value
Return a Promise.

Redirect to Cloud Scheduled

API definition
sdk.goTimingProjectPage({ deviceId, isShareDevice, featureId } = {})
parameter description
Parameter Name
Parameter Description
Type
Required
deviceId
Optional. If not provided, use the device ID of the current device.
string
No
isShareDevice
Optional. Whether the device is a shared device. If not provided, use the current sdk.isShareDevice.
boolean
No
featureId
Thing Model identifier. After the input parameter is passed in, only the scheduled tasks corresponding to the identifier will be filtered out.
string
No
return value
No return value.

Notify the Mini Program to Trigger Vibration

API definition
sdk.triggerVibrateShort(type)
Parameter Description
Parameter Name
Parameter Description
Type
Required
type
Vibration intensity type, valid values: heavy, medium, light.
string
Yes
Return Value
No return value.

Dashboard Page for video Equipment Redirection

API definition
sdk.goVideoPanelPage({ deviceId, passThroughParams, redirect })
Parameter Description
Parameter Name
Parameter Description
Type
Required
deviceId
The device ID to redirect to the panel. If not provided, the current device ID will be used.
string
No
passThroughParams
It will be parsed into a query string and appended to the address of the panel to be redirected to.
Record

No
redirect
Redirect via `redirectTo` if true, via `navigateTo` if false.
boolean
No
return value
No return value.