(Mods, I thought configuration was most appropriate, but please move this to ESPHome if you think it belongs there.)
So as the title says, I had a sensor communicating via MQTT that was online and working and suddenly stopped working when I installed ESPHome. After uninstalling and re-installing my integrations and add-ons, I come once again to the forum to seek help. Here’s the order of events:
- Installed ESPHome to work with a atmospheric sensor for a room. It gets setup and works perfectly, except I need it to do something I’ve written in C++ and can’t get it to communicate to HA while also doing the fancy light tricks. (well maybe I could, but I didn’t want to learn what was needed in yaml just yet).
- I uninstall/disable ESPHome once I realize I’m not using it for the time being. The three sensors still show up as unavailable in entities and I can’t delete them. I shrug it off as nbd.
- Setup MQTT instead. Huzzah it works! It does both communicating with HA and fancy light tricks. This was 2-3 days ago.
- Today, I’m working on a new project and I need ESPHome again. I enable it again.
- The MQTT Sensors appear unavailable, but I didn’t connect it to me turning on the ESPHome yet, I figured it was a weird glitch and I put it on the list to take care of later.
- Huzzah! ESPHome project works. MQTT is still unavailable.
- The entities for the MQTT sensor are still present, but offline. I one-by-one uninstall items to try and figure it out.
- I figured there was some cross talk because perhaps the device ID was used for a 2 separate integrations and HA didn’t know what to do with it. Since the old entities are still on the list but unavailable, I tackle getting rid of them first. Nothing got rid of them until I fully removed the integration and add-on of ESPHome. When I brought it back online the old entity was no longer there - a good sign. But the new one still wasn’t showing up either.
- So I go through removing and reinstalling MQTT (mosquitto) in add-ons and integrations. Brought everything back online with the correct username and password - still nothing in entities.
- (It should be noted that on the first installation where it worked, I didn’t need to add anything in my config.yaml file except for “mqtt, broker, port, username, pass”. I am also giving ample time (1-1.5 hours) between checking if the entity is there (incase it takes time) and also refreshing HA.)
- Since it isn’t showing up I decide to add “sensor, - platform: mqtt, etc etc” to my configuration file. Still nothing.
- And now I’m just making minor adjustments to the mqtt/sensor section of my configuration file, thinking it’s a syntax type error (though the HA IDE doesn’t throw any errors.)
I’ve checked the logs. The IP of that esp8266 is successfully connected. I listened in from HA/MQTT as well as MQTT explorer, and messages are being broadcast on the correct topic successfully from the esp8266. The messages are in the correct json format. I’ve attached two screenshots.
So now I’m wondering if my 1-1.5 hours of patience in between changes in the backend isn’t patient enough. I’m hoping in 6 hours the entities will show up. I just can’t figure out what else needs to be done for HA to add and recognize the sensor. I’m down to wondering if my indentations are wrong in my config file or something minor that I’ve overlooked! Passwords, usernames, IP addresses, ports, topics, etc - they are all how they should be.
What’s crazy is when I first setup this sensor via MQTT it was almost flawless. HA started listening, added the sensors, and I was in business with graphs on my dashboard. Let me know if I missed anything! I guarantee it is going to be a simple, minor change…