Binary Sensors missing

Hello everyone,

I need help I can’t get my Binary Sensors to show as entities on my integrations. Can you help.

I can see the sensor when looking on the device logs in the ESPHome.

My Config:

esphome:
  name: kitchen-sensors

esp8266:
  board: esp01_1m

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:
  password: ""

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: ""
    password: ""

captive_portal:

binary_sensor:
  - platform: gpio
    pin:
      number: GPIO12
      inverted: false
      mode:
        input: true
    name: KitchenSensor
    device_class: motion

  - platform: gpio
    pin:
      number: GPIO13
      inverted: false
      mode:
        input: true
    name: BathroomSensor
    device_class: motion

i2c:
  sda: GPIO4
  scl: GPIO5
  scan: true
  id: bus_a
  
sensor:
  - platform: am2320
    temperature:
      name: "Kitchen Temperature"
    humidity:
      name: "Kitchen Humidity"
    update_interval: 10s

Remove, readd esphome integration

Please post your logs and config in a readable format.

1 Like

Hi nikito7, I didn’t understand you can you please explain?

Hi, sorry for the bad formatting, I hope it’s better now.

And add it again.

Hi, I have done that multiple times, didn’t get it to work.

Do not name ESPhome devices using dashes. This will most often break HA integrations as dashes are not supported in sensor names.

So try without the dashes and let us know if that solves it.

esphome:
  name: kitchensensors

esp8266:
  board: esp01_1m

I know they are supposed to work according to ESPhome but I have had issues

1 Like

I really hopped this would work, but no luck… open to other suggestions.

Have you looked in dev tools - states for them ?

1 Like

First delete the integration. In your config folder you will see a folder called .storage. In that folder you will find text files in the format esphome.**random numbers/letters** Open the files and you should find a copy of the yaml for the problematic node, delete it. Then restart HA and add the integration back.

1 Like

It turned out to be something in the configuration.yaml I hade some binary switches connected directly to the RasPi, removed them since I wasn’t using them anymore. Thanks to everyone who helped with this.

Another reason why a binary sensor doesn’t show up in Home Assistant is if you don’t give it a name, because then it gets treated as internal.

  • internal (Optional, boolean): Mark this component as internal. Internal components will not be exposed to the frontend (like Home Assistant). Only specifying an id without a name will implicitly set this to true.

That wasn’t the issue for OP, but this thread ranks at the top for “home assistant binary sensor missing”.

3 Likes

I searched everywhere thanks to you i realised i haven’t named them, I sat 6 hours infront of my PC and did not understand why it would not show up.
Many Thanks,
You saved me from going insane.

2 Likes

Hello I am new to esphome and home assistant. I have also trouble with binary_sensors not visible. I went down to the most simple example but without success. Other entities (sensors, switches) are just fine. I tried changing the binary_sensor to switch but it is still not visible if platform is homeassistant. If the platform is gpio, it works fine.

I want the ESP to receive a binary value to switch between automatic and manual mode - I am not even sure if it is okay to use binary_sensor for that purpose. The YAML code made to build the application:

esphome:
  name: "water-level"
  friendly_name: ESP

esp8266:
  board: esp01_1m

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "****"



wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "****"
    password: "****"



captive_portal:
ota:
  - platform: esphome
    password: "****"


switch:
  - platform: homeassistant
    id: automatic_mode
    name: "helloworld"
    entity_id: switch.automatic_mode

    # Definice digitálního výstupu pro čerpadlo
  - platform: gpio
    pin: GPIO3
    name: "Water Inlet"
    id: water_inlet
    restore_mode: always_off  # Čerpadlo bude vždy vypnuto při startu