I would like to tag entities with a custom metadata property so that I can then write a macro to set colour based on that attribute

Specifically, I want to add a custom metadata property on entities, called 'Entity Category', so that I can then write a macro to set the entity colour based on that attribute.

How to I define custom metadata properties?   I expected 'Attachments' to allow this somehow, but can't figure it out, and the Help is not helping.