How to get the Realtime value for MangeObject with fregementType c8y_IsDevice

*Hello,

I have list of device which I want to update on realtime.

To update the list of device realtime, I am calling an realtime service.

fetchRealtimeManageObjects(){
        this.realtime.subscribe(`/inventory/managedObjects`, ((device) => {
            const operation: IManagedObject = device.data.data;
            console.log('Device gets updated: ', device);
          }));
}

I am also calling the above function in ngOninit. But the list is not getting refresh.

I am getting a list using “inventory/managedObjects” with the params like pageSize, CurrentPage, fragmentType=c8y_IsDevice.

How can I get the list of device realtime if the device is created, updated, or deleted?
*

Hi,

according to the documentation (Cumulocity IoT - OpenAPI Specification) you would need to use /managedobjects/* as the channel you subscribe to.

The WebSDK also offers an ManagedObjectRealtimeService (Web SDK documentation) that might be easier to use.

Note that using the wildcard * subscription might give you a lot of notifications, which could overload the client.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.