Spurious state changes due to interference when using MQTT IO even with pulldown active

I am using MQTT IO to create binary sensors using the raspberri PI4 GPIOs

Here’s my implementation

digital_inputs:
  - name: drain_sensor
    module: rpi
    pulldown: true
    pin: 27
    ha_discovery:
      name: Drain
      device_class: door
  - name: overflow_sensor
    module: rpi
    pulldown: true
    pin: 17
    ha_discovery:
      name: Overflow
      device_class: door

The problem is that I get several notifications during the night due to a state change, which isn’t real, but caused by high current passing through a cable nearby (home battery charging)

How can I solve this?