Connect arduino to esphome

hello, I am creating a weather station, my code is under esphome but to reduce the wiring I want to use an arduino nano for the wind vane, the anemometer and the rain gauge and use arduino port extender with i2c, which gives me allows the integration of other sensors with 4 wires. I block on the pulse_counter I do not know if it is possible to integrate it into the arduino for which communicates the result to the esp.

Surely an esp has enough IO?

yes but it’s to go from 7 wires to 4 wires, here is the project (sorry it’s in French, but it’s interesting with help a translation is possible)

An ESP32 has about 20 usable GPIO.

the problem is not on the esp but on the cable between the sensors on the mast and the esp.

Put the ESP on the mast. Then you only need to supply power. Assuming you have Wifi coverage where it is to be installed.

I wanted to install the ESP inside my house because my walls are 90cm and the wifi is bad outside. I can easily have external cable with 4 conductors and over long lengths.