AWS IoT Twin Maker - read data from Entities

0

Am new to IoT Twin Maker. I have an entity that has a component with properties humidity and temperature. Am able to test this component and am getting results successfully. I need to write a Lambda function that will ready this JSON, do a formatting and expose the JSON via REST API. What steps should I follow? Any sample code would help.

I tried creating a lambda function as

response = client.get_property_value( componentName='string', componentTypeId='string', entityId='string', selectedProperties=[ 'string', ], workspaceId='string' )

Am getting the error "An error occurred (ValidationException) when calling the GetPropertyValue operation: No attributePropertyValueReaderByEntity connector defined for a query within entity : <<entityID>> Am sure am missing something, please guide.

已提問 1 年前檢視次數 335 次
2 個答案
0

Hi,

it seems that the connector you are using does not support get_property_value. You can try if get_property_value_history is working. Not every connector supports necessarily both methods.

Cheers,
Philipp

AWS
專家
已回答 1 年前
0

You may also need to check your component type model: for GetPropertyValue on properties marked as "isStoredExternally": true you should have an attributePropertyValueReaderByEntity definition under the functions in your component type (e.g. instead of "dataReader" in this example)

The lambda function used to implement the above reader should follow this request/response interface: docs

AWS
已回答 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南