trentc
01/15/2025, 9:12 PMJermuk
01/16/2025, 7:46 AMtrentc
01/17/2025, 12:36 PMtrentc
01/17/2025, 12:39 PMJermuk
01/17/2025, 12:54 PMtrentc
01/17/2025, 3:10 PMtrentc
01/17/2025, 3:12 PMtrentc
01/17/2025, 3:20 PMtrentc
01/17/2025, 3:21 PMtrentc
01/18/2025, 4:12 PMtrentc
01/18/2025, 4:13 PM# Get MQTT Topic, replacing spaces in topic with _
let topic = meta("mqtt_topic").replace_all(" ", "_")
# Set Hierarchy from topic
let enterprise = $topic.split("/").index(0)
let site = $topic.split("/").index(1)
let area = $topic.split("/").index(2)
let line = $topic.split("/").index(3)
let schema = "_historian"
let tagname = "MQTT"
let mqtt_topic_appendix = $topic.replace_all($enterprise + "/" + $site + "/" + $area + "/" + $line + "/MQTT/","")
let mqtt_topic_appendix_sanitized = $mqtt_topic_appendix.replace_all("/", ".")
let payloadTagName = $mqtt_topic_appendix_sanitized
let sanitized_content = content().string()
let value = match {
# Remove null/empty values
$sanitized_content == null => deleted()
$sanitized_content == "" => deleted()
# Handle special string cases
$sanitized_content == "True" || $sanitized_content == "true" => 1
$sanitized_content == "False" || $sanitized_content == "false" => 0
# Try number conversion with error handling
this.string().trim().catch(this).number().catch($sanitized_content) != null => this.string().trim().number().catch($sanitized_content)
# Keep non-numeric strings as is
_ => $sanitized_content
}Janik
01/20/2025, 8:09 AMpayloadTagname and maybe mentioning characters, which should be avoided explicitely somewhere more intuitive to improve user-experience.Janik
01/20/2025, 8:16 AMtrentc
01/20/2025, 11:32 AMtrentc
01/20/2025, 11:35 AMtrentc
01/20/2025, 11:36 AMtrentc
01/20/2025, 11:38 AMJermuk
01/20/2025, 1:45 PMtrentc
01/20/2025, 2:39 PMtrentc
01/20/2025, 2:39 PMJermuk
01/20/2025, 6:57 PMtrentc
01/20/2025, 7:35 PMtrentc
01/20/2025, 7:35 PMtrentc
01/21/2025, 12:59 PMtrentc
01/21/2025, 1:01 PMtrentc
01/21/2025, 1:05 PMJermuk
01/21/2025, 1:29 PMFerdinand
01/21/2025, 1:31 PMtrentc
01/21/2025, 1:32 PM# Get MQTT Topic, replacing spaces in topic with _
let topic = meta("mqtt_topic").replace_all(" ", "_")
# Set Hierarchy from topic
let enterprise = $topic.split("/").index(0)
let site = $topic.split("/").index(1)
let area = $topic.split("/").index(2)
let line = $topic.split("/").index(3)
let schema = "_historian"
let tagname = $topic.split("/").index(4)
let mqtt_topic_appendix = $topic.replace_all($enterprise + "/" + $site + "/" + $area + "/" + $line + "/" + $tagname +"/","")
let mqtt_topic_appendix_sanitized = $mqtt_topic_appendix.replace_all("/", "$")
let payloadTagName = $mqtt_topic_appendix_sanitized
let sanitized_content = content().string()
let value = match {
# Remove null/empty values
$sanitized_content == null => deleted()
$sanitized_content == "" => deleted()
# Handle special string cases
$sanitized_content == "True" || $sanitized_content == "true" => 1
$sanitized_content == "False" || $sanitized_content == "false" => 0
# Try number conversion with error handling
this.string().trim().catch(this).number().catch($sanitized_content) != null => this.string().trim().number().catch($sanitized_content)
# Keep non-numeric strings as is
_ => $sanitized_content
}trentc
01/21/2025, 1:34 PMFerdinand
01/21/2025, 1:34 PM_historian ?trentc
01/21/2025, 1:34 PMFerdinand
01/21/2025, 1:35 PMtrentc
01/21/2025, 1:35 PMtrentc
01/21/2025, 1:36 PMtrentc
01/21/2025, 1:36 PMtrentc
01/21/2025, 1:37 PMFerdinand
01/21/2025, 1:38 PMtrentc
01/21/2025, 1:38 PMFerdinand
01/21/2025, 1:39 PMtrentc
01/21/2025, 1:42 PMtrentc
01/21/2025, 1:42 PMtrentc
01/21/2025, 1:43 PMtrentc
01/21/2025, 1:45 PMtrentc
01/21/2025, 1:45 PMFerdinand
01/21/2025, 1:46 PMtrentc
01/21/2025, 1:46 PMtrentc
01/21/2025, 1:46 PMtrentc
01/21/2025, 1:46 PMFerdinand
01/21/2025, 1:47 PMFerdinand
01/21/2025, 1:47 PMtrentc
01/21/2025, 1:48 PMFerdinand
01/21/2025, 1:48 PMFerdinand
01/21/2025, 2:40 PM