Can't add a GPIO binary sensor

I have a weird problem - my new POE ESP32 board works great so far, but when I try to add a binary GPIO sensor, this error appears:


I can’t find it anywhere…

Also, I can’t add a DALLAS sensor - with similar errors (but that’s not so important)

this is my YAML (the sensor in question is at the very bottom):

esphome:
  name: eingang-bl-proxy-etc
  includes:
    - uart_line_sensor.h

esp32:
  board: esp32dev
  framework:
#    type: arduino
    type: esp-idf

# Enable Home Assistant API
substitutions:
  device_name: "eingang-bl-proxy-etc"
  location: "Eingangsbereich"

ethernet:
  type: LAN8720
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  clk_mode: GPIO17_OUT
  phy_addr: 0


#dallas:
#  - pin: GPIO12
#    update_interval: 10s

logger:
  level: DEBUG 
  baud_rate: 0 #disable logging over uart

uart:
  - tx_pin: 16
    rx_pin: 32
    baud_rate: 9600
    id: uart_bus

# Enable Home Assistant API
api:
  password: !secret api_ota_pass

ota:
  password: !secret api_ota_pass

# Text sensors with general information.
text_sensor:

  - platform: custom
    lambda: |-
      auto my_custom_sensor = new UartReadLineSensor(id(uart_bus));
      App.register_component(my_custom_sensor);
      return {my_custom_sensor};
    text_sensors:
      - name: "UART CPM Sensor"
#        internal: true
        id: "uart_cpm"



sensor:

  # Uptime sensor.
  - platform: uptime
    name: ${device_name} Uptime


button:
  - platform: restart
    name: "${location} ${device_name} Restart"


#switch:


bluetooth_proxy:
  active: true

esp32_ble_tracker:
  scan_parameters:
     duration: !secret ble_tracker_duration

binary_sensor:
  # Presence based on iBeacon UUID
  - platform: ble_presence
    ibeacon_uuid: !secret xxx_phone_uuid
    ibeacon_major: 100
    ibeacon_minor: 1
    name: "xxx-Phone-BLE-${device_name}"


  - platform: ble_presence
    ibeacon_uuid: !secret yyy_phone_uuid
    ibeacon_major: 100
    ibeacon_minor: 1
    name: "yyy-Phone-BLE-${device_name}"

  - platform: ble_presence
    ibeacon_uuid: !secret zzz_phone_uuid
    ibeacon_major: 100
    ibeacon_minor: 1
    name: "zzz-Phone-BLE-${device_name}"


  - platform: gpio
    name: "${device_name} Eingangstüre"
    pin:
      number: 33
      mode: INPUT_PULLUP 
      inverted: true
    filters:
      - delayed_on_off: 20ms

what’s gong on there?!

Any reason you are using esp-idf instead of arduino?

yes - because the main purpose of that ESP will be to control a Yale door lock via Bluetooth - and with esp-idf the connection is supposed to be more stable and quicker.

could this be an issue?! I thought changing this makes the system more stable because it removes a whole layer of code… hmmm - will give it a quick try with arduino

EDIT: well, ok now it works :woman_facepalming: kind of weird that something as basic as a GPIO binary sensor won’t work with this xD

where did you hear that?

in this thread: August Lock Gen4 + HomeKit - #64 by Farnsworth

and when I searched, I found threads like this Question: Benefits of esp-idf over framework type arduino · Issue #62 · mmakaay/esphome-xiaomi_bslamp2 · GitHub where it is explained why that is the case.

and about the speed - I can personally confirm that with arduino the lock takes around 4-5s to react, with esp-idf it’s somewhere around 1s

Actually just after i posted I saw that second thread (just by chance). Interesting.

Possibly nothing to do with your sensor - did you recently upgrade to 2022.12 ESPHome?

interesting - will give it a try with one of the upcoming versions then ^^

I just went (back) to the ESPHome beta branch, and everything (I use) works now with esp-idf :sweat_smile:

I had the same problem not being able to add a dallas temperature sensor.
Going to ESPHome beta solved the problem.

Thank you for the hint !