---
name: "getLightRhythmsTimeInfo"
mode: "api"
versionRequirements:
  - { name: "@tuya-miniapp/cloud-api", version: "1.0.5" }
---

## getLightRhythmsTimeInfo

> [VERSION] @tuya-miniapp/cloud-api >= 1.0.5

> 💡 This API is a cloud capability and requires authorization before use. For details on cloud capabilities, see the [documentation](/cn/miniapp/common/desc/tech-stack/api). Currently, cloud capabilities are not available in the Developer Tools environment; you must package the app or debug on a real device.

### Description

Get sunrise and sunset times and return them in the device or group's time zone.

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | `CommonLonLatParams` | Yes | Request parameters: bizId (business ID), bizType (business type: 0 = device, 1 = group), lon (longitude), lat (latitude). |

### Return Value

Type: `Promise<TimeInfo[]>`

TimeInfo[]; fields: date (date, format yyyyMMdd), sunrise (sunrise time), sunset (sunset time), transitAtNoon (noon time), dawn (pre-sunrise time), dusk (post-sunset time)

##### TimeInfo

| Property | Type | Description |
| --- | --- | --- |
| `date` | `string` | Date |
| `sunrise` | `string` | Sunrise time |
| `sunset` | `string` | Sunset time |
| `transitAtNoon` | `string` | Noon time |
| `dawn` | `string` | Twilight time |
| `dusk` | `string` | Twilight time |

### Referenced Types

##### `interface` CommonLonLatParams

| Property | Type | Description |
| --- | --- | --- |
| `bizId` | `string` | Business ID |
| `bizType` | `0 \| 1` | Business type |
| `lon` | `string` | Longitude |
| `lat` | `string` | Latitude |


### Examples

#### Request example

```typescript
import { getLightRhythmsTimeInfo } from '@tuya-miniapp/cloud-api';

getLightRhythmsTimeInfo({
  bizId: 'vdevo167504******003',
  bizType: 0,
  lon: '112.233',
  lat: '30.233',
})
  .then((response) => {
    console.log(response);
  })
  .catch();
```

#### Response example

```json
[
  {
    "date": "20231020",
    "sunrise": "22:35",
    "dusk": "10:25",
    "transitAtNoon": "04:15",
    "sunset": "09:55",
    "dawn": "22:05"
  }
]
```


### FAQ

#### Why does the biological rhythm cloud capability call fail?

[Biological rhythm](https://developer.tuya.com/en/docs/iot/geographic_biorhythm?id=Kbn3r2z592at4) must have advanced capabilities enabled on the Tuya Developer Platform product feature definition page. Otherwise cloud capability calls will fail.
