Need help converting Sonoff from tasmota to ESPhome

Hello Team,

I need help converting Sonoff from Tasmota to ESPhome.
I have successfully run tasmotized devices in HA, but I want to get to know the flavor of ESPhome. That’s why I flashed a sonoff basic, equipped with a Dallas DS18B20, to ESPhome using the ESPhome integration.
During integration, the device appears online indicated by a green bar in ESPhome. When opening the logbook I see the address of the sensor, the temperature, when toggling the button the log shows and the relay is indeed switching.

But I don’t see the device appear in the device list of the configuration and therefore the associated entities. What am I missing?

Thanks in advance, Yann

Maybe you can post your configuration you made in esphome for the device , so we can see if s.th is missing?

Best regards

Thank you, R100gs
Of course, how stupid of me :frowning:
Yann

esphome:
  name: esphome92
  platform: ESP8266
  board: esp01_1m

wifi:
  ssid: !secret esphome_wifi_ssid
  password: !secret esphome_wifi_pass
  domain: .lan

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

captive_portal:

# Enable logging
logger:

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

ota:
  password: !secret ota_password
  
dallas:
  - pin: 14
  
# Individual sensors
sensor:
  - platform: dallas
    index: 0
#    address: 0x1c0000031edd2a28
    name: "esphome92 Temperature"
    
binary_sensor:
  - platform: gpio
    pin:
      number: GPIO0
      mode: INPUT_PULLUP
      inverted: True
    name: "Sonoff Basic Button"
    on_press:
      - switch.toggle: relay

switch:
  - platform: gpio
    name: "Sonoff Basic Relay"
    pin: GPIO12
    id: relay

status_led:
  pin:
    number: GPIO13
    inverted: yes

And the logfile of the device contains

INFO Reading configuration /config/esphome/esphome92.yaml...
INFO Starting log output from esphome92.lan using esphome API
INFO Connecting to esphome92.lan:6053 (192.168.178.92)
WARNING Initial connection failed. The ESP might not be connected to WiFi yet (Error connecting to 192.168.178.92: timed out). Re-Trying in 1 seconds
INFO Connecting to esphome92.lan:6053 (192.168.178.92)
INFO Successfully connected to esphome92.lan
[21:35:03][I][app:105]: ESPHome version 1.16.2 compiled on Apr 22 2021, 21:45:57
[21:35:03][C][status_led:019]: Status LED:
[21:35:03][C][status_led:020]:   Pin: GPIO13 (Mode: OUTPUT, INVERTED)
[21:35:03][C][wifi:443]: WiFi:
[21:35:03][C][wifi:303]:   SSID: 

[redacted]
[21:35:03][C][wifi:304]:   IP Address: 192.168.178.92
[21:35:03][C][wifi:306]:   BSSID: 

[redacted]
[21:35:03][C][wifi:307]:   Hostname: 'esphome92'
[21:35:03][C][wifi:311]:   Signal strength: -50 dB ▂▄▆█
[21:35:03][C][wifi:315]:   Channel: 8
[21:35:03][C][wifi:316]:   Subnet: 255.255.255.0
[21:35:03][C][wifi:317]:   Gateway: 192.168.178.1
[21:35:03][C][wifi:318]:   DNS1: 192.168.178.60
[21:35:03][C][wifi:319]:   DNS2: (IP unset)
[21:35:03][C][gpio.binary_sensor:015]: GPIO Binary Sensor 'Sonoff Basic Button'
[21:35:03][C][gpio.binary_sensor:016]:   Pin: GPIO0 (Mode: INPUT_PULLUP, INVERTED)
[21:35:03][C][switch.gpio:042]: GPIO Switch 'Sonoff Basic Relay'
[21:35:03][C][switch.gpio:043]:   Pin: GPIO12 (Mode: OUTPUT)
[21:35:03][C][switch.gpio:059]:   Restore Mode: Restore (Defaults to OFF)
[21:35:03][C][logger:185]: Logger:
[21:35:03][C][logger:186]:   Level: DEBUG
[21:35:03][C][logger:187]:   Log Baud Rate: 115200
[21:35:03][C][logger:188]:   Hardware UART: UART0
[21:35:04][C][dallas.sensor:072]: DallasComponent:
[21:35:04][C][dallas.sensor:073]:   Pin: GPIO14 (Mode: INPUT)
[21:35:04][C][dallas.sensor:074]:   Update Interval: 60.0s
[21:35:04][D][dallas.sensor:079]:   Found sensors:
[21:35:04][D][dallas.sensor:082]:     0xD20114330C912828
[21:35:04][C][dallas.sensor:087]:   Device 'esphome92 Temperature'
[21:35:04][C][dallas.sensor:087]:     Unit of Measurement: '°C'
[21:35:04][C][dallas.sensor:087]:     Accuracy Decimals: 1
[21:35:04][C][dallas.sensor:087]:     Icon: 'mdi:thermometer'
[21:35:04][C][dallas.sensor:089]:     Index 0
[21:35:04][C][dallas.sensor:095]:     Address: 0xD20114330C912828
[21:35:04][C][dallas.sensor:096]:     Resolution: 12
[21:35:04][C][captive_portal:169]: Captive Portal:
[21:35:04][C][ota:029]: Over-The-Air Updates:
[21:35:04][C][ota:030]:   Address: esphome92.lan:8266
[21:35:04][C][ota:032]:   Using Password.
[21:35:04][C][api:095]: API Server:
[21:35:04][C][api:096]:   Address: esphome92.lan:6053
[21:35:26][D][binary_sensor:036]: 'Sonoff Basic Button': Sending state ON
[21:35:26][D][switch:029]: 'Sonoff Basic Relay' Toggling ON.
[21:35:26][D][switch:045]: 'Sonoff Basic Relay': Sending state ON
[21:35:27][D][binary_sensor:036]: 'Sonoff Basic Button': Sending state OFF
[21:35:28][D][binary_sensor:036]: 'Sonoff Basic Button': Sending state ON
[21:35:28][D][switch:029]: 'Sonoff Basic Relay' Toggling OFF.
[21:35:28][D][switch:045]: 'Sonoff Basic Relay': Sending state OFF
[21:35:28][D][binary_sensor:036]: 'Sonoff Basic Button': Sending state OFF
[21:35:29][D][binary_sensor:036]: 'Sonoff Basic Button': Sending state ON
[21:35:29][D][switch:029]: 'Sonoff Basic Relay' Toggling ON.
[21:35:29][D][switch:045]: 'Sonoff Basic Relay': Sending state ON
[21:35:29][D][binary_sensor:036]: 'Sonoff Basic Button': Sending state OFF

A weird observation: As soon as I stop using the “log” from the device in the ESPhome integration, the build-in LED of the sonoff basic starts blinking with a ~ 1Hz frequency.

I figured it out, the config.yaml missed this statement:

packages: !include_dir_named ./integrations/

I have limited knowledge what this statement does, but I guess that is why HA has such a steep learning curve.