Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #################################################
- # Brilliant Smart Wall Light Switch YAML Config
- # For ESPHome
- #################################################
- #################################################
- # By Rusti
- # With thanks especially to ssieb
- # and the ESPHome Discord channel!
- #################################################
- substitutions:
- device_name: garage-light-switch
- friendly_name: "Light Switch - Garage"
- #################################################
- esphome:
- name: ${device_name}
- platform: ESP8266
- board: esp01_1m
- # Enable logging
- logger:
- # This is because we're using the Tuya UART
- baud_rate: 0
- # Enable Home Assistant API
- api:
- password: !secret api_password
- ota:
- password: !secret ota_password
- wifi:
- ssid: !secret wifi_ssid
- password: !secret wifi_password
- fast_connect: on
- # This helped with a lot of the mDNS issues I was having and sped up the whole "finding the device" process
- manual_ip:
- # Set this to the IP of the device
- static_ip: 192.168.1.180
- # Set this to the Gateway for the network
- gateway: 192.168.1.254
- # Set this to the subnet for the network
- subnet: 255.255.255.0
- # Enable fallback hotspot (captive portal) in case wifi connection fails
- ap:
- ssid: "${device_name}"
- password: !secret ap_password
- captive_portal:
- uart:
- rx_pin: GPIO3
- tx_pin: GPIO1
- baud_rate: 9600
- # Register the Tuya MCU connection
- tuya:
- sensor:
- - platform: wifi_signal
- name: ${device_name} Wifi Signal Strength
- update_interval: 60s
- - platform: uptime
- name: ${device_name} Uptime
- switch:
- - platform: restart
- name: "${friendly_name} REBOOT"
- # Define the switch we want to control.
- # This works perfectly for a single gang light switch.
- - platform: "tuya"
- name: "${friendly_name}"
- switch_datapoint: 1
- # For Multi gang light switches:
- # - platform: "tuya"
- # name: "${friendly_name} 1"
- # switch_datapoint: 1
- #
- # - platform: "tuya"
- # name: "${friendly_name} 2"
- # switch_datapoint: 2
- #
- # - platform: "tuya"
- # name: "${friendly_name} 3"
- # switch_datapoint: 3
- #
- # - platform: "tuya"
- # name: "${friendly_name} 4"
- # switch_datapoint: 4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement