Are the steps below feasible to automatically spin up attributes based on a payload with multiple measurements? I have tried to get it to work but there seems to be an issue if the attribute does not exist:
Manually add or clone new asset
Create json object ‘payload’ attribute to receive payload data
Consume uplink payload via MQTT agent link etc
Create boolean attribute called ‘provisionDevice’
Manually check ‘provisionDevice’ attribute
Groovy rule triggers and decodes payload into individual names, values and types
I can create a custom MQTTHandler that consumes the payload as suggested. How would it then do the provisioning within OR e.g. create assets, attributes etc?
MQTTHandlers have full access to the system so you can grab the AssetStorageService in the init method and use that for asset CRUD operations. See the UserAssetProvisioningMQTTHandler for some inspiration.