This entity is unavailable but I get values

I have added a MQTT device to my new HA set-up. This is what I have in the Configuration file:

mqtt:
  sensor:
    
  - name: "Test RSSI" 
    unique_id: Test_RSSI
    state_topic: "test/RSSI"
    unit_of_measurement: dB
    device_class: signal_strength

The device comes up in my Entities and if I click on it, it comes up with a graph of the value but at the top is a message saying ‘This entity is not available’.
Also, I have added it to the Bedroom but it doesn’t show on the Overview. I don’t get any errors identified when I Check Configuration. I have Restarted several times but no joy.
Any advice would be gratefully received.

Hi Graham Arthur Johnston,

It’s available intermittently,therefore has a value sometimes and will display that.
I have a sensor on the edge of WIFI that comes and goes.

Ok. But the signal strength is good. It’s around -58dB. It is only sent every 30sec, but I didn’t think that would cause a problem.
I used to have all my MQTT stuff running on a separate Pi and HA would look to that Pi for it’s MQTT data. I didn’t have this issue with that setup. Now the MQTT data is going to the HA Pi and I’m using a Username and Password. That’s the only change I’ve made to the MQTT modules. Ideally I would run without Username and Password, since that is how most of them are at present but it seems that is not allowed.
I think I must be screwing up something really basic.

I have this from the Mosquitto broker log

2024-11-22 16:42:58: New connection from 192.168.1.140:63435 on port 1883.

2024-11-22 16:42:58: New client connected from 192.168.1.140:63435 as bid_test (p2, c1, k15, u’graham’).

2024-11-22 16:49:19: New connection from 172.30.32.1:46637 on port 1883.

2024-11-22 16:49:19: New client connected from 172.30.32.1:46637 as 3bgYAF7MBt9WiynNzjjcgS (p2, c1, k60, u’homeassistant’).

2024-11-22 16:49:20: Client 3bgYAF7MBt9WiynNzjjcgS disconnected.

2024-11-22 16:54:53: Client bid_test closed its connection.

2024-11-22 16:54:58: New connection from 192.168.1.140:60177 on port 1883.

error: received null username or password for unpwd check

2024-11-22 16:54:58: Client bid_test disconnected, not authorised.

2024-11-22 16:55:03: New connection from 192.168.1.140:60650 on port 1883.

2024-11-22 16:55:03: New client connected from 192.168.1.140:60650 as bid_test (p2, c1, k15, u’graham’).

I don’t know how to enter the username and password. Can someone tell me where and give an example of the syntax

The username and password needs to be entered on the device.
You have not told us what the device is for one.

The device is an ESP8266 module of my own design running Telegram and MQTT.
There is now a username and password added into the code of that module. That’s what I said in the second post from me. I don’t believe the problem is with the ESP8266 module. I think the issue is with how the Username and Password is declared in HA. I don’t know where that has to be done or what it should look like.
Does it need to be done in the Mosquitto add-on or MQTT integration - or both.
I’m sorry if I’m not clear on this but I’m finding the documentation very difficult to follow. There are many references to Configurations and it’s not clear which is being refered to.

Neither.

From the add-on documentation:

Yes. That is what I have seen described, however, there is not a User Tab on under People. I’m wondering if it has been moved on a newer version of HA

Turn on advanced mode in your profile then try again.

Yay!!! That was it. I knew it was something stupid. Essentially it was working but not quite.
Thank you for your patience and rapid response. I can run with this now. Lots of modules to update though. Urgghhh!

1 Like