Installing/using ESPHome

Major change to this post: I believe that I finally got ESPHome installed and working, but… When I go to the Home Assistant web page → Configuration → Device & Services, I see the device I just installed. However, under the Device tab in the Controls box, it says ‘The device has no entities’ and I am unable to manually turn the device on/off. Now what?

Impossible to say without your yaml

mickrout - thanks - but, what should I do? More specifically, which yaml file? There is a ‘basic’ configuration.yaml file, I also see a few others, including scripts.yaml, secrets.yaml, and esphome/<dev_name>.yaml. To add to the fun, this page Getting Started with ESPHome and Home Assistant — ESPHome suggests creating a yaml for the location.

In my case, since I am just trying this stuff out, the device is named is newswitch and it is in a location named test.

The yaml file you used to program the esp.

From the local website, I went to ESPHome, saw the box for the device, and clicked Edit. I then entered the following information, most of which I found here: Using With Sonoff S20 — ESPHome. This updated the file /config/esphome/newswitch.yaml. I then restarted HomeAssistant, but I still cannot control the device.

name: newswitch
board: sonoff_s20

password: <random string>

ssid: <SSID name>
password: <SSID password>


- platform: gpio
number: GPIO0
input: true
pullup: true
inverted: true
name: "Sonoff S20 Button"
- platform: status
name: "Sonoff S20 Status"
- platform: gpio
pin: GPIO2
name: "Sonoff S20 Sensor"

- platform: gpio
name: "Sonoff S20 Relay"
pin: GPIO12

- platform: esp8266_pwm
id: s20_green_led
number: GPIO13
inverted: true

- platform: monochromatic
name: "Sonoff S20 Green LED"
output: s20_green_led

Please read this How to help us help you - or How to ask a good question and post your code properly (it is point 11, but read the whole thing anyway!)

I should also have asked you to post the logs that you get from esphome, so please do that too.

I read the post and put three back-ticks around the code, but the coloring I am seeing is different from that on the page you referenced…

I went to ESPhome (at around 22:18) and clicked logs under the device name:

INFO Reading configuration /config/esphome/newswitch.yaml…
INFO Starting log output from newswitch.local using esphome API
INFO Successfully connected to newswitch.local
[22:18:49][I][app:102]: ESPHome version 2022.2.5 compiled on Feb 27 2022, 12:38:13
[22:18:49][C][wifi:491]: WiFi:
[22:18:49][C][wifi:353]: Local MAC: 68:C6:3A:94:EC:1B
[22:18:49][C][wifi:354]: SSID: ‘POD_SydneyCont’[redacted]
[22:18:49][C][wifi:355]: IP Address:
[22:18:49][C][wifi:356]: BSSID: AC:86:74:A2:E0:85[redacted]
[22:18:49][C][wifi:358]: Hostname: ‘newswitch’
[22:18:49][C][wifi:360]: Signal strength: -60 dB ▂▄▆█
[22:18:49][C][wifi:364]: Channel: 6
[22:18:49][C][wifi:365]: Subnet:
[22:18:49][C][wifi:366]: Gateway:
[22:18:49][C][wifi:367]: DNS1:
[22:18:49][C][wifi:368]: DNS2:
[22:18:49][C][logger:233]: Logger:
[22:18:49][C][logger:234]: Level: DEBUG
[22:18:49][C][logger:235]: Log Baud Rate: 115200
[22:18:49][C][logger:236]: Hardware UART: UART0
[22:18:49][C][captive_portal:144]: Captive Portal:
[22:18:49][C][mdns:084]: mDNS:
[22:18:49][C][mdns:085]: Hostname: newswitch
[22:18:49][C][ota:085]: Over-The-Air Updates:
[22:18:49][C][ota:086]: Address: newswitch.local:8266
[22:18:49][C][ota:089]: Using Password.
[22:18:49][C][api:138]: API Server:
[22:18:49][C][api:139]: Address: newswitch.local:6053
[22:18:49][C][api:143]: Using noise encryption: NO

Have you changed the yaml for your ESPHome device and not clicked INSTALL? Because that looks from your log just like the default install without any switches or sensors.

Go back into the ESPHome page - Edit your device, then click INSTALL and see if a) it works and b) you get any errors trying to install.

It has not entities because you havent exposed your single binary_sensor to Home Assistante.

If you give it a name you should then be able to see it.

- platform: gpio
  number: GPIO0
  name: "my_first_bianry_sensor"
  input: true
  pullup: true
  inverted: true

zoogara - I think you figured it out! I greatly simplified the yaml file, clicked install, etc. and the switch now works. Now, I will start putting stuff back into the yaml and hopefully it keeps working.

I thought it went without saying that you have to compile a new firmware and upload it to the esp when you change the yaml, but there you go, perhaps it ain’t so obvious. :slight_smile: