TagEvent script in system.tag.addTag()

Using addTag()? No. Using configure()? Yes.

newTag = {}
newTag["name"] = "Some New Tag"
newTag["expressionType"] = "Expression"
newTag["expression"] = 'dateExtract(now(),"second")'
newTag["eventScripts"] = [{"eventid":"valueChanged","script":"\tprint \"Hello World\""}]

system.tag.configure(path="",tags = system.util.jsonEncode(newTag))
2 Likes