Esphome and mqtt not available in frontend but can listen to topics

Hi all,
I moved a few months ago and I’m just starting to redo my Home Assistant setup.
My setup has been the same for a while so I seemed to have either forgotten stuff or it has changed.

I’ve set this up repeatedly and I’m not getting the desired result.
A Wemos D1 mini clone and a bme280. I’ve set this up the legacy way, as it wouldn’t work with my ssid and secrets for some reason and I constantly got an error.

The next issue is, the following script works in a sence, in that I can subscribe through the test panel and see the results but when I add the esp to the MQTT integration, it is found but the results are blank.
Any idea’s. This seems rather odd.

esphome:
  name: esphome-web-4b298d

esp8266:
  board: d1_mini

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:


wifi:
  ssid: "*****"
  password: "****"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esph******"
    password: "*****"

captive_portal:

# Example configuration entry

i2c:
  sda: 4
  scl: 5
  scan: True
  id: bus_a
  
sensor:
  - platform: bme280
    temperature:
      name: "BME280 Temperature"
      oversampling: 16x
    pressure:
      name: "BME280 Pressure"
    humidity:
      name: "BME280 Humidity"
    address: 0x76
    update_interval: 60s

mqtt:
  broker: *********
  username: *******
  password: *********
  topic_prefix: /chris
  log_topic: /home/inside/bme280temperature
#  topic_prefix: /chris
#  log_topic: /house/frontroom/greenhousehumidity
  birth_message:
   topic: /home/inside/bme280temperature
   payload: ""
  will_message:
   topic: /home/inside/bme280temperature
   payload: ""

  

Share your MQTT integration configuration for these sensors.

Also note this warning:
Screenshot 2022-02-14 at 15-44-32 MQTT Client Component
https://esphome.io/components/mqtt.html

Do you mean what is in the config.yaml?

Yes.

I used to have code in the yaml but I removed it, as that’s what I think you’re supposed to do? Just through the MQTT integration

Is ESPHome sending discovery mqtt messages for your sensors?

MQTT was working before but maybe it has changed since I last added a node, which was a while ago.
I just have the integration set up and nothing in my yaml. But will double check when home. I don’t currently have remote access, due to not having enough on there currently

Use MQTT Explorer to see if there are discovery messages for the sensors under the topic homeassistant.

Okay, thanks. I will try that.

Using the MQTT integration config, I can subscribe to the topic and see the result that way. So it it processing the script, so to speak.

Thinking about it, my Shelly MQTT integrations broke just before I moved house a few months ago. I’ll go through my config file again and see if I’m missing something, as in not removed.

An update.

Not sure what happened but when I plugged the esp back in, Home Assistant found it. Didn’t change anything from when we last messaged on here.

On another note, normally I like to monitor RSSI andhave a reset switch to an esp device but with WIFI. This doesn’t seem to work with this MQTT module. Is this due to it being MQTT? Or should this work too?

sensor:
  - platform: wifi_signal
    name: "Bedroom MQTT WiFi Strength"
    update_interval: 3600s

switch:
  - platform: restart
    name: "Bedroom MQTT Restart"
    
text_sensor:
  - platform: version
    name: "Bedroom MQTT ESPHome Version"

There should only be one sensor: definition in your ESPHome device yaml. How may times does it appear in yours (show your full device config)?

Just once, as I assume text sensor differs

esphome:
  name: bedroommqtt
  friendly_name: bedroomMQTT

esp8266:
  board: d1_mini

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:


wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "********"
    password: "*********"

captive_portal:

# Example configuration entry

i2c:
  sda: 4
  scl: 5
  scan: True
  id: bus_a
  
sensor:
  - platform: bme280
    temperature:
      name: "BME280 Temperature"
      oversampling: 16x
    pressure:
      name: "BME280 Pressure"
    humidity:
      name: "BME280 Humidity"
    address: 0x76
    update_interval: 60s
  - platform: wifi_signal
    name: "Bedroom MQTT WiFi Strength"
    update_interval: 3600s

mqtt:
  broker: ******
  username: ********
  password: ********
  topic_prefix: /chris
  log_topic: /home/inside/bme280temperature
#  topic_prefix: /chris
#  log_topic: /house/frontroom/greenhousehumidity
  birth_message:
   topic: /home/inside/bme280temperature
   payload: ""
   retain: False
  will_message:
   topic: /home/inside/bme280temperature
   payload: ""
   retain: False

switch:
  - platform: restart
    name: "Bedroom MQTT Restart"
    
text_sensor:
  - platform: version
    name: "Bedroom MQTT ESPHome Version"

Yeah that’s fine. The wifi sensor definitely works for the d1_mini. So not sure why you aren’t seeing it.

Yes, I had it working on several at the old house but they were all connected via WIFI and the API. Thought it may have been that.

Got it all working. Thank you for your time.