Microservice Java SDK : get property of a device

Product/components used and version/fix level:

Cumulocity IOT - 1017

  • Frontend1017.0.223
  • Backend1017.0.216

Detailed explanation of the problem:

I developped a microservice based on Java SDK. This microservice is fully connected to my edge platform and I can push data to a device, send a command to a device. I need to collect data from device’s definition and in particular a property “c8y_Position”. After some trials, I cannot get the value of this property but I get GId attributes. If I use Postman to request (GET) data for a device, I get all information including c8y_position.

How can I get a property value from Java SDK ?

Error messages / full error message screenshot / log file:

Impossible to have c8y_Position as a property of a device (property defined).

Question related to a free trial, or to a production (customer) instance?

Production

When having a ManagedObjectRepresentation , you should be able to access the property via .getProperty​("c8y_Position") and/or via .get("c8y_Position"). Did you try that already?

hi,
thanks for your answer. Yes, I tried but there is no property but on UI c8y_Position value is set.

Did you also try using the generics-based getter?

Position myPosition = managedObjectRepresentation.get(c8y.Position.class);