Skip to content

BatchPutAssetPropertyValue

Source: src/AWS/IoTSiteWise/BatchPutAssetPropertyValue.ts

Runtime binding for iotsitewise:BatchPutAssetPropertyValue — ingest timestamped property values (measurements) into the bound asset’s data streams from a deployed Lambda or Task.

Provide the BatchPutAssetPropertyValueHttp implementation layer on the Function effect, bind the asset in the init phase, then call the returned client at runtime. The binding grants iotsitewise:BatchPutAssetPropertyValue on the asset and injects its id into every entry automatically.

// init
const asset = yield* AWS.IoTSiteWise.Asset("Pump1", {
assetModelId: model.assetModelId,
});
const putValues = yield* AWS.IoTSiteWise.BatchPutAssetPropertyValue(asset);
// runtime
const now = yield* Effect.sync(() => Math.floor(Date.now() / 1000));
const { errorEntries } = yield* putValues({
entries: [
{
entryId: "temp-1",
propertyId,
propertyValues: [
{
value: { doubleValue: 23.5 },
timestamp: { timeInSeconds: now },
quality: "GOOD",
},
],
},
],
});
// on the Function effect:
// .pipe(Effect.provide(AWS.IoTSiteWise.BatchPutAssetPropertyValueHttp))