Updated on 2022-02-21 GMT+08:00

Appendix: Packets of Subscribed Notification Messages

This section uses a common device as an example to describe sample MQS packets related to subscription management.
  • Message attributes
    {
            "deviceIdentifier":"iottest2", //Device identifier
            "eventTime":"1588843914884", //Message time    
            "gatewayIdentifier":"null", //Gateway identifier
            "deviceId":"D114VKx7a", //Device ID
            "gatewayId":"null", //Gateway ID
            "TAGS":"null" //Message tag
    }
    • For a common device or gateway, set gatewayId and gatewayIdentifier to null.
    • For a subdevice, gatewayId and gatewayIdentifier are deviceId and deviceIdentifier of the gateway respectively.
  • Message content
    1. Adding a device
      {
              'deviceType':'Default', //Device type
              'instanceOid':'40', //Instance OID
              'manufacturerName':'iotcompro1',//Manufacturer name
               'productOid':'1', //Product OID
              'manufacturerId':'iotcompro1', //Manufacturer ID
              'remark':'', //Device description
              'deviceId':'D114VKx7a', //Device ID
               'deviceName':'iottest2', //Device name
              'productName':'iotcompro1', //Product name
              'notifyType':'deviceAdded', //Message type
              'deviceIdentifier':'iottest2', //Device identifier
              'deviceOid':'14', //Device OID
              'createdBy':'admin', //Creator
              'eventTime':'1588843914884', //Message time
              'model':'iotcompro1', //Product model
              'productType':'0', //Product type. 1: gateway product; 0: common product.
              'status':'0', //Device status. 0: enabled; 1: disabled.
              'parentDeviceOid':'null' //Parent device OID
      }
    2. Deleting a device
      {
              'notifyType':'deviceDeleted', //Message type
              'deviceIdentifier':'iottest2', //Device identifier
              'eventTime':'1588843914884', //Message time
              'deviceId':'D114VKx7a', //Device ID
      }
    3. Taking a device online
      {
           'notifyType':'deviceOnline', //Message type: device online
          'deviceIdentifier':'iottest2', //Device identifier
          'eventTime':'1588843914884', //Message time
           'deviceId':'D114VKx7a', //Device ID
      }
    4. Taking a device offline
      {
           'notifyType':'deviceDeleted', //Message type
          'deviceIdentifier':'iottest2', //Device identifier
          'eventTime':'1588843914884', //Message time
           'deviceId':'D114VKx7a', //Device ID
      }
    5. Changing the device type
      {
              'instanceOid':'40', //Instance OID
               'productOid':'1', //Product OID
              'remark':'', //Device description
              'deviceId':'D114VKx7a', //Device ID
               'deviceName':'iottest1', //Device name
              'notifyType':'deviceChange', //Message type
              'deviceIdentifier':'iottest1', //Device identifier
              'deviceOid':'1', //Device OID
              'createdBy':'admin', //Creator
              'eventTime':'1588843914884', //Message time
              'status':'0', //Device status. 0: enabled; 1: disabled.
              'parentDeviceOid':'null' //Parent device OID
      }