0

I have multiple Azure IoT devices sending telemetry messages to a single IoT hub. Each device has its own timestamp property name. How can I make the data from all these devices go into same TSI environment?

I tried creating multiple event sources for the same IoT hub but with different timestamp property. That makes only one event source's time stamp as the $ts at a time but how do I query respective time series data for a specific device?

kingvittu
  • 47
  • 8

1 Answers1

3

Timeseries Insights requires that the incoming messages have the same schema.

What you can do, is make sure that you transform the incoming messages to a canonical data-format before ingesting them into Timeseries Insights.

My idea would be that you have an Azure Function that listens on the standard IoT Hub endpoint, and processes all messages that are coming into IoT Hub. The function then makes sure that the messages are transformed to a common model, and puts them on an EventHub.

That EventHub is then the event-source for Timeseries Insights.

Frederik Gheysels
  • 56,135
  • 11
  • 101
  • 154
  • Ok if I have something like this: device1 message schema: {"Type1DataArray" : [{"Id": "someparam","Value": 10,"Timestamp":"06-10-2021 00:00:00"}]} device2 message schema: {"Type2DataArray" : [{"Id": "otherparam","Value": 2.3,"Timestamp":"06-10-2021 00:00:00"}]} then I should bring to something like: {"commonDataArray" : [{"Id": "id1","Value": 10,"Timestamp":"06-10-2021 00:00:00"}]} ? – kingvittu Dec 23 '21 at 15:06
  • You can find some information on modelling here: https://learn.microsoft.com/en-us/azure/time-series-insights/how-to-select-tsid and here: https://learn.microsoft.com/en-us/azure/time-series-insights/how-to-plan-your-environment – Frederik Gheysels Dec 23 '21 at 16:59
  • These are for gen2. We are using gen1 currently which doesn't have time series id option i suppose? – kingvittu Dec 24 '21 at 06:43