MQTT payload documentation?

362 views
Skip to first unread message

Kohala Jim

unread,
Feb 8, 2021, 1:26:00 PM2/8/21
to electrodacus

Greetings all -

Does anyone here have a list of the MQTT dialog that's published by the latest EPS32 client?
I've been scaling up a collection of Tasmota enabled devices with Mosquito and Node-RED, and I'm ready to integrate SBMS0 payloads.

Thanks in advance.

Dacian Todea

unread,
Feb 8, 2021, 1:52:30 PM2/8/21
to electrodacus
Jim,

See the github maybe ask Robert for details https://github.com/armageddon421/electrodacus-esp32/issues/27

Kohala Jim

unread,
Feb 8, 2021, 2:10:07 PM2/8/21
to electrodacus
Not much in the way of any docs...
After quickly scraping the repo it appears the .cpp source is the most informative, albeit a bit of convention decode is needed from raw source... 
This should get me going and I'll start with some debug and see where I get.

ty,
KJ



Bernd

unread,
Feb 8, 2021, 4:26:24 PM2/8/21
to electrodacus
i would love to assist here as well. didn´t manage to read the data via mqtt on my sbms0 yet. Any information is welcome.

Dacian Todea

unread,
Feb 8, 2021, 4:35:48 PM2/8/21
to electrodacus
Check the github link I mentioned in first replay. The sbms variable is what is set over MQTT and all data is preset in that json format.
I had not played with MQTT as that is of no interest to me but all should work as expected.

Bernd

unread,
Feb 8, 2021, 5:05:40 PM2/8/21
to electrodacus
not sure, that i´ve got the complete overview, but how do we keep the software up2date to new requests / bugs / updates. I believe some people would be happy to assist, but we do not know how....
Think of an adapter for sbms0 in home automation software tools that is easy to integrate without binary, based 91 decoding?
How can we update the html files on the sbms0 for all of us?
-> the software update process needs to part of the product development :-)

Let us join, please :-)

Dacian Todea

unread,
Feb 8, 2021, 5:53:35 PM2/8/21
to electrodacus
Bernd,

Not sure what you are asking exactly. The WiFi (ESP32) firmware is a separate thing from the SBMS0 firmware.
To program the ESP32 on the new SBMS0 all you need is an USB cable and you need to flip some switches to put it in to program mode then back in to normal working mode.  I do not think Robert has any newer version of firmware compared to the one that already comes with the SBMS0.
You can use the html file as transmitted by the ESP32 or you can download the html file on your device and edit that html file with the link where to get the raw data then you can modify the html file the way you want.
Not sure I answered your question as I'm not sure what exactly you are asking.
The SBMS0 firmware is separate as mentioned and written for the STM32F373 that is on the main SBMS0 board and separated form the WiFi firmware.
The SBMS0 will transmit that compressed data over UART to the ESP32 or if you want to the USB port and that data has already a fixed format documented in the user manual.
If data was not compressed in base 91 then data will be at least 2.5x larger in size. Base 91 is no different form base 16 (Hex) or base 10 (Dec) and the formula and all details on how to decompress is present in SBMS0 user manual.


Below an answer I provided recently to someone over email related to base 91
He asked about the USB data and what it means and sent me this photo with a few lines of data thinking data is wrong.

serialdata.png
 
"The data seems correct.  What you get over serial is the sbms variable and the content of that is explained at page 20 in the manual https://electrodacus.com/SBMS0/SBMS0v03d.pdf

