0

it's possible to receive MQTT messages from Cumuloyity API?

How can I get with Java Clients the values from following Measurements:

  • Analog Measurement
  • Motion Measurement

Thanks

1 Answers1

0

Querying measurements is described here: http://cumulocity.com/guides/java/developing/, Section "Accessing events and measurements". There are currently no pre-defined Java classes for analog measurements and motion measurements, however, you can still retrieve them as generic properties. Check the example on the web page and instead of

measurementFilter.byFragmentType(SignalStrength.class);

try

measurementFilter.byFragmentType("c8y_MotionMeasurement");

and instead of

measurement.get(SignalStrength.class);

try

measurement.getProperty("c8y_MotionMeasurement");

You can also create the Java classes representing the measurements on your own by "stealing" and modifying one of the existing classes:

https://bitbucket.org/m2m/cumulocity-clients-java/src/53216dc587e24476e0578b788672416e8566f92b/device-capability-model/src/main/java/c8y/?at=default
André
  • 668
  • 6
  • 11