Skip to content

GetInterpolatedAssetPropertyValues

Source: src/AWS/IoTSiteWise/GetInterpolatedAssetPropertyValues.ts

Runtime binding for iotsitewise:GetInterpolatedAssetPropertyValues — compute interpolated values (LINEAR_INTERPOLATION or LOCF_INTERPOLATION) of one property of the bound asset at a fixed interval from a deployed Lambda or Task.

Provide the GetInterpolatedAssetPropertyValuesHttp implementation layer on the Function effect, bind the asset in the init phase, then call the returned client at runtime.

// init
const getInterpolated =
yield* AWS.IoTSiteWise.GetInterpolatedAssetPropertyValues(asset);
// runtime
const now = yield* Effect.sync(() => Math.floor(Date.now() / 1000));
const { interpolatedAssetPropertyValues } = yield* getInterpolated({
propertyId,
startTimeInSeconds: now - 3600,
endTimeInSeconds: now,
intervalInSeconds: 60,
quality: "GOOD",
type: "LINEAR_INTERPOLATION",
});
// on the Function effect:
// .pipe(Effect.provide(AWS.IoTSiteWise.GetInterpolatedAssetPropertyValuesHttp))