XKC-Y25 multiple sensors on Wemos D1 mini

Hi all,

I am trying to get two xkc-y25 sensors to work on an esp8266 Wemos D1 mini, when using one sensor on GPIO16, it works, but adding a second sensor is proving difficult, below is my yaml, anyone have a clue how I can get the second sensor working? I am not using any external resistors. Help is appreciated. Thanks.

esphome:

  name: tank

  friendly_name: Tank

esp8266:

  board: esp01_1m

# Enable logging

logger:

# Enable Home Assistant API

api:

  encryption:

    key: x

ota:

  password: "69f53bdaab9d3ce6df99191d527a611a"

wifi:

  ssid: !secret wifi_ssid

  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails

  ap:

    ssid: "Tank Fallback Hotspot"

    password: "w4Gsuwgxoepj"

captive_portal:

  # Example configuration entry

web_server:

  port: 80

binary_sensor:

  - platform: gpio

    pin:

      number: GPIO16

      mode:

        input: true

        pulldown: true

    device_class: moisture

    name: "Full"

So I see only one sensor configured. Where is the config for the second sensor that doesn’t work? What are the symptoms?

I got it to work with the below code with two sensors. My next challenge is to show the two sensors below in percentages.


binary_sensor:

  - platform: gpio

    pin:

      number: GPIO16

      mode:

        input: true

        pulldown: true

    device_class: moisture

    name: "Full"

   

  # Second sensor

  - platform: gpio

    pin:

      number: GPIO5

      inverted: true

      mode: INPUT_PULLUP

    device_class: moisture

    name: "Empty"

captive_portal:
binary_sensor:

  • platform: gpio
    pin:
    number: D1
    id: gpio_d1
    mode:
    input: true
    pullup: true
    name: Water Sensor 1
    device_class: moisture
    filters:
    • invert
  • platform: gpio
    pin:
    number: D2
    id: gpio_d2
    mode:
    input: true
    pullup: true
    name: Water Sensor 2
    device_class: moisture
    filters:
    • invert

works with xkc-y23a npn