MQTT Inventory Topic

Is there an MQTT topic to which I can post a JSON message from a physical device to update the device metadata? For example, I can post the following message to https://{url}/inventory/managedObjects/{id} to update the device metadata:

{
“c8y_Hardware”: {“serialNumber”: “123456789”},
“c8y_RequiredAvailability”: {“responseInterval”: 1}
}

Hi,

multiple options here…

  1. You could use JSON via MQTT. Specifically the topic inventory/managedObjects/update should be what you’re searching for:
mqtt-client-id: {external-id of your device}
topic: inventory/managedObjects/update/{managed object id}
payload:
{
    "c8y_Hardware": {
        "serialNumber": "1234"
    },
    "c8y_RequiredAvailability": {
        "responseInterval": 1
    },
    "some": "other fragment"
}

This option let’s you add any custom fragment. To get the necessary managed object id, you can send 123 to s/us and you’ll receive the ID on topic s/ds.

  1. If it’s only about the c8y_Hardware and c8y_RequiredInterval properties - there are static templates you can use:
mqtt client id: {external-id of your device}
topic: s/us
payload: 
110,1234567890
117,1
  1. If you’re using thin-edge (a powerful edge-framework supporting you for device-integration), these two links should help:
2 Likes

Thanks, the JSON via MQTT worked as intended.