# Updated c8y\_Availability does not work with WebSocket onUpdate$

**URL:** <https://community.cumulocity.com/t/updated-c8y-availability-does-not-work-with-websocket-onupdate/12264>\
**Category:** Forum\
**Tags:** app-enablement\
**Created:** [May 9, 2025, 10:19am UTC](https://community.cumulocity.com/t/updated-c8y-availability-does-not-work-with-websocket-onupdate/12264 "2025-05-09T10:19:50Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lorn\_Kjewlsvar](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/lorn_kjewlsvar/32/7097_2.png) [@Lorn\_Kjewlsvar](https://community.cumulocity.com/u/Lorn_Kjewlsvar)\
**Post date:** [May 9, 2025, 10:19am UTC](https://community.cumulocity.com/t/updated-c8y-availability-does-not-work-with-websocket-onupdate/12264/1 "2025-05-09T10:19:50Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![Tristan\_Bastian](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/tristan_bastian/32/18259_2.png) [@Tristan\_Bastian](https://community.cumulocity.com/u/Tristan_Bastian)\
**Post date:** [May 9, 2025, 8:10pm UTC](https://community.cumulocity.com/t/updated-c8y-availability-does-not-work-with-websocket-onupdate/12264/2 "2025-05-09T20:10:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Lorn\_Kjewlsvar](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/lorn_kjewlsvar/32/7097_2.png) [@Lorn\_Kjewlsvar](https://community.cumulocity.com/u/Lorn_Kjewlsvar)\
**Post date:** [May 12, 2025, 9:01am UTC](https://community.cumulocity.com/t/updated-c8y-availability-does-not-work-with-websocket-onupdate/12264/3 "2025-05-12T09:01:55Z")

</div>

Hi @Tristan_Bastian,

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

 ![grafik](https://europe1.discourse-cdn.com/flex005/uploads/cumulocity/original/3X/d/7/d7fec34f950fd58a122f5729327acb714432af81.png)

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

 ![grafik](https://europe1.discourse-cdn.com/flex005/uploads/cumulocity/original/3X/d/9/d94de70bf90a508411e56b1ad99f65f913c0d89e.png)

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

Regards

---

<div class="post-metadata">

**Author:** ![Tristan\_Bastian](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/tristan_bastian/32/18259_2.png) [@Tristan\_Bastian](https://community.cumulocity.com/u/Tristan_Bastian)\
**Post date:** [May 12, 2025, 9:13am UTC](https://community.cumulocity.com/t/updated-c8y-availability-does-not-work-with-websocket-onupdate/12264/4 "2025-05-12T09:13:46Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Lorn\_Kjewlsvar](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/lorn_kjewlsvar/32/7097_2.png) [@Lorn\_Kjewlsvar](https://community.cumulocity.com/u/Lorn_Kjewlsvar)\
**Post date:** [May 12, 2025, 10:30am UTC](https://community.cumulocity.com/t/updated-c8y-availability-does-not-work-with-websocket-onupdate/12264/5 "2025-05-12T10:30:41Z")

</div>

> 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.

---

<div class="post-metadata">

**Author:** ![Tristan\_Bastian](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/tristan_bastian/32/18259_2.png) [@Tristan\_Bastian](https://community.cumulocity.com/u/Tristan_Bastian)\
**Post date:** [May 12, 2025, 10:43am UTC](https://community.cumulocity.com/t/updated-c8y-availability-does-not-work-with-websocket-onupdate/12264/6 "2025-05-12T10:43:19Z")

</div>

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

> [@Tristan\_Bastian](#):
>
> 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.

Otherwise I would suggest you create a support ticket.

---

<div class="post-metadata">

**Author:** ![Lorn\_Kjewlsvar](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/lorn_kjewlsvar/32/7097_2.png) [@Lorn\_Kjewlsvar](https://community.cumulocity.com/u/Lorn_Kjewlsvar)\
**Post date:** [May 12, 2025, 10:46am UTC](https://community.cumulocity.com/t/updated-c8y-availability-does-not-work-with-websocket-onupdate/12264/7 "2025-05-12T10:46:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Lorn\_Kjewlsvar](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/lorn_kjewlsvar/32/7097_2.png) [@Lorn\_Kjewlsvar](https://community.cumulocity.com/u/Lorn_Kjewlsvar)\
**Post date:** [May 12, 2025, 11:01am UTC](https://community.cumulocity.com/t/updated-c8y-availability-does-not-work-with-websocket-onupdate/12264/8 "2025-05-12T11:01:04Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![Ozge\_Akin](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/ozge_akin/32/32174_2.png) [@Ozge\_Akin](https://community.cumulocity.com/u/Ozge_Akin)\
**Post date:** [May 12, 2025, 11:33am UTC](https://community.cumulocity.com/t/updated-c8y-availability-does-not-work-with-websocket-onupdate/12264/9 "2025-05-12T11:33:18Z")

</div>

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](https://cumulocity.com/docs/additional-resources/contacting-support/) so that we can verify in the environment?

Best regards,  
Özge
