getPetBehaviorStatistics(data: GetPetBehaviorStatistics)

Requires:
@ray-js/ray≥1.6.27

Description

Get pet behavior indicator statistics

Parameters

ParameterTypeRequiredDescription
YesRequest parameters: optional device, pet, date range; aggregation options such as dateType, timeAggrType, indicatorCode

Return Value

Type: Promise<PetBehaviorStatistics>
Promise resolving to statistic items (datetime, value)

Referenced Types

typePetBehaviorStatistics
PropertyTypeDescription
datetimestringStatistics date
valuenumberIndicator value

Examples

Request example

import { getPetBehaviorStatistics } from '@ray-js/ray';

getPetBehaviorStatistics({
  devId: 'vdevo******',
  petId: 1,
  beginDate: '2025072500',
  endDate: '2025072523',
  dateType: 'hour',
  timeAggrType: 'NUM',
  indicatorCode: 'defecation',
})
  .then((res) => {
    console.log(res);
  })
  .catch(console.error);

Response example

{
  "datetime": "2025072500",
  "value": 3
}