Is there an example of adding a inary sensor, a Temp sensor and a switch

I have an ESP32 and when I try to use an example from ESPHome they error out. Here is examples of what code I am trying to use.

binary_sensor:
  - platform: gpio
    pin:
      number: 34
      mode:
        input: true
        pullup: true
        name: Honda Door 
        fiters:
          - delayse_on: 10ms
output:
  - platform: gpio
    pin: 23
    id: 'heat_loop_pump'
switch:
  - platform: output
    name: "Under Floor Pump"
    output: 'heat_loop_pump'

Can anyone critique this mess. Neither one of those will validate. I got this far trying to decipher the info at ESPHome.
Thanks

It helps if you read the errors in the editor. They tell you what to change.

For the binary sensor you have the name and filters indented incorrectly. You also misspelled delay and filters.

binary_sensor:
  - platform: gpio
    name: Honda Door 
    pin:
      number: 34
      mode:
        input: true
        pullup: true
    filters:
      - delay_on: 10ms

For the switch you can just do this:

switch:
  - platform: gpio
    name: "Under Floor Pump"
    pin: 23

I don’t believe this is valid. Where did you get it from?

I copied it from an example at ESPHome

I caught the spelling error in filters but not delay, it looked close enough to be right to me. I appreciate the help, new to this and haven’t gotten the hang of the indentation.

Ok after some fiddling ( the GPIO I wanted to use wouldn’t allow some settings) I got the switch and the binary sensor to upload into my ESP32. There are no errors

[10:09:51][C][wifi:491]: WiFi:
[10:09:51][C][wifi:353]: Local MAC: EC:94:CB:6D:33:CC
[10:09:51][C][wifi:354]: SSID: [redacted]
[10:09:51][C][wifi:355]: IP Address: 192.168.1.102
[10:09:51][C][wifi:357]: BSSID: [redacted]
[10:09:51][C][wifi:358]: Hostname: ‘homenode1’
[10:09:51][C][wifi:360]: Signal strength: -38 dB ▂▄▆█
[10:09:51][C][wifi:364]: Channel: 11
[10:09:51][C][wifi:365]: Subnet: 255.255.255.0
[10:09:51][C][wifi:366]: Gateway: 192.168.1.1
[10:09:51][C][wifi:367]: DNS1: 1.1.1.1
[10:09:51][C][wifi:368]: DNS2: 8.8.8.8
[10:09:51][C][logger:275]: Logger:
[10:09:51][C][logger:276]: Level: DEBUG
[10:09:51][C][logger:277]: Log Baud Rate: 115200
[10:09:51][C][logger:278]: Hardware UART: UART0
[10:09:51][C][gpio.binary_sensor:015]: GPIO Binary Sensor ‘Honda Door’
[10:09:51][C][gpio.binary_sensor:016]: Pin: GPIO3
[10:09:51][C][switch.gpio:050]: GPIO Switch ‘Under Floor Pump’
[10:09:51][C][switch.gpio:051]: Pin: GPIO23
[10:09:51][C][switch.gpio:073]: Restore Mode: Restore (Defaults to OFF)
[10:09:51][C][captive_portal:088]: Captive Portal:
[10:09:51][C][mdns:094]: mDNS:
[10:09:51][C][mdns:095]: Hostname: homenode1
[10:09:51][C][ota:085]: Over-The-Air Updates:
[10:09:51][C][ota:086]: Address: homenode1.local:3232
[10:09:51][C][api:138]: API Server:
[10:09:51][C][api:139]: Address: homenode1.local:6053
[10:09:51][C][api:143]: Using noise encryption: NO

So now I should be able to see them in a listing of devices or entities right. I read that they should automagically appear. Do I need to add an integration?
Thanks so much for your help guys

Home Assistant should say it is has discovered the device automatically and ask you to configure it, but if it doesn’t - then yes you can add it by going devices in settings, and then add integration and find ESP Home.

When I try to configure a ESPHome integration it asks for the address of the host. I have put in the local IP and also localhost since it is all part of the same PC I get a message to add the api line to YAML, but it is in there

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

ota:


Is ther something else like a path for the api??

Nevermind I am an idiot. I needed to put in the address of the ESP32. It appears to be working now. Now to get more programmed into it and wire up some stuff to it

Each ESPHome device is actually a mini server, and Home Assistant is the client. So rather than the ESPHome devices connecting to Home Assistant, it works the other way around, Home Assistant needs to know the IP address of each device, and will make a connection to each one of them.

1 Like

Thanks, The lights in the old noggin are starting to come on. A little off subject but is there a info/guide for the gpio pin usage? In the esp home site there is some info , I used pins 1,3,13,26,27 for binary input and used this

binary_sensor:
- platform: gpio
  name: Honda Door Contact
  pin:
    number: 3
    mode:
      input: true
      output: false
      open_drain: false
      pullup: false
      pulldown: true
    inverted: false
  disabled_by_default: false
    

- platform: gpio
  name: Other Door Contact
  pin:
    number: 1
    mode:
      input: true
      output: false
      open_drain: false
      pullup: false
      pulldown: true
    inverted: true
  disabled_by_default: false

The honda door is active and the others are not . Which pins can be used for what purposes. I found two different diagrams for the same board . ESP32-WROOM-32D

ESP32 Pinout Reference: Which GPIO pins should you use? | Random Nerd Tutorials is seen as one of the best.

1 Like

Thanks for the link