Skip to content

Unable to use BatchPutPropertyValues in IoT TwinMaker — “No connector functions defined for request”

0

I am trying to write a simple DOUBLE value from an AWS Lambda function (triggered by IoT Core) into a property of an IoT TwinMaker entity.

However, every attempt to call BatchPutPropertyValues fails with this error: ValidationException: No connector functions defined for request: BatchPutPropertyValuesConnectorRequest(...)

Component Type Configuration

I created a custom component type com.twinmaker.tankdata with this configuration:

{ "workspaceId": "Reactor", "isSingleton": false, "componentTypeId": "com.twinmaker.tankdata", "description": "TankData component type for bioreactor - stored internally (non-time-series)", "propertyDefinitions": { "LevelPercent": { "dataType": { "type": "DOUBLE" }, "isTimeSeries": false, "isRequiredInEntity": false, "isExternalId": false, "isStoredExternally": false, "isImported": false, "isFinal": false, "isInherited": false } }, "isAbstract": false, "isSchemaInitialized": false, "status": { "state": "ACTIVE", "error": {} }, "componentTypeName": "TankData" }

My understanding is that since isTimeSeries is false and the value is stored internally, TwinMaker should not require connector functions (dataWriter, dataReader, etc.).

Lambda Code Calling BatchPutPropertyValues

This is a simplified version of the Lambda code I’m using (Node.js 22, ESM):

import {
  IoTTwinMakerClient,
  BatchPutPropertyValuesCommand
} from "@aws-sdk/client-iottwinmaker";

const workspaceId = "Reactor";
const region = "ap-southeast-2";
const client = new IoTTwinMakerClient({ region });

export const handler = async (event) => {
  console.log("Event:", JSON.stringify(event));

  let payload = event;
  if (typeof payload === "string") {
    try { payload = JSON.parse(payload); } catch {}
  }
  if (payload && payload.payload) {
    try {
      payload = typeof payload.payload === "string"
        ? JSON.parse(payload.payload)
        : payload.payload;
    } catch {}
  }

  const raw = payload?.levelPercent ?? payload?.level ?? payload?.value ?? null;
  const level = Number(raw);
  if (Number.isNaN(level)) {
    console.log("No numeric level found");
    return;
  }

  const entry = {
    entityPropertyReference: {
      entityId: "<entity-id>",
      componentName: "tankdata",
      propertyName: "LevelPercent"
    },
    propertyValues: [
      {
        value: { doubleValue: level },
        timestamp: new Date()          // using Date object as required by SDK
      }
    ]
  };

  try {
    const cmd = new BatchPutPropertyValuesCommand({
      workspaceId,
      entries: [entry]
    });
    const resp = await client.send(cmd);
    console.log("TwinMaker response:", resp);
  } catch (err) {
    console.error("Error writing to TwinMaker:", err);
    throw err;
  }
};

My Questions:

  • Why is TwinMaker treating this as a “Connector” request even though isTimeSeries is false and isStoredExternally is false?
  • Is using timestamp: new Date() causing TwinMaker to interpret this as a time-series write and therefore requiring connector functions?
  • For non-time-series internal properties, should timestamp be omitted entirely?
  • Is there an official example of how to use BatchPutPropertyValues for a simple DOUBLE property stored inside TwinMaker (not external, not time-series)?

Any guidance would be very helpful. I’ve tried multiple combinations of component type settings and payload shapes but continue to get the “No connector functions defined” error.

asked 10 months ago127 views

1 Answer
0

Based on your issue with BatchPutPropertyValues in IoT TwinMaker, I can identify a few key problems:

The main issue appears to be that you're using BatchPutPropertyValues which is specifically designed for time-series data. Even though you've set isTimeSeries: false in your component type definition, the BatchPutPropertyValues API operation is inherently for time-series properties and requires connector functions to be defined.

When you include a timestamp in your property values and use BatchPutPropertyValues, IoT TwinMaker is treating this as a time-series write operation, which requires a DataWriter connector to be configured. This explains the "No connector functions defined for request" error you're receiving.

For non-time-series properties that are stored internally in IoT TwinMaker (where both isTimeSeries: false and isStoredExternally: false), you should not be using BatchPutPropertyValues at all. The BatchPutPropertyValues API is specifically designed for writing time-series data points to properties.

Instead, for updating non-time-series properties, you should use the UpdateEntity API to update the component property values directly. This approach doesn't require connector functions since you're directly updating the entity's properties rather than writing time-series data points.

In your component type definition, since you've correctly set isTimeSeries: false and isStoredExternally: false for the LevelPercent property, you should be able to update this property using UpdateEntity rather than BatchPutPropertyValues.

The presence of the timestamp in your property values is likely causing IoT TwinMaker to interpret this as a time-series write operation, even though the property is defined as non-time-series. For non-time-series properties, you should omit the timestamp entirely when updating the property value.
Sources
BatchPutPropertyValues - AWS IoT TwinMaker
AWS IoT TwinMaker data connectors - AWS IoT TwinMaker
DataValue - AWS IoT TwinMaker

answered 10 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.