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):


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
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…