Please can people tell me which of these JSON formats is the most appropriate?
- Object.
{
"services":
{
"nodered":{"State":"running","enabled":"enabled"},
"mariadb":{"State":"running","enabled":"enabled"}
}
}
- Array.
{
"services":
[
{"name":"nodered","State":"running","enabled":"enabled"},
{"name":"mariadb","State":"running","enabled":"enabled"}
]
}
Using the first I can easily get msg.payload.services.nodered.State or msg.payload.services.mariadb.State
This is not so easy with the second, array format, but I think it will be easier to make a dashboard table to show the status.
My aim is a dashboard showing the status of multiple services as LEDs, grey for not installed, green for running, red for stopped.