For example, that first character "8" represents the year just compressed using that base 91 simple compression.
I use the ascii characters for 35 (#)  up to 126 (~) so a total of 91 characters.
Thus "8" is number 56  and so 56 - 35 = 21 meaning year 2021
Next character is for month "," and that is 44 - 35 = 9  (not sure why you set month as september).
The data log seems to be done every 30 seconds
Then "#T"  is the state of charge and since # is zero it is simple to calculate as "T" is 84 - 35 = 49 so most likely you just connected the SBMS as it always defaults at 49% at power up.
Then the first cell voltage is "IJ"   "I" is 73 - 35 = 38 * 90 = 3420  and to that you add "J" 74-35 = 39  so  3420 + 39 = 3459mV so likely LiFePO4 and very close to fully charged. "

ascii.png

Kohala Jim

unread,
Feb 13, 2021, 10:15:07 PM2/13/21
to electr...@googlegroups.com
For anyone wondering about the MQTT payload object, I've pasted it below from the Node-RED debugger for others to reference.
Everything is pretty self-evident and reflective of the internal data logging output (page 20-21)

Below this is my visualization sandbox in preparation for the new house...
I've simply powered up my unit for evaluation with a resistor divider to battery simulation so I could get comfy with decode and display of dashboard data.
The SBMS0 payloads visualization sample are in the leftmost "off-grid" panel

object
timeobject
year0
month1
day1
hour4
minute2
second55
soc49
cellsMVarray[8]
02905
12916
20
30
40
50
62924
72935
tempInt28.6
tempExt-45
currentMAobject
ad20
ad30
ad40
heat10
heat210774
flagsobject
OVfalse
OVLKfalse
UVfalse
UVLKfalse
IOTfalse
COCfalse
DOCfalse
DSCfalse
CELFfalse
OPENfalse
LVCfalse
ECCFfalse
CFETtrue
EOCfalse
DFETtrue

Soggy Paws

unread,
Mar 7, 2021, 2:12:27 AM3/7/21
to electrodacus
Jim, thanks for sending me your flows file.  I've got it working and am tweaking a few things. Just want to note here that your documentation (whats in the MQTT object above) is missing something.  The current object within the sbms MQTT object should look like this:

currentMA: object
           battery:-1100
           pv1:0
           pv2:0
           extLoad:1040

T McNamara

unread,
Mar 7, 2021, 8:35:07 AM3/7/21
to electrodacus
Hello Jim
Just want to compliment you on you implementation of SBMS to Grafana dashboard. I am following your progression with reference to your intention to integrate wind energy into your SBMS install.
I dont wish to take your attention away from your present integration with node red/grafana --I am in the process of setting up pi3b+ as broker and windows 10 pubs and subs. Not having fun as I am not a programmer. I am setting up an influxdb to capture the extio settings and SOC state from  SBMS so I can know how to manage the wind energy. I expect that some of this info can be parsed from the json.
Further on the wind side, I have discovered a Wind Turbine MQQT regulator written with the arduino IDE that is quite interesting and may be adapted to phython and used with a pi zere or micro. The author is Phil...@yahoo.fr and the project can be viewed on hackster.io
I am also investigating how this may be intregrated into a Hybrid Micro inverter from Cyboenergy Model #CIM-1200Na for critical loads(AC Assist) and Model CIM-1200H/N for non-critical loads using a combination of wind, solar, and battery. I have a 1000lt container for my dumpload to pre-heat water and control the wind generator and plan to use Dacians method of coiled wires for both diversion from SBMS and dumpload from the wind source.
Any thoughts are welcome
Terry

Kohala Jim

unread,
Mar 7, 2021, 3:36:55 PM3/7/21
to electrodacus
glad you were able to use the example flow nodes...
as far as the MQTT payload I cut and paste from NR, the only setup I performed with the SBMS0 was configuring as a 4-cell 12V system (and of course the WiFi setup)

Kohala Jim

unread,
Mar 7, 2021, 3:58:16 PM3/7/21
to electrodacus
Terry -

Thanks for your reply... just to clarify, I hadn't gone down the Influx/Grafana rabbit hole (yet) as I'm still plying in the Node-RED sandbox... I do have the Influx support palette imported to NR, just haven't spun anything up as it's all make believe for now.  I see some potential value for longer term analytics by storing off historical data, however, with direct the correlation & causation of environment on solar and wind production, there's not really any unknowns here to unearth.  I will definitely have a look at the hackster.io project you've cited as I'm all-in when it comes to supplemental turbine charging for PM hour support.  My new location is uphill from a reliable trade-wind channel, and I'm starting with a small 500W micro-turbine.  I'm looking at all potential means of control, and between the VESC project, the Olympic Power Controls methods (John Daniel), and this Arduino project you cite, I'll have lots to go chase down and investigate... my fallback is of course the Midnite Solar controller which I've seen used effectively by another off-grid you-tuber on Hawaii.  Like you I'll start with a couple diversion-ready DSSR20's along with additional PWM SSR's to load-shed, and I'm looking forward to actually be able to move and start deployment next month.  I'm starting my solar ventures with a grid-tied ground-racked 8kW system that's HELCO approved, and once that's commissioned I'll start into my off-grid endeavors..  So much to deploy and build in this space, including a CAT5 DC-lighting system I've been cooking up in similar veins of architecture to LumenCache and LightZero topologies, fusing Tasmota and other low-cost off-the-shelf low power tech.  Looking forward to more open collaboration among like-minded adopters.


Reply all
Reply to author
Forward
0 new messages