Hi I am new to MQTT and was wondering what the best practice would be for choosing the topic name vs the payload. Here’s what I mean:
Should I have 3 topics for example:
myhome/groundfloor/temperature
myhome/groundfloor/humidity
myhome/groundfloor/airquality
with 3 different payloads for publishing to each topic:
{
"temperature": 32.5 // for myhome/groundfloor/temperature
}
{
"humidity": 67 // for myhome/groundfloor/humidity
}
{
"airquality": 50
}
or, a single topic myhome/groundfloor/data
with all data packed into a single payload:
{
"temperature": 32.5,
"humidity": 67,
"airquality": 50
}
Note that Network Bandwidth is NOT a constraint in my application. Is there a reason to prefer one style over another?