Updated c8y_Availability does not work with WebSocket onUpdate$

Hello cumulocity community,

we are trying to use c8y_Availability to get the information if the device is available and when it last was seen. To be up to date we want to use the ManagedObjectRealtimeService. The Problem is that despite c8y_Availability getting updated, the ManagedObjectRealtimeService does not show any messages with the onUpdate$ method. Could this be a bug, or is there something we need to keep in mind or use otherwise to update the UI with the availability state and when is last was updated?

Thanks in advance for your help!

Hi @Lorn_Kjewlsvar,

Can you provide a small code snipped on how you are utilizing the ManagedObjectRealtimeService to just rollout the chance of misusing it?

Can you also verify if you are getting other changes on managedObjects? So we can verify that if it is only the updates of the c8y_Availability fragment that is not published via realtime.

How is the device your listening for updates connected to your Cumulocity environment?
Depending on the headers being used to update the availability of the device, this update might not be sent out via realtime.

Regards,
Tristan

Hi @Tristan_Bastian,

this would be the realtime subscribtion, the timerManagedObject is the device which should be subscribed to:

It should be connected via opcua and the opcua agent from c8y. Measurements are sent via this way.

Could it be that the device itself must be updated hence the last updated timestamp for the realtime service to work?

Regards

Are you also subscribing to the websocketManagedObjectConnection$ observable somewhere?
Can you verify via your browsers developer tools (network tab) that the realtime websocket connection actually contains the messages for subscribing to this particular managedObject id?

Are you also subscribing to the websocketManagedObjectConnection$ observable somewhere?

yes, it is subscribed. Also tested it with .subscribe() to be sure.

Can you verify via your browsers developer tools (network tab) that the realtime websocket connection actually contains the messages for subscribing to this particular managedObject id?

In Chrome DevTools the channel is subscribed.

Then this is the only thing you could still try to validate:

Otherwise I would suggest you create a support ticket.

yes, if I change the maintenance mode on/off for this device in the device management messages are emitted onto this subscribed channel.

@Tristan_Bastian: I just realized, that maybe just if the status is changed from AVAILABLE to MAINTENANCE only leads to this emission but not the last message timestamp. So it seems the problem is not really the status but the last message time stamp which does not lead to an emission of the a realtime message.

Hi Lorn,

We expect Availability monitoring to reflect the status in few minutes when the measurement/event/alarm or managed object updates are done to the respective device within the defined required interval period.

For OPC UA devices, measurement/event/alarms are being persisted based on the OPC UA device protocol configuration.

Please verify if the data reporting rate from the device’s OPC UA device protocol configuration is not longer than the required interval given for this particular device.

If you have device’s required interval larger than the OPC UA data reporting already and still facing this issue, could you please raise a support ticket: Product support - Cumulocity documentation so that we can verify in the environment?

Best regards,
Özge

1 Like