Integration of two wire connected ESP32

Setup
There is a ventilation system in the basement (no WIFI). There is an ESP32 in the basement that controls the ventilation. There is a second ESP32 with Wifi in the flat. I can use existing cabling with two cables for communication between the two ESP32s (distance about 10 m).

I would like some advice on how to set this up.

Approaches
A few approaches that I have already followed (please correct me if I am wrong somewhere):

  • Communication via I2C: The ESP32 in the basement would be the slave. As there is no standard connection of two ESP32s via I2C in ESPHome, I would have to programme this in the Arduino framework. Then I could not use ESPHome. The ESP32 in the flat would then interact with Home Assistant via MQTT. What I don’t like about this solution is that I have to do a lot of programming, operate an MQTT server just for this project and lose the direct, simple integration with Home Assistant.
  • Communication via UART: Using ESPHome on both ESP32 with the ESPHome component UART (see UART Bus — ESPHome). This would allow direct integration via API into Home Assistant, at least from the ESP32 in the flat. The same sensors / switches are defined on both ESP32, these are synchronised via UART. My problem here: There is little documentation and examples on this topic. Has anyone ever done this?

Questions
Any other solutions? Thoughts? Hints?

I would look at lora. Not with esphome though, but you’ll find plenty of examples, including openmqttgateway.

No way possible to have wifi between two esp32’s? I mean just between them, not your router…

In both of your wired options you need common ground, so 3 wires. Also for a length of 10 meters, I expect that you might suffer from interferences if you don’t use twisted/shielded cable.
If you really need to do it with 2 wires, I see uart over RS485 best option.

After some issues with I2C, I used RS485.
Details here: