MQTT Subscribe Sensor w/ API... doubled entities

I know the first post would be, “choose one or the other, but don’t use both mqtt and api”. I have some devices that make use of mqtt subscribe, but I really like how the api organizes into separate integrations. Retain is not a big deal for me either way; I’m familiar with how HA uses discovered devices and how to delete them etc. The doubled entities aren’t a huge deal, but I don’t want them if possible as it will increase the size of my influxdb unnecessarily (as well as adding perhaps some unwanted resource overhead).

Is there a way to use the mqtt sub sensor without having doubled up entities (and the startup configuration.yaml override warning in logs)?

…or should I do like I mentioned up front, and turn off the api on my devices that need to use mqtt sub sensors?


Been a while, maybe an answer has surfaced?


Get your mqtt data into home assistant then just use api alone in esphome.

1 Like

I am not allergic to doing that, but not sure where to start. My setup has HA publishing mqtt messages to trigger playing mp3 files on the devices. Is there another way to have esphome ‘get info’ from HA (like listen to certain states) without mqtt sub?

Nevermind lol, just answered my own q… platform: homeassistant… thanks.

1 Like

how did you solve the problem of 2 sensors, i.e.: temperature and temperature_2 ?
I also don’t want to remove MQTT completely because I need to send “ota_mode” to the device when I want to update it but I am not happy with doubling the sensors in HA