Allow the user to set tags on devices and optionally give the tags a value. For example, I could add a tag for color and give it the value Red on a device that is red. I could also tag all lights that I want to use as Night Lights with a nightlight tag.
The scripting cold then have a way to say: Set all devices with the nightlight tag to 10%. Similar I could say: Set all devices with a tag of facing that has a value of South to closed.
This type of facility could be used very creatively. If someone shared code that used tags, they would just need to have the user set tags on the proper devices.
This would be a good step towards generalization.
It would allow users to flexibly build their own set of data model on top of existing tools.
If such tags could also include rules, such as “only one tag per entity allowed”, features like Areas could be eventually implemented by tags.
This can also be used for grouping stuff on views, as requested very often: