devices.esphome.io

Teckin SP10

Teckin SP10

Device Type: plug
Electrical Standard: us
Board: esp8266

GPIO Pinout

PinFunction
GPIO0Status LED
GPIO2Blue LED
GPIO13Push Button (HIGH = off, LOW = on)
GPIO15Relay

Basic Configuration

# Basic Config
---
esphome:
name: SP10
platform: ESP8266
board: esp01_1m
restore_from_flash: true
# OTA flashing
ota:
- platform: esphome
wifi: # Your Wifi network details
# Enable fallback hotspot in case wifi connection fails
ap:
# Enabling the logging component
logger:
# Enable Home Assistant API
api:
# Enable the captive portal
captive_portal:
# Enable the Web Server component
webserver:
time:
- platform: homeassistant
# https://esphome.io/components/time
id: homeassistant_time
status_led:
# https://esphome.io/components/status_led
pin:
number: GPIO0
inverted: True
output:
# https://esphome.io/components/output/esp8266_pwm.html
- platform: esp8266_pwm
id: blue_led_output
pin:
number: GPIO2
inverted: True
light:
# https://esphome.io/components/light/monochromatic.html
- platform: monochromatic
name: SP10 Blue LED
output: blue_led_output
id: blue_led
default_transition_length: 1ms # default 1s
internal: True
sensor:
- platform: uptime
name: SP10 Uptime
binary_sensor:
- platform: gpio
# https://esphome.io/components/binary_sensor/gpio.html
pin:
number: GPIO13
id: button
name: SP10 Button
on_press:
- switch.toggle: relay_template
internal: True
switch:
- platform: gpio
# https://esphome.io/components/switch/gpio
pin: GPIO15
id: relay
# tie the led & relay operation together and report status based on relay state
- platform: template
# https://esphome.io/components/switch/template.html
name: SP10
id: relay_template
lambda: |-
if (id(relay).state) {
return true;
} else {
return false;
}
turn_on_action:
- light.turn_on: blue_led
- switch.turn_on: relay
turn_off_action:
- light.turn_off: blue_led
- switch.turn_off: relay
Edit this page on GitHub