Electrodacus SBMS0 - need help pulling MQTT values

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
    }
}

For the first value:

value_template: '{{ value_json.cellsMV[0] }}'

The second

value_template: '{{ value_json.cellsMV[1] }}'

The third

value_template: '{{ value_json.cellsMV[2] }}'

Etc…

Thanks Tom for such a quick response, but I am not even able to get the values for unnested attributes like SOC, let allone cellsMV.

I just tried these two without success. Each time I have restarted the HA.

# SBMS
mqtt:
  sensor:
  - name: "SBMS"
    state_topic: 'homeassistant/sensor/solar/sbms/'
    value_template: '{{ value_json.cellsMV[0] }}'
    json_attributes_topic: 'sbms'
    unit_of_measurement: '%'
# SBMS
mqtt:
  sensor:
  - name: "SBMS"
    state_topic: 'homeassistant/sensor/solar/sbms/'
    value_template: '{{ value_json.cellsMV[0] }}'

What errors do you see in System → Logs.

Well, seams nothing related to it. Other mqtt integrations works.
Also, I understood if the mqtt topic has prefix “homeassistant” it should be autodiscovered, but that is also not the case.

2023-01-22 14:31:36.556 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration alexa_media which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-01-22 14:31:36.560 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration circadian_lighting which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-01-22 14:31:36.563 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hass_agent_mediaplayer which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-01-22 14:31:36.565 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration garbage_collection which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-01-22 14:31:36.567 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration waste_collection_schedule which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-01-22 14:31:36.570 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration rpi_gpio which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-01-22 14:31:36.572 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration asusrouter which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-01-22 14:31:36.574 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration watchman which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-01-22 14:31:36.577 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-01-22 14:31:36.579 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hass_agent_notifier which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-01-22 14:31:36.581 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration alarmo which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-01-22 14:31:36.583 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration thermal_comfort which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-01-22 14:31:36.585 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration scheduler which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-01-22 14:32:02.365 ERROR (MainThread) [homeassistant.components.tankerkoenig] The 'tankerkoenig' option near /config/configuration.yaml:2 has been removed, please remove it from your configuration
2023-01-22 14:32:05.242 WARNING (MainThread) [homeassistant.config_entries] Config entry 'EPSON XP-352 355 Series' for ipp integration not ready yet: Invalid response from API: Error occurred while communicating with IPP server.; Retrying in background
2023-01-22 14:32:05.462 WARNING (SyncWorker_0) [homeassistant.components.tankerkoenig] Found more than 10 stations to check. This might invalidate your api-key on the long run. Try using a smaller radius
2023-01-22 14:32:08.394 ERROR (MainThread) [homeassistant.components.binary_sensor] Platform tankerkoenig does not generate unique IDs. ID 173daa10-3967-462a-a464-d751725eadcc_status already exists - ignoring binary_sensor.avia_lachgartenweg_9_status
2023-01-22 14:32:08.412 ERROR (MainThread) [homeassistant.components.sensor] Platform tankerkoenig does not generate unique IDs. ID 173daa10-3967-462a-a464-d751725eadcc_e5 already exists - ignoring sensor.avia_lachgartenweg_9_super
2023-01-22 14:32:11.834 WARNING (MainThread) [aioesphomeapi.reconnect_logic] Can't connect to ESPHome API for windriktmod2 @ 192.168.50.228: Error connecting to ('192.168.50.228', 6053): [Errno 113] Connect call failed ('192.168.50.228', 6053)
2023-01-22 14:32:11.839 WARNING (MainThread) [aioesphomeapi.reconnect_logic] Can't connect to ESPHome API for sonoffr2 @ 192.168.50.70: Error connecting to ('192.168.50.70', 6053): [Errno 113] Connect call failed ('192.168.50.70', 6053)
2023-01-22 14:32:11.978 WARNING (MainThread) [homeassistant.config_entries] Config entry 'LG webOS TV 4690' for homekit_controller integration not ready yet: Timeout while waiting for connection to device 192.168.50.42:39501; Retrying in background
2023-01-22 14:32:12.128 WARNING (MainThread) [aioesphomeapi.reconnect_logic] Can't connect to ESPHome API for power-monitor2 @ 192.168.50.215: Error connecting to ('192.168.50.215', 6053): [Errno 113] Connect call failed ('192.168.50.215', 6053)
2023-01-22 14:32:50.336 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: asusrouter
2023-01-22 14:33:50.428 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: asusrouter
2023-01-22 14:34:50.524 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: asusrouter
2023-01-22 14:35:03.057 WARNING (MainThread) [homeassistant.config_entries] Config entry '192.168.50.1' for asusrouter integration not ready yet: ('[Errno 104] Connection reset by peer', None); Retrying in background
2023-01-22 14:35:13.477 WARNING (MainThread) [aiohue.util] Received unexpected bridge id: 93eadbeef13
2023-01-22 14:35:13.588 WARNING (MainThread) [aiohue.util] Received unexpected bridge id: 93eadbeef13
2023-01-22 14:35:13.701 WARNING (MainThread) [aiohue.util] Received unexpected bridge id: 93eadbeef13
2023-01-22 14:35:13.720 WARNING (MainThread) [aiohue.util] Received unexpected bridge id: 93eadbeef13
2023-01-22 14:35:13.764 WARNING (MainThread) [aiohue.util] Received unexpected bridge id: 93eadbeef13

I have tried Node-Red HA addon to read the MQTT message, and it shows it in the debug window.
Is there anything else besides the custom sensor in the configuration.yaml i could check?

Could anybody shed some light on this?

Thanks, but as I have said, I have already tried that.

Problem solved. It was “/” at the end of the topic. I am not a coder, and however it is simple, very new to me, but I am really surprised nobody noticed that from the experienced users.

Hi Fibra,

I have my sbms connected to my broker and receiving data. would you mind sharing what you did next, to use this data within Home assistant.

Thanks!

If I wanted to get this “battery” data:
currentMA": {
“battery”: -48

how would the template need to be arranged, " {{ value_json.currentMA[battery] }}" ?

Thanks