devices.esphome.io
Teckin SP10
Teckin SP10
Device Type: plugElectrical Standard: usBoard: esp8266
GPIO Pinout
| Pin | Function |
|---|---|
| GPIO0 | Status LED |
| GPIO2 | Blue LED |
| GPIO13 | Push Button (HIGH = off, LOW = on) |
| GPIO15 | Relay |
Basic Configuration
# Basic Config---esphome: name: SP10 platform: ESP8266 board: esp01_1m restore_from_flash: true # OTA flashingota: - platform: esphome
wifi: # Your Wifi network details # Enable fallback hotspot in case wifi connection fails ap:
# Enabling the logging componentlogger:
# Enable Home Assistant APIapi:
# Enable the captive portalcaptive_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