簡體   English   中英

如何在 IoT Central 圖表 X 軸中使用自定義時間戳屬性

[英]How to use a custom timestamp property in IoT Central charts X axis

在 IoT Central 應用程序上,是否可以在儀表板上顯示的圖表的 X 軸上使用自定義時間戳屬性?

這是一些示例原始數據的圖片:原始數據

{
 "_eventcreationtime": "2022-09-05T18:05:18.316Z",
 "Controller": {
     "Temperature4K_1": 71.468,
     "Temperature4K_2": 61.428,
     "Temperature40K_1": 39.135,
     "Temperature40K_2": 32.69,
     "TelemetryMagnetID": "Ex accusamus non commodi id ab excepturi facere et.",
     "Timestamp": "2023-01-07T19:50:11.189Z" **<- I want to use this Timestamp as the X Axis**
 },
 "_eventtype": "Telemetry",
 "_timestamp": "2022-09-05T18:05:18.369Z" **<- Looks like the the charts always use this timestamp on X Axis**
}

我想使用Controller.Timestamp作為圖表 X 軸上使用的值,但看起來總是使用_timestamp

如果是這種情況,有沒有辦法在設備發送消息之前設置 Controller.Timestamp 屬性具有另一個系統屬性(使用 C# IoT Device SDK),以便我可以在 X 上使用源時間戳的值圖表的軸?

發布答案以防其他人需要此信息。

聯系微軟支持后,我得到了以下答案:

您可以使用消息屬性中的“iothub-creation-time-utc”屬性來設置源時間戳。 如果設置了此屬性,IoTCentral 將使用此字段的時間戳值用於儀表板/圖表。 如果未設置該屬性,IoTCentral 將使用入隊時間。

所以添加下面的代碼解決了我的問題:

message.properties.add('iothub-creation-time-utc', timestamp);

這里還有一個相關的問題: Provide timestamp in message to IoT central

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM