Device level folders are not included in the topic, but instead are a “prefix” on the metric name in the actual message payload. Take a look at the example Python code here - tahu/example.py at develop · eclipse/tahu · GitHub
In the publishDeviceBirth() method, see lines 218 - 221 where the input and output folders are included in the metric name. The result is that MQTT Engine will create those input and output folders and then create the appropriate tags within those folders.
This is the resulting DBIRTH message on the wire with the payload decoded.
Topic:
spBv1.0/Sparkplug B Devices/DBIRTH/Python Edge Node 1/Emulated Device
Payload:
{“timestamp”:1629928453676,“metrics”:[{“name”:“input/Device Metric0”,“alias”:8,“timestamp”:1629928453676,“dataType”:“String”,“value”:“hello device”},{“name”:“input/Device Metric1”,“alias”:9,“timestamp”:1629928453676,“dataType”:“Boolean”,“value”:true},{“name”:“output/Device Metric2”,“alias”:10,“timestamp”:1629928453676,“dataType”:“Int16”,“value”:16},{“name”:“output/Device Metric3”,“alias”:11,“timestamp”:1629928453676,“dataType”:“Boolean”,“value”:true},{“name”:“My_Custom_Motor”,“alias”:12,“timestamp”:1629928453676,“dataType”:“Template”,“value”:{“version”:"",“reference”:“Custom_Motor”,“isDefinition”:false,“metrics”:[{“name”:“RPMs”,“timestamp”:1629928453676,“dataType”:“Int32”,“value”:123},{“name”:“AMPs”,“timestamp”:1629928453676,“dataType”:“Int32”,“value”:456}],“parameters”:[{“name”:“Index”,“type”:“String”,“value”:“1”}]}}],“seq”:1}