I have tried various methods from the forum, but without any success.
When I subscribe to the topic from the HA, I get the data
This is one of my configuration attempts for “soc” value, but I would like to pull the data from other nested attributes like “cellsMV”.
# SBMS
mqtt:
sensor:
- name: "SBMS"
state_topic: 'homeassistant/sensor/solar/sbms/'
value_template: '{{ value_json.soc }}'
json_attributes_topic: 'sbms'
unit_of_measurement: '%'
This is the mqtt json message:
{
"time": {
"year": 0,
"month": 1,
"day": 1,
"hour": 0,
"minute": 11,
"second": 38
},
"soc": 49,
"cellsMV": [
3223,
3223,
0,
0,
0,
0,
3223,
3219
],
"tempInt": 22.7,
"tempExt": 21.8,
"currentMA": {
"battery": -48,
"pv1": 0,
"pv2": 0,
"extLoad": 0
},
"ad2": 0,
"ad3": 0,
"ad4": 0,
"heat1": 0,
"heat2": 0,
"flags": {
"OV": false,
"OVLK": false,
"UV": false,
"UVLK": false,
"IOT": false,
"COC": false,
"DOC": false,
"DSC": false,
"CELF": false,
"OPEN": false,
"LVC": false,
"ECCF": false,
"CFET": true,
"EOC": false,
"DFET": true,
"delta": 4
}
}