1

I am trying to send the below sensor values from the registered device in Hono to Ditto in order to form the digital twin of the registered device.

I am using the below command.

curl -X POST -i -u sensor10@tenantAllAdapters:mylittlesecret -H 'Content-Type: application/json' -d '{"temp": 2307, "hum": 40000}' http://localhost:8080/telemetry
HTTP/1.1 202 Accepted
content-length: 0

I am able to receive the data in Ditto. How can I get to know the all the historical values that are send from the device to Ditto over a period of time.

1 Answers1

4

In Eclipse Ditto, you can't get historical data. Ditto is about representing the current state of the digital twin or for communicating directly with the real device both by applying authorization.

Historical values are not persisted in Ditto.

If you have the need to access historical data (which is completely understandable, very normal use case), you would - for example - add a connection in Ditto to an Apache Kafka which gets all twin change events and from that Kafka you can put the historical data somewhere better suited for persisting and querying such data, e.g. into a time series database like InfluxDB.

That's also how it's done (put the data in an optimized service for historical data) in the commercial solution which builds on Eclipse Ditto from Bosch, the Bosch IoT Suite.

Thomas Jäckle
  • 1,123
  • 2
  • 7
  • 21
  • Thank you for your response. Yes, Ditto gives us only the latest sensor value. But I wanted to know if there is any way to store the data in Hono before sending the sensor data to Ditto. – JustAnotherDataEnthusiast Jul 12 '19 at 11:00
  • 1
    I don't think that Hono stores any data - it might only store for example "events" (with a higher QoS) when no receiver is currently connected in order to deliver those events once the receiver can consume the data again. – Thomas Jäckle Jul 12 '19 at 14:04
  • Indeed, Hono does not store any messages except as already mentioned by @thomas-jäckle. – Kai Hudalla Jul 15 '19 at 07:44
  • @ThomasJäckle, Kai Hudalla - Could you please look at the below link and see if I am missing something. Thank you! https://stackoverflow.com/questions/57162833/connecting-eclipse-ditto-to-apache-kafka – JustAnotherDataEnthusiast Aug 07 '19 at 19:31