MQTT - Publishing multiple bits of info

barx

Well-Known Member
Licensed User
Longtime User
Put in here as not specifically related to any one b4x product.
I'm just starting to play a bit with MQTT within my own house. I have setup Mosquitto broker on an old RPi.
To start off with, I have an old ESP8266 project that connects to my solar pv inverter and currently submits data to ThingSpeak (using MQTT). I'm going to change this to publish to my own broker as mentioned above. A sample of this data below (it runs a basic webserver too to view such data in browser):

Operating Mode - Normal State
Current Power output - 99.00 Watts
Total Generation Today - 7.08 kWh
Lifetime Generation - 7565.90 kWh
Internal Temperature - 28.00°C
PV Voltage - 265.80v
PV Current - 0.50 A
Grid Frequency - 50.10 Hz
Grid Current - 0.60 A

My question is, when publishing to the MQTT broker, is it best practice to send each bit of info to 1 topic ie:
/home/pv/currentpoweroutput/
/home/pv/totalgenerationtoday/
/ home/pv/lifetimegeneration/
etc
or, publish a payload containing all info to one topic, similar to ThingSpeak and decode the individual parts on the receiving client.

Thanks
 
Top