Noob Needs a Nudge to get started: Migrating from Sonoff Tasmota

Here is how I make a new device in ESPHome.
The yaml code below is for a Sonoff Basic.

  1. On the ESPHome dashboard, click on New Device.
  2. Click on Continue.
  3. Give your device a name. Click on “Next”.
  4. In “Select your device type” just click on “Next”. It doesn’t matter what device you select as you will overwrite that data later.
  5. Ignore the encryption key and click “Skip”. (You can add encryption later if you’re paranoid).
  6. You should now see your device in the ESPHome dashboard. Click on “Edit”.
  7. Delete EVERYTHING and paste the code below.
  8. Change the device name in the pasted code. The name must be exactly the same device name you used earlier.
  9. Change your WiFi credentials.
  10. Click on “Install”
  11. Click on “Manual Download”.
  12. Click on “Legacy Format”
    When it is finished, you will have the .bin file in your downloads folder.
    This .bin file is what you want to flash to the device using a UART dongle.
    Or if your device has Tasmota already running, you can do an OTA upgrade using the .bin file you just made.
substitutions:
  device_name: sonoff_basic

esphome:
  name: ${device_name}
  platform: ESP8266
  board: esp01_1m
  
wifi:
  ssid: myWiFiID
  password: myWiFiPassword

logger:
  level: VERBOSE

api:

ota:
  safe_mode: True
  
web_server:
  port: 80     
  
###############################
# Sonoff Basic peripherals

# Relay on GPIO12  
switch:
  - platform: gpio
    name: ${device_name}
    pin:
      number: 12
      mode: output
    id: ${device_name}_relay

    
# Physical Button on GPIO0
binary_sensor:
  - platform: gpio
    pin: 
      number: 0
      inverted: False
      mode: INPUT_PULLUP
    name: ${device_name} button
    internal: true
    on_press:
      - switch.toggle: ${device_name}_relay    
      
      
# Get the WiFi details
text_sensor:
  - platform: wifi_info
    ip_address:
      name: ${device_name} IP Address
      id: ${device_name}_ip
    ssid:
      name: ${device_name} SSID
    mac_address:
      name: ${device_name} Mac Address
      
sensor:
  - platform: wifi_signal
    name: ${device_name} WiFi Signal Sensor
    id: ${device_name}_WiFi_level
    update_interval: 60s
    
    
#Blink the LED on GPIO13 if there's a problem	
status_led:
  pin:
    number: 13
1 Like