Querying current asset's property values
This tutorial shows two ways to get the current value of an asset property. You can use the Amazon IoT SiteWise console or use API in the Amazon Command Line Interface (Amazon CLI).
Topics
Query an asset property's current value (console)
You can use the Amazon IoT SiteWise console to view the current value of an asset property.
To get the current value of an asset property (console)
Navigate to the Amazon IoT SiteWise console
. -
In the navigation pane, choose Assets.
-
Choose the asset with the property to query.
-
Choose the arrow icon to expand an asset hierarchy to find your asset.
-
Choose the tab for the type of property. For example, choose Measurements to view the current value of a measurement property.
-
Find the property to view. The current value appears in the Latest value column.
Query an asset property's current value (Amazon CLI)
You can use the Amazon Command Line Interface (Amazon CLI) to query the current value of an asset property.
Use the GetAssetPropertyValue operation to query an asset property's current value.
To identify an asset property, specify one of the following:
-
The
assetId
andpropertyId
of the asset property that data is sent to. -
The
propertyAlias
, which is a data stream alias (for example,/company/windfarm/3/turbine/7/temperature
). To use this option, you must first set your asset property's alias. To set property aliases, see Mapping industrial data streams to asset properties.
To get the current value of an asset property (Amazon CLI)
-
Run the following command to get the current value of the asset property. Replace
asset-id
with the ID of the asset andproperty-id
with the ID of the property.aws iotsitewise get-asset-property-value \ --asset-id
asset-id
\ --property-idproperty-id
The operation returns a response that contains the current TQV of the property in the following format.
{ "propertyValue": { "value": { "booleanValue":
Boolean
, "doubleValue":Number
, "integerValue":Number
, "stringValue": "String
" }, "timestamp": { "timeInSeconds":Number
, "offsetInNanos":Number
}, "quality": "String
" } }