ScymnusRIP

Sonoff relay

Feb 7th, 2022
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.40 KB | None | 0 0
  1. esphome:
  2.   name: soonoff02
  3.   platform: ESP8266
  4.   board: esp01_1m
  5.  
  6. # Enable logging
  7. logger:
  8. # Enable Home Assistant API
  9. api:
  10. ota:
  11.   password: "6e6215be434b2d03621aef59f6fd2ebb"
  12.  
  13. wifi:
  14.   ssid: !secret wifi_ssid
  15.   password: !secret wifi_password
  16.  
  17.  
  18.   # Enable fallback hotspot (captive portal) in case wifi connection fails
  19.   ap:
  20.     ssid: "Soonoff02 Fallback Hotspot"
  21.     password: "kVhKFGkUKhag"
  22.  
  23. captive_portal:
  24. binary_sensor:
  25.   - platform: gpio
  26.     pin:
  27.       number: GPIO0
  28.       mode: INPUT_PULLUP
  29.       inverted: True
  30.     name: "Sonoff02 Basic Button"
  31.     on_press:
  32.       - switch.toggle: fakebutton
  33.  
  34. switch:
  35.   - platform: template
  36.     name: "Sonoff02 Basic Relay"
  37.     optimistic: true
  38.     id: fakebutton
  39.     turn_on_action:
  40.     - switch.turn_on: relay
  41.     - light.turn_off: led
  42.     turn_off_action:
  43.     - switch.turn_off: relay
  44.     - light.turn_on: led
  45.   - platform: gpio
  46.     id: relay
  47.     pin: GPIO12
  48.  
  49. output:
  50.   - platform: esp8266_pwm
  51.     id: basic_blue_led
  52.     pin:
  53.       number: GPIO13
  54.       inverted: True
  55.  
  56. light:
  57.   - platform: monochromatic
  58.     name: "Sonoff02 Basic Blue LED"
  59.     output: basic_blue_led
  60.     id: led
  61.  
  62. sensor:
  63.   - platform: wifi_signal
  64.     name: "Sonoff02 Basic WiFi Signal"
  65.     update_interval: 60s
  66.   - platform: uptime
  67.     name: "Sonoff02 Basic Uptime"
  68.  
  69. text_sensor:
  70.   - platform: version
  71.     name: "Sonoff02 Basic ESPHome Version"
Advertisement
Add Comment
Please, Sign In to add comment