Feature Request: Allow ESPHome API & MQTT to run simultaneously (ESP32-focused) #3276
-
Describe your core improvementSummary I’m requesting an opt-in option to allow both to run together, particularly on ESP32 devices, where CPU and memory constraints are minimal compared to ESP8266. Current limitationsUse Case Allowing MQTT to run in parallel provides: A resilient fallback path for local automation systems (e.g., Node-RED) Continuous telemetry logging even when HA is offline A migration bridge when moving from one broker/system to another Example scenario: Normal operation: API → Home Assistant Fallback: MQTT → Node-RED automations keep working during HA downtime Technical benefitsWhy This Should Be Considered ESP32 hardware easily handles both stacks in parallel without stability issues in testing Limiting to ESP32 (or warning on ESP8266) addresses performance concerns Marking it as an advanced / unsupported option avoids extra testing burden for default users This change would require minimal code modification — just removing the mutual exclusion in config validation, leaving actual component behaviour unchanged Additional contextProposed Approach Add a YAML flag such as allow_mqtt_and_api: true under esphome: Restrict usage to ESP32 targets or log a warning for ESP8266 Keep default behaviour unchanged References Multiple forum and Discord requests for this capability Similar functionality works fine when MQTT is added indirectly via HA, but this adds complexity for the end user Conclusion Happy to help test and document the feature if implemented. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
There is nothing directly preventing both |
Beta Was this translation helpful? Give feedback.
-
Nope. I am using api with mqtt together for last 4 years on my nspanels and no issues. |
Beta Was this translation helpful? Give feedback.
There is nothing directly preventing both
mqtt
andapi
in the same configuration. Maybe you did something else wrong. Please try again and open an issue once you have the actual errors preventing you using both.