We are using IoT Central and telemetry is happily being stored. If we use the API to query telemetry we get results back as follows:
{
"$id": "BD0B671C-A3EF-492B-AEE0-066BD22A9EA2",
"$ts": "2022-04-28T11:29:00.741Z",
"Heartbeat": "Pulse"
}
If I query with the following I get back our Error Events
Query
{
"query" : "SELECT Error FROM dtmi:modelDefinition:bennamann:weatherstationtest;1"
}
Result
{
"results": [
{
"Error": "Generator failed to start"
},
{
"Error": "Loading Pump stalling"
}
]
}
However, if I then try to add the timestamp in either the order by or in the select we get the timestamp but not the actual error state.
Query
{
"query" : "SELECT $ts,Error FROM dtmi:modelDefinition:bennamann:weatherstationtest;1 ORDER BY $ts"
}
Result
"results": [
{
"$ts": "2022-03-29T11:50:36.682Z"
},
{
"$ts": "2022-03-29T11:50:42.925Z"
},
{
"$ts": "2022-03-29T11:52:50.782Z"
},
{
"$ts": "2022-03-29T11:52:57.018Z"
},
{
"$ts": "2022-03-29T11:53:09.95Z"
},
{
"$ts": "2022-03-29T11:53:16.622Z"
},
{
"$ts": "2022-03-29T11:55:36.681Z"
},
{
"$ts": "2022-03-29T11:56:42.927Z"
}
]
}
Any ideas why this occurs and how we would get our Error Events with timestamp against them?