Add multiple MQTT sensors with same state_topic

Hi! I have an really enoying problem.

I can only use the same state_topic once. When i add a new entry the old ones stop working and only the latest works.

mqtt:
sensor:
- name: “Koloni Current Battery Capacity”
state_topic: “homeassistant/NodeRenogy/state”
value_template: “{{ value_json[‘battCap’] }}”
unit_of_measurement: “%”
device_class: battery
sensor:
- name: “Koloni Current Battery Voltage”
state_topic: “homeassistant/NodeRenogy/state”
value_template: “{{ value_json[‘battV’] }}”
unit_of_measurement: “V”
device_class: battery
sensor:
- name: “Koloni Solar panel output Watt”
state_topic: “homeassistant/NodeRenogy/state”
value_template: “{{ value_json[‘solarP’] }}”
unit_of_measurement: “W”
device_class: power

in the above case “Koloni Solar panel output Watt” only works, if i remove that one “Koloni Current Battery Voltage” starts working instead…

what am i doing wrong?? :slight_smile:

greatful for help

https://community.home-assistant.io/t/how-to-help-us-help-you-or-how-to-ask-a-good-question/114371#oneone-format-it-properly-16

Look at the example here, ignoring the json_attributes stuff:

Should be:

  - sensor:
      name: ...

not

  sensor:
    - name: ...

And as above, please format code correctly when posting on the forum.