Text FROM an MQTT device entity displayed in a card

Through much experimentation and reading of various documents and examples, I managed to get a mqtt device created for a custom built device. Now, I want to take text sent by the device and display it on the screen. The ‘text’ entity integration supported by MQTT goes the wrong way, it send it to the device,

This seems so simple that it must be easy, but I simply can’t find a way to do it. I’m using MQTT Discovery, instead of editing the YAML, and that seems to work as advertized.

Got any pointers on this?

Create a dashboard, add an entity card using the editor.

There are probably custom cards that are more suitable for arbitrary text - but that is a start.

HACS has a multiline entity card if you want your text to wrap.

My problem is getting the text into Home assistant using mqtt. I have no problem sending it out, but how do you get it back in using mqtt?

If you are using discovery correctly then there should be entities created. Have you looked on the developer tab under states for the actual entities created by discovery?

If you implemented discovery correctly then this should already be done. Otherwise you will need to define a sensor in configuration.yaml.

MQTT Discovery requires that you (or whatever actually pushing the values) create a specific MQTT topic with a specific JSON content so that HA can read and interpret it. Did you do that?

If not, you can define a MQTT sensor manually in YAML, indeed.

Yes, there are entities created. I have a couple of them working; one is a basic temp sensor device class sensor that works fine for temperature, and the other is a device class select that works well also.

I have a device (part of a home brew heat pump system) that sends text messages. Things like “compressor fan failure”, and “air volume low”. I want to put these on the screen in a card so they can be read.

I must have read the mqtt a hundred times looking for something in their “Entity integrations supported by MQTT” for something that would handle this. The one called Text is for sending text TO the device, not getting text FROM it.

It boggles my mind that something this simple has evaded my discovery for a couple of days. It’s just gotta be there and I’m overlooking it somehow.

I finally found it. All I had to do was create a sensor using mqtt discovery and put the text I want to display into the sensor state. It will stay there until I change it with another mqtt message.

So I can put the various messages to change the filter and go check the fan, etc in a regular old sensor.

I just have to make sure I don’t configure it to be a numeric value and it works fine.