LoraTap SC400W-EU Curtain Switch Configuration for ESPHOME

Hello,

I’m looking to convert my LoraTap SC400W_EU from tasmota to ESPHOME.
Here is the TASMOTA template :

Can you help to convert the tasmota template ? I wan’t to be sure I will broke anything. Thanks :slight_smile:

I think I can make this on ESPHOME :

substitutions:
    device_name: volet-salle-de-bain
    name: "Volet Salle de Bain"

esphome:
  name: "${device_name}"

esp8266:
  board: esp01_1m

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:
  password: "***"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "${name}"
    password: "***"

captive_portal:

web_server:
  port: 80
  auth:
    username: !secret web_server_username
    password: !secret web_server_password

# Tasmota
# https://templates.blakadder.com/loratap_SC400W.html

output:
  - platform: gpio
    id: output_led
    pin: 
      number: GPIO0
      mode: OUTPUT

switch:
  - platform: restart
    name: "${name} Restart"
    
  - platform: gpio
    pin: GPIO15
    interlock: &interlock [open_cover, close_cover]
    id: open_cover
    restore_mode: RESTORE_DEFAULT_OFF
    interlock_wait_time: 200ms
    
  - platform: gpio
    pin: GPIO13
    interlock: *interlock
    id: close_cover
    restore_mode: RESTORE_DEFAULT_OFF
    interlock_wait_time: 200ms

cover:
- platform: time_based
  name: "${name}"
  id: my_cover
  open_action:
    - switch.turn_on: open_cover
  open_duration: 60s
  close_action:
    - switch.turn_on: close_cover
  close_duration: 60s
  stop_action:
    - switch.turn_off: open_cover
    - switch.turn_off: close_cover

binary_sensor:
  - platform: gpio
    name: "${name} UP"
    id: up
    pin:
      number: GPIO5
      mode: INPUT_PULLUP
    on_press:
      then:
        cover.open: my_cover

  - platform: gpio
    name: "${name} DOWN"
    id: down
    pin:
      number: GPIO12
      mode: INPUT_PULLUP
    on_press:
      then:
        cover.close: my_cover
      
  - platform: gpio
    name: "${name} STOP"
    id: stop
    pin:
      number: GPIO3
      mode: INPUT_PULLUP
    on_press:
      then:
        cover.stop: my_cover

sensor:
  - platform: wifi_signal
    name: "${name} WiFi Signal"
    update_interval: 60s
1 Like

Hi,

Thank you for sharing this template!

I confirm that it works well. I have had it running for weeks on one switch. Now I also flashed it on my second switch. I’ve just added the status led and restore from flash to my config: MySmartHome/loratap-sc400w.yaml at ca8855742ba8323a9ea34cea7a23310b728a9f82 · Beetix/MySmartHome · GitHub

1 Like