Nothing against the solution provided, awesome that its going to happen soon.
But just had this thought, I dont know enough about JSON to know if this would also blow everything up, but maybe this would work to be backward compatible and solve the problem? Making it easier to traverse directly to a specific attribute without looping through everything?
Basically, instead of moving the attribute name up, you keep it in the original location and also add it as the name of the group.
"attributes": {
"switch": {
"name": "switch",
"currentValue": "on",
"dataType": "ENUM",
"values": [
"on",
"off"
]
},
"energy": {
"currentValue": 4,
"dataType": "NUMBER"
},
"power": {
"name": "power",
"name": "energy",
"currentValue": 346,
"dataType": "NUMBER"
}
},