Overriding Properties in UDT Instances by system.tag.writeAsync()

The weird behaviour with overrides bothered me so I came back to this. I believe the below example will do what you are aiming for–and won’t require multiple system.tag.configure calls to override nested properties.

# Create UDT instance with OVR member disabled.
# The tags lists are only included to add the override to the UDT member.
# Add additional key:value pairs to any level to add more overrides.
collisionPolicy = 'o'
tags = [
	{'tags':
		[
			{'tags':
				[
					{'enabled': False,
					'name': 'OVR'
					}
				],
			'name': 'CMD'
			}
		],
	'tagType': 'UdtInstance',
	'name': 'PI05051',
	'typeId': '_Test/Test'
	}
]
system.tag.configure("[default]DPB", tags, collisionPolicy)

If you want to add an override or more to existing tags:

# Enable OVR member via override.
# Use names for path and properties to override only. Use merge collision policy.
collisionPolicy = 'm'
tags = [
	{'tags':
		[
			{'tags':
				[
					{'enabled': True,
					'name': 'OVR',
					}
				],
			'name': 'CMD'
			}
		],
	'name': 'PI05051',
	}
]
system.tag.configure("[default]DPB", tags, collisionPolicy)

To remove an override, you could recreate the tag without the override using overwrite collision policy. Or this works:

# Remove an override from an existing tag.
collisionPolicy = 'o'
tags = [
	{'name': 'OVR',
	'overrides': {'Enabled':None}
	}
]
system.tag.configure('[default]DPB/PI05051/CMD', tags, collisionPolicy)

Sorry for the misdirection earlier–most of my experience with UDTs was with system.tag.addTag and there are clearly some differences with system.tag.configure, particularly around overrides.