HA doesn't recognise MQTT device at all

Ladies’n Gents,
my HA is running properly in a Docker Container under Unraid. So fare so good.
I tried to connect my NodeRed installation using MQTT to HA.
When looking with an MQTT Expplorer I see all the messages appering on the MQTT,
=> But the MQTT integration doesn´t recognise this device inside HA at all.

I think this is maybe some kind of “fundamental” misunderstanding from myself, but not sure.

Any help or hint to look at?

A picture attached to help you getting the point

Your discovery messages are under the NodeRed topic. Pretty sure they need to be under the homeassistant topic (in a very specific topic structure). e.g. Here is one of my zigbee2mqtt discovery messages under homeassistant/binary_sensor:

I don’t use Node Red so I have no idea how to do this but I have moved your post to the Node Red category so that hopefully someone who does can help.

Tx for that fast reply, I checked it out, but still no detection inside HA

So I will wait for some more hints

That’s still not quite the correct structure. The CONFIG message should be under:

homeassistant/sensor/PV-Garage/

And I’m not sure if using dashes in the sensor name is legal. See here for more:

https://www.home-assistant.io/docs/mqtt/discovery/#discovery-topic

no worries, much apreciated, really, anything is helpfull.

I change the name without the “-”

But still only one Device, “FernsehZimmer” is available, not the “PVGarage”

Try putting CONFIG under this topic:

homeassistant/sensor/PVGarage/PVGarage

Getting closer to the point and with your help I´m pretty sure we eliminate possible beginners failures.

But…still no device upcoming

To be more precise, if I´m lissening inside MQTT HA integration to topic
homeassistant/PVGarage/STATE, I get the following info

so principially the connection itself seems to work, only a configuration thing maybe

Seems we have a progress,

Under LOGS in HA I get now following errror message

Logger: homeassistant.util.logging
Source: util/logging.py:114
First occurred: 10:14:13 (41 occurrences)
Last logged: 10:20:50

Exception in async_discover when dispatching ‘mqtt_discovery_new_sensor_mqtt’: ({‘availability_topic’: ‘homeassistant/sensor/PVGarage/availability’, ‘device’: {‘identifiers’: ‘NodeRedPVGARAGE’, ‘manufacturer’: ‘PVGarage’, ‘name’: ‘PVGarage’}, ‘name’: ‘PV-Garage’, ‘platform’: ‘mqtt’},) Traceback (most recent call last): File “/usr/lib/python3.9/site-packages/homeassistant/components/mqtt/mixins.py”, line 246, in async_discover config = schema(discovery_payload) File “/usr/lib/python3.9/site-packages/voluptuous/validators.py”, line 218, in call return self._exec((Schema(val) for val in self.validators), v) File “/usr/lib/python3.9/site-packages/voluptuous/validators.py”, line 341, in _exec raise e if self.msg is None else AllInvalid(self.msg, path=path) File “/usr/lib/python3.9/site-packages/voluptuous/validators.py”, line 337, in _exec v = func(v) File “/usr/lib/python3.9/site-packages/voluptuous/schema_builder.py”, line 272, in call return self._compiled([], data) File “/usr/lib/python3.9/site-packages/voluptuous/schema_builder.py”, line 817, in validate_callable return schema(data) File “/usr/lib/python3.9/site-packages/voluptuous/schema_builder.py”, line 272, in call return self._compiled([], data) File “/usr/lib/python3.9/site-packages/voluptuous/schema_builder.py”, line 594, in validate_dict return base_validate(path, iteritems(data), out) File “/usr/lib/python3.9/site-packages/voluptuous/schema_builder.py”, line 432, in validate_mapping raise er.MultipleInvalid(errors) voluptuous.error.MultipleInvalid: required key not provided @ data[‘state_topic’]

You need to point to where the state topic is in your discovery config.

Just FYI: You can also manually define the sensors in YAML.

Alright,
tx so much, looks like we reached together the next evolution step.

I see my device in HA upcoming

With no ENTITIES so fare, but upcoming
Only one step more to go I assume for us…

1 Like

So it´s me again,
I’m still struggling the device do not have any entities.
Inside MQTT Explorer I see following

So device or setup is working.

Only HA doens’t display me the ENTITIES. May I have to configure them in another way I did?

{
“availability_topic”: “homeassistant/sensor/PVGarage/availability”,
“device”: {
“identifiers”: “NodeRedPVGARAGE”,
“manufacturer”: “PVGarage”,
“model”: “selfmade”,
“name”: “PVGarage”
},
“name”: “PVGarage”,
“state_topic”: “homeassistant/sensor/PVGarage/PVGarage/state”
}