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.

- name: “Koloni Current Battery Capacity”
state_topic: “homeassistant/NodeRenogy/state”
value_template: “{{ value_json[‘battCap’] }}”
unit_of_measurement: “%”
device_class: battery
- name: “Koloni Current Battery Voltage”
state_topic: “homeassistant/NodeRenogy/state”
value_template: “{{ value_json[‘battV’] }}”
unit_of_measurement: “V”
device_class: battery
- 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

Look at the example here, ignoring the json_attributes stuff:

Should be:

  - sensor:
      name: ...


    - name: ...

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