Skip to content
This repository has been archived by the owner before Nov 9, 2022. It is now read-only.
Permalink
7eb19efa29
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
100 lines (83 sloc) 1.82 KB
title date-published type standard
Gosund WP3
2019-10-17
plug
us
  1. TOC {:toc}

GPIO Pinout

Pin Function
GPIO04 Push Button inverted
GPIO12 Red LED
GPIO13 Blue LED
GPIO14 Relay 1

Basic Configuration

---
substitutions:
  device_name: gosund_wp3
  friendly_name: Gosund WP3

esphome:
  name: "${device_name}"
  platform: ESP8266
  board: esp01_1m

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "${device_name} Fallback Hotspot"
    password: !secret wifi_fallback_pw

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:
  password: !secret gosund_1_ota

binary_sensor:
  - platform: gpio
    pin:
      number: GPIO4
      mode: INPUT_PULLUP
      inverted: True
    name: "${friendly_name} Button"
    id: "${device_name}_button"
    on_press:
      - switch.toggle: "${device_name}_relay"
  - platform: status
    name: "${friendly_name} Status"
    id: "${device_name}_status"

switch:
  - platform: gpio
    name: "${friendly_name} Relay"
    id: "${device_name}_relay"
    pin: GPIO14
    on_turn_on:
      - output.turn_on: led
    on_turn_off:
      - output.turn_off: led

status_led:
  pin:
    number: GPIO12
    inverted: yes

output:
  - platform: gpio
    pin: GPIO13
    inverted: true
    id: led

sensor:
  - platform: wifi_signal
    name: "${friendly_name} WiFi signal"
    id: "${device_name}_wifi_signal"
    update_interval: 60s
  - platform: uptime
    name: "${friendly_name} Uptime"
    id: "${device_name}_uptime"
    update_interval: 60s

text_sensor:
  - platform: version
    name: "${friendly_name} ESPHome Version"
    id: "${device_name}_esphome_version"