Rus_Ti

Brilliant Smart YAML config for ESPHome/Home Assistant

Oct 21st, 2021 (edited)
319
140 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. substitutions:
  2.   device_name: garage-light-switch
  3.   friendly_name: "Light Switch - Garage"
  4.  
  5. #################################################
  6.  
  7. esphome:
  8.   name: ${device_name}
  9.   platform: ESP8266
  10.   board: esp01_1m
  11.  
  12. # Enable logging
  13. logger:
  14. # Enable Home Assistant API
  15. api:
  16.   password: !secret garage_api_password
  17.  
  18. ota:
  19.   password: !secret garage_ota_password
  20.  
  21. wifi:
  22.   ssid: !secret wifi_ssid
  23.   password: !secret wifi_password
  24.   fast_connect: on
  25.  
  26.   # Enable fallback hotspot (captive portal) in case wifi connection fails
  27.   ap:
  28.     ssid: "${device_name}"
  29.     password: !secret ap_password
  30.  
  31. captive_portal:
  32. #################################
  33. These sensors work
  34. #################################
  35.  
  36. sensor:
  37.   - platform: wifi_signal
  38.     name: ${device_name} Wifi Signal Strength
  39.     update_interval: 60s
  40.   - platform: uptime
  41.     name: ${device_name} Uptime
  42.  
  43. #################################
  44. Nothing below here works....
  45. #################################
  46.  
  47. binary_sensor:
  48.   - platform: gpio
  49.     pin:
  50.       number: 14
  51.       mode: INPUT_PULLUP
  52.       inverted: true
  53.     name: "Power Button"
  54.     on_press:
  55.       - switch.toggle: relay
  56.  
  57.   - platform: status
  58.     name: "Status"
  59.  
  60. switch:
  61.   - platform: gpio
  62.     id: red_led
  63.     pin:
  64.       number: GPIO12
  65.       inverted: true
  66.  
  67.   - platform: gpio
  68.     name: "Brilliant Smart Plug"
  69.     pin: GPIO5
  70.     id: relay
  71.  
  72.     # Turn off red LED to show blue when turned on
  73.     on_turn_on:
  74.       - switch.turn_off: red_led
  75.  
  76.     # Turns on the red LED once the plug is turned off. Stock plug doesn't do this, to restore normal behavior remove the on_turn_on and on_turn_off
  77.     # blocks.
  78.     on_turn_off:
  79.       - switch.turn_on: red_led
RAW Paste Data