Skip to content

createTag

Create a tag with metadata.

See also Update Tag

createTag(tag, description=None, units=None, stepped=False, update_existing=False)

  • tag (str)
  • description (str | None)
  • units (str | None)
  • stepped (bool, default: False)
  • update_existing (bool, default: False)
  • tag: Tag name to create.
  • description: Optional description.
  • units: Optional engineering units.
  • stepped: Set true for discrete values.
  • update_existing: Overwrite metadata if tag exists.
result = hm.createTag(
"DEMO_02TI999.PV",
description="Demo tag",
units="C",
stepped=False,
update_existing=False,
)

Output:

{ "success": true, "errors": {} }
result = hm.createTag(
"Demo-influxdb/DEMO_02TI998.PV",
description="Demo tag with historian prefix",
units="C",
)

Output:

{ "success": true, "errors": {} }