Float switch

I am experiencing an issue where the float switch turns on unexpectedly, even when there is no water present, and then quickly turns off again. Currently, I am using two 4.7-ohm resistors in series at the ground side, rated at 1/4 watt. Can you tell me what type of resistors you are using? I don’t know more about Microcontroller My Code is as below.
binary_sensor:

binary_sensor:
  - platform: gpio
    id: float_switch
    name: Float Switch
    pin:
      number: GPIO4
      mode: INPUT_PULLUP
      inverted: False
    filters:
      - delayed_on: 25ms
      - delayed_off: 25ms

  - platform: gpio
    id: float_switch1
    name: Float Switch UP
    pin:
      number: GPIO12 #D6
      mode: INPUT_PULLUP
      inverted: False
    filters:
      - delayed_on: 25ms
      - delayed_off: 25ms  

Should be 4.7k?

And why do you have internal pull-ups also installed? Or have I misread the code?

My understanding is that when a switch “floats” it is because the pull-up or pull down is not wired correctly

2 Likes

I am using 10kΩ as pull-down resistor with a water switch water level switch.

I do not know what you mean with a water switch, but if it is two bare contacts connected by the water, could it be condensation droplets? Then you may need a physical solution.

Sorry, water level switch - mine looks like this: