Adding binary sensors to D1 mini are there any Pullup pins?

Hi All
I need some help in deciphering this.
I have a D1 mini with a DS18B20 on it, that works perfectly
Then I want to add two binary sensors to it.

So the two sensors have GND attached to one pin, and then the other pin of them attached to D1 and D2 on the D1 mini.
This worked back when I added it, but for some reason it doesn’t any longer.

So I thought maybe I need to add pullup’s to the D1 and D2 pins.
Are there any built-ins on these or other pins?
Or do I just add a resistor on it, and if so with what value?

This is the sucessful config that I using for binary sensors in D1 and D2. I havent added any external resistors for this setup.

  - platform: gpio
    pin: 
      number: D2
      mode: INPUT_PULLUP
      inverted: True
    name: "br1"
    id: br1
  - platform: gpio
    pin: 
      number: D1
      mode: INPUT_PULLUP
      inverted: True
    name: "br2"
    id: br2

Also the pullup resistor details for esp devices can be seen in the below table.


i believe you might have seen the list of best pins to use in case of esp8266. If not please check the below image

4 Likes

That made it work.
But I see some weird messages, I have no idea what that means:

23:26:48][D][api:098]: Accepted 10.11.12.204
[23:26:48][W][api.connection:070]: 10.11.12.204: Socket operation failed: BAD_INDICATOR errno=11
[23:26:53][D][api:098]: Accepted 10.11.12.204
[23:26:53][W][api.connection:070]: 10.11.12.204: Socket operation failed: BAD_INDICATOR errno=11
[23:27:17][D][dallas.sensor:144]: 'pool Temperature': Got Temperature=23.6°C
[23:27:17][D][sensor:113]: 'pool Temperature': Sending state 23.56250 °C with 1 decimals of accuracy
[23:27:21][D][binary_sensor:036]: 'Water too low': Sending state ON
[23:27:23][D][sensor:113]: 'pool WiFi Signal': Sending state -59.00000 dBm with 0 decimals of accuracy
[23:27:29][D][binary_sensor:036]: 'Water too low': Sending state OFF
[23:27:31][D][api:098]: Accepted 10.11.12.204
[23:27:31][W][api.connection:070]: 10.11.12.204: Socket operation failed: BAD_INDICATOR errno=11
[23:27:33][D][binary_sensor:036]: 'Water too high': Sending state ON
[23:27:35][D][binary_sensor:036]: 'Water too high': Sending state OFF

BAD_INDICATOR ???

This could be because of the Native API Component — ESPHome . If you haven’t added the api key, please add it. Then remove the device from the esphome integration, then restart server, then add device to integration again. It should sort the issue

Hmm, I have both the API key and encryption enabled on it.

try removing the device from integration and re-adding it after restarting server

Hmm, that is interesting. If I remove encryption, and reboot the server, it doesn’t seem to appear.
If I add encryption and reboot the server, and add it with the encryption for the device and api password, the error shows up again. The encryption key is taken from the autogenerated on the esphome website.
This sounds like some sort of bug for the d1 mini pro, right?

There has been discussion on such an error but its not happening in all cases. Did you delete and re add the device to the integration?

Yes, deleted it, rebooted the HA, and readded it.

This is very uncommon but you can see more info in API Encryption - where to update in Home Assistant? - #2 by pepe59

Here again re-adding the device sorted the issue.

This one didn’t. I have 30 or so ESPHome devices, and they all have encryption now, none of them shows this problem.
Remove - reboot - readd didn’t change anything, only removing the noise encryption.