runeston3
06/06/2026, 5:17 PMinput:
modbus:
controller: "tcp://192.168.0.1:502"
slaveIDs: [1]
timeBetweenReads: "1s"
unifiedAddresses:
- "output_frequency.input.24.INT16:scale=0.01"
- "output_voltage.input.25.INT16"
- "dc_bus_voltage.input.26.INT16:scale=0.1"
- "output_power.input.27.INT16"
pipeline:
processors:
- mapping: |
if meta("modbus_tag_name") == "heartbeat" {
root = deleted()
} else {
# Payload
root.value = content().string().number()
root.timestamp_ms = timestamp_unix_milli()
# Metadata
meta location_path = "None"
meta virtual_path = "None"
meta tag_name = meta("modbus_tag_name")
meta data_contract = "_sparkplug"
}
output:
sparkplug_b:
mqtt:
urls:
- "tcp://localhost:1883"
identity:
group_id: "Edge"
edge_node_id: "benthos-umh"
Modbus reads great, pipeline works. MQTT connection is made to my broker and node data is sent. But no reading are sent every second to the broker? I am thinking I did something that does not meet the requirements for the sparkplug_b output i.t.o DDATA or something?runeston3
06/06/2026, 5:18 PMhanno23
06/08/2026, 8:13 AMinput:
modbus:
controller: "tcp://192.168.0.1:502"
slaveIDs: [1]
timeBetweenReads: "1s"
unifiedAddresses:
- "output_frequency.input.24.INT16:scale=0.01"
- "output_voltage.input.25.INT16"
- "dc_bus_voltage.input.26.INT16:scale=0.1"
- "output_power.input.27.INT16"
pipeline:
processors:
- tag_processor:
defaults: |
// 1. Drop the heartbeat message
if (msg.meta.modbus_tag_name === "heartbeat") {
return null;
}
// 2. Set the required metadata dynamically
msg.meta.location_path = "EnergyDrive";
msg.meta.data_contract = "_historian";
msg.meta.tag_name = msg.meta.modbus_tag_name;
msg.meta.ds_ignore = "true"
return msg;
output:
sparkplug_b:
mqtt:
urls:
- "ssl://mqtt.energydrivecloud.com:8883"
identity:
group_id: "Edge"
edge_node_id: "benthos-umh"
# output:
# stdout: {}hanno23
06/08/2026, 8:17 AMhanno23
06/08/2026, 8:18 AMhanno23
06/08/2026, 8:18 AMjanikkn
06/08/2026, 8:47 AMhanno23
06/08/2026, 10:41 AMhanno23
06/08/2026, 10:42 AMAaron
06/08/2026, 1:43 PM- nodered_js:
code: |
var out = {};
out[msg.meta.tag_name] = msg.payload.value;
msg.payload = out;
return msg;
Could you try this out and confirm that it is working for you?hanno23
06/08/2026, 5:44 PMhanno23
06/08/2026, 5:44 PMinput:
modbus:
controller: "tcp://192.168.0.1:502"
slaveIDs: [1]
timeBetweenReads: "1s"
unifiedAddresses:
- "output_frequency.input.24.INT16:scale=0.01"
- "output_voltage.input.25.INT16"
- "dc_bus_voltage.input.26.INT16:scale=0.1"
- "output_power.input.27.INT16"
pipeline:
processors:
- mapping: |
# 1. Drop the heartbeat message
if meta("modbus_tag_name") == "heartbeat" {
root = deleted()
} else {
# 2. Extract the actual tag name and the numeric value
let tag = meta("modbus_tag_name")
let val = content().string().number()
# 3. Create a unique JSON object: e.g., {"output_voltage": 22.05}
root = {
$tag: $val
}
# 4. Set the metadata
meta location_path = "EnergyDrive"
meta data_contract = "_sparkplug"
meta tag_name = $tag
meta ds_ignore = "true"
}
output:
broker:
pattern: fan_out
outputs:
- stdout: {}
- sparkplug_b:
mqtt:
urls:
- "ssl://mqtt.energydrivecloud.com:8883"
identity:
group_id: "Edge"
edge_node_id: "benthos-umh"
# 5. Map each metric to its UNIQUE payload key
metrics:
- name: "output_frequency"
alias: 1
type: "Float"
value_from: "output_frequency"
- name: "output_voltage"
alias: 2
type: "Float"
value_from: "output_voltage"
- name: "dc_bus_voltage"
alias: 3
type: "Float"
value_from: "dc_bus_voltage"
- name: "output_power"
alias: 4
type: "Float"
value_from: "output_power"hanno23
06/08/2026, 5:46 PMhanno23
06/08/2026, 5:58 PMruneston3
06/09/2026, 6:15 AMJermuk
06/09/2026, 7:38 AMhanno23
06/09/2026, 5:18 PMhanno23
06/09/2026, 5:22 PMAaron
06/10/2026, 12:27 PMJermuk
06/10/2026, 2:59 PMAaron
06/16/2026, 8:10 AMJermuk
06/16/2026, 2:45 PMhanno23
06/17/2026, 7:17 AM