Advertisement
Rus_Ti

YAML Config for ESPHome for Brilliant Smart WiFi wall light switches

Oct 21st, 2021
855
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #################################################
  2. # Brilliant Smart Wall Light Switch YAML Config
  3. # For ESPHome
  4. #################################################
  5.  
  6. #################################################
  7. # By Rusti
  8. # With thanks especially to ssieb
  9. # and the ESPHome Discord channel!
  10. #################################################
  11.  
  12. substitutions:
  13.   device_name: garage-light-switch
  14.   friendly_name: "Light Switch - Garage"
  15. #################################################
  16. esphome:
  17.   name: ${device_name}
  18.   platform: ESP8266
  19.   board: esp01_1m
  20.  
  21. # Enable logging
  22. logger:
  23.  # This is because we're using the Tuya UART
  24.   baud_rate: 0
  25.  
  26. # Enable Home Assistant API
  27. api:
  28.   password: !secret api_password
  29.  
  30. ota:
  31.   password: !secret ota_password
  32.  
  33. wifi:
  34.   ssid: !secret wifi_ssid
  35.   password: !secret wifi_password
  36.   fast_connect: on
  37.   # This helped with a lot of the mDNS issues I was having and sped up the whole "finding the device" process
  38.   manual_ip:
  39.    # Set this to the IP of the device
  40.     static_ip: 192.168.1.180
  41.     # Set this to the Gateway for the network
  42.     gateway: 192.168.1.254
  43.     # Set this to the subnet for the network
  44.     subnet: 255.255.255.0
  45.  
  46.   # Enable fallback hotspot (captive portal) in case wifi connection fails
  47.   ap:
  48.     ssid: "${device_name}"
  49.     password: !secret ap_password
  50.  
  51. captive_portal:
  52. uart:
  53.   rx_pin: GPIO3
  54.   tx_pin: GPIO1
  55.   baud_rate: 9600
  56.  
  57. # Register the Tuya MCU connection
  58. tuya:
  59. sensor:
  60.   - platform: wifi_signal
  61.     name: ${device_name} Wifi Signal Strength
  62.     update_interval: 60s
  63.   - platform: uptime
  64.     name: ${device_name} Uptime
  65.  
  66. switch:
  67.   - platform: restart
  68.     name: "${friendly_name} REBOOT"
  69.  
  70. # Define the switch we want to control.
  71. # This works perfectly for a single gang light switch.
  72.   - platform: "tuya"
  73.     name: "${friendly_name}"
  74.     switch_datapoint: 1
  75.  
  76. # For Multi  gang light switches:
  77. #  - platform: "tuya"
  78. #    name: "${friendly_name} 1"
  79. #    switch_datapoint: 1
  80. #
  81. #  - platform: "tuya"
  82. #    name: "${friendly_name} 2"
  83. #    switch_datapoint: 2
  84. #
  85. #  - platform: "tuya"
  86. #    name: "${friendly_name} 3"
  87. #    switch_datapoint: 3
  88. #
  89. #  - platform: "tuya"
  90. #    name: "${friendly_name} 4"
  91. #    switch_datapoint: 4
  92.  
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement