MQTT discovery not recognizing new topics

I have a problem with MQTT discovery.

I would like to monitor the state of my heating/cooling system. The system is not a mainstream one, but I have connected to it via Modbus using a gateway.
Formerly (before using Home Assistant) I used NodeRed to read out the data, it is working perfectly at the moment.

I created some MQTT Discovery configuration topics (mostly for the temperature sensors) and publish data from NodeRed via MQTT to Home Assistant.
I can see the temperature sensors, but I cannot get a new sensor discovered (generic one or binary sensor) to see other states of my system.

The config and state topics are published (I see them in MQTT Explorer), but they are not discovered by Home Assistant.

Here is the name of the not working configuration topic and its contents:

homeassistant/sensor/energiakulcs/funkciomod2/config
{"device_class":"None",
 "name":"Energiakulcs Hőszivattyú",
"state_topic":"homeassistant/sensor/energiakulcs/funkciomod2/state",
"unique_id":"EK_18_Funkciomod2",
"json_attributes_topic":"energiakulcs",
"json_attributes_template":"{{ value_json | tojson }}",
"device":{"identifiers":["EnergiakulcsGephaz"],
"name":"Energiakulcs2017",
"model":"Energetikai központ",
"manufacturer":"Kardos Labor"}}
homeassistant/sensor/energiakulcs/funkciomod2/state
28

image

And here is a working one:

homeassistant/sensor/energiakulcs/kaloriferkorr_homerseklet/config

{"device_class":"temperature",
"name":"Energiakulcs kalorifer korrigált hőmérséklet",
"state_topic":"homeassistant/sensor/energiakulcs/kaloriferkorr_homerseklet/state",
"unit_of_measurement":"°C",
"value_template":"{{ value_json.temperature}}",
"unique_id":"EK_18_KaloriferKorrT",
"json_attributes_topic":"energiakulcs",
"json_attributes_template":"{{ value_json | tojson }}",
"device":{"identifiers":["EnergiakulcsGephaz"],
"name":"Energiakulcs2017",
"model":"Energetikai központ",
"manufacturer":"Kardos Labor"}}

homeassistant/sensor/energiakulcs/kaloriferkorr_homerseklet/state

{"name":"Kalorifer korrigált hőmérséklet",
"device_class":"temperature",
"state_topic":"homeassistant/sensor/energiakulcs/kaloriferkorr_homerseklet/state",
"temperature":"28.9"}

I didn’t find much in the forum on MQTT Discovery. I have read the documentation, but I am also new on Home Assistant.

Could somebody please point me in the right direction?

Why are you defining json_attributes while your state is obviously not json?
copy/paste monster?

Changing the configuration message to following, especially deleting the “device_class” and json parts made discovery working.

homeassistant/sensor/energiakulcs/funkciomod2/config

{"name":"Energiakulcs Funkciómód",
"state_topic":"homeassistant/sensor/energiakulcs/funkciomod2/state",
"unique_id":"EK_18_Funkciomod2",
"device":{"identifiers":["EnergiakulcsGephaz"],
"name":"Energiakulcs2017",
"model":"Energetikai központ",
"manufacturer":"Kardos Labor"}}