Hi,
Whenever I’m pushing the data using data injection into measurement objects, I need to get Realtime Device status in c8y_Availability from inventory managed Objects.
Ex:
Once I had pushed the data using data injection into a measurement object , I wanted to get the device’s status Realtime, but i couldn’t be able to get the status.
UNAVAILABLE or AVAILABLE form c8y_Availability
can you elaborate a bit more what exactly the issue is?
Is the c8y_Availability attribute missing? Does it still have the old status?
Why do you subscribe on measurement realtime updates if you are actually interested in updates of the managedObject in the inventory?
The update of the c8y_Availability status is happening in an async process, so just because you received a measurement this may not directly be visible in the c8y_Availability attribute.
In a Navbar-header I want to display the device’s status as available or unavailable in real time.
The above example is that I tried to get device status in Realtime, but the inventory management object received its old status. After referring to the page, I can see the status unavailable into available.
I’m consider device status. Available as Online Unavailable as Offline
Could please tell me how to show the device status Realtime?
Please check the sample provided in the tutorial application on how to subscribe for realtime updates of managedObjects.
The tutorial application can be scaffolded using e.g. c8ycli new tutorial tutorial as described multiple times in the documentation: Tutorials - Cumulocity IoT Guides