Turn on asset property notifications in Amazon IoT SiteWise
You can enable property notifications to publish asset data updates to Amazon IoT Core, and then run queries on the your data. With asset property notifications, Amazon IoT SiteWise provides an Amazon CloudFormation template that you can use to export Amazon IoT SiteWise data to Amazon S3.
Note
Asset data is sent to Amazon IoT Core every time it's received by Amazon IoT SiteWise, regardless of if the value has changed.
Topics
Turn on asset property notifications (console)
By default, Amazon IoT SiteWise doesn't publish property value updates. You can use the Amazon IoT SiteWise console to enable notifications for an asset property.
To enable or disable notifications for an asset property (console)
Navigate to the Amazon IoT SiteWise console
. -
In the navigation pane, choose Assets.
-
Choose the asset to enable a property's notifications.
Tip
You can choose the arrow icon to expand an asset hierarchy to find your asset.
-
Choose Edit.
-
For the asset property's Notification status, choose ENABLED.
You can also choose DISABLED to disable notifications for the asset property.
-
Choose Save.
Turn on asset property notifications (Amazon CLI)
By default, Amazon IoT SiteWise doesn't publish property value updates. You can use the Amazon Command Line Interface (Amazon CLI) to enable or disable notifications for an asset property.
You must know your asset's assetId
and property's
propertyId
to complete this procedure. You can also use the external ID. If you created an
asset and don't know its assetId
, use the ListAssets API to list all the assets
for a specific model. Use the DescribeAsset operation to view your asset's
properties including property IDs.
Use the UpdateAssetProperty operation to enable or disable notifications for an asset property. Specify the following parameters:
-
assetId
– The asset's ID. -
propertyId
– The asset property's ID. -
propertyNotificationState
– The property value notification state:ENABLED
orDISABLED
. -
propertyAlias
– The alias of the property. Specify the property's existing alias when you update the notification state. If you omit this parameter, the property's existing alias is removed.
To enable or disable notifications for an asset property (CLI)
-
Run the following command to retrieve the asset property's alias. Replace
asset-id
with the ID of the asset andproperty-id
with the ID of the property.aws iotsitewise describe-asset-property \ --asset-id
asset-id
\ --property-idproperty-id
The operation returns a response that contains the asset property's details in the following format. The property alias is in
assetProperty.alias
in the JSON object.{ "assetId": "a1b2c3d4-5678-90ab-cdef-22222EXAMPLE", "assetName": "Wind Turbine 7", "assetModelId": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE", "assetProperty": { "id": "a1b2c3d4-5678-90ab-cdef-33333EXAMPLE", "name": "Wind Speed", "alias": "
/company/windfarm/3/turbine/7/windspeed
", "notification": { "topic": "$aws/sitewise/asset-models/a1b2c3d4-5678-90ab-cdef-11111EXAMPLE/assets/a1b2c3d4-5678-90ab-cdef-22222EXAMPLE/properties/a1b2c3d4-5678-90ab-cdef-33333EXAMPLE", "state": "DISABLED" }, "dataType": "DOUBLE", "unit": "m/s", "type": { "measurement": {} } } } -
Run the following command to enable notifications for the asset property. Replace
property-alias
with the property alias from the previous command's response, or omit--property-alias
to update the property without an alias.aws iotsitewise update-asset-property \ --asset-id
asset-id
\ --property-idproperty-id
\ --property-notification-state ENABLED \ --property-aliasproperty-alias
You can also pass
--property-notification-state DISABLED
to disable notifications for the asset property.