- 新しい順
- 投票が多い順
- コメントが多い順
Hey,
After updating a detector model, an existing detector will remain in its current state until it receives a new message. Upon receiving a new message, the detector will be reset to the initial state, including the resetting of variables and timers. Completion of a timer will also cause the state of the detector to be reset if the detector has not yet received a new message.
If you want to reset the state of a specific detector without updating the detector model, you can use the batch-update-detector API (https://docs.aws.amazon.com/iotevents/latest/apireference/API_iotevents-data_BatchUpdateDetector.html)
Edited by: AndrewA-AWS on Nov 20, 2019 3:47 PM
Edited by: AndrewA-AWS on Nov 20, 2019 3:48 PM
From what I'm seeing, re-publishing my model doesn't reset the detectors.
But the badge-update-detector command seems to do what I need:
aws iotevents-data batch-update-detector --cli-input-json file://reset_detector3.json
This will be a decent work-around, but in the future it would be really nice to have a 'Remove Detectors' button on my detector model's page in the console, and maybe a 'Delete' button from an individual detector's page.
Thanks for the help!
After you republish the model, are you then sending new messages to each of the detectors you want to reset via batch-put-message?
Also, glad to hear you were able to use batch-update-detector.
After I re-publish a model, I'm posting messages to MQTT, which an IoT rule forwards to the Events input feeding the detector. I'm not sure if that ends up using batch-put, internally to Events.
At some point in the future, it would be great to have a simple API to delete or reset a single detector, or all detectors attached to a model.
Thanks!
AWS IoT Events has released a new API for deleting the detectors in batches.
- API Guide for reference: https://docs.aws.amazon.com/cli/latest/reference/iotevents-data/batch-delete-detector.html
- Guide for deleting the detectors on console: https://docs.aws.amazon.com/iotevents/latest/developerguide/iotevents-delete-batch-detector.html