Analog PH Sensor -> Arduino Uno -> ESP8266 (Wemos D1 Mini) -> ESPhome -> Home Assistant

One other comment, I think you might actually be better served by the median filter instead of the simple average. This would help compensate for outlier readings similar to how the original code threw out the top and bottom two readings.

  filters:
    - median:
        window_size: 7
        send_every: 4
        send_first_at: 3