-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTuya-Light.yaml
81 lines (70 loc) · 2.34 KB
/
Tuya-Light.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# This is a script for a Tuya based RGBW bulb. The one I am using in particular
# is this one: https://amzn.to/2O6He9I (Amazon affiliate link) but should work
# with most any RGBW bulbs using an ESP8266 design. This will turn the light on
# automatically on power on and is set by default to do so with white on 100% but
# can be adjusted as you see fit by changing the output settings listed between
# lines 23 and 29. In this fashion the light will act similar to a normal bulb
# when turned on, however it will not know the difference between a turn on and a
# power outage so you may want to lower the brightness if used in a bedroom or use
# Home Assistant to turn a bulb on automatically when it connects but only outside
# of when you will be sleeping.
# If you found this helpful please consider a donation through Amazon (it doesn't cost you a dime)
# just go here https://amzn.to/2v74aiY (Amazon affiliate link) before you make an order.
substitutions:
devicename: devicename # Edit this device name, lowercase only.
esphome:
name: $devicename
platform: ESP8266
board: esp01_1m
on_boot:
priority: -100.0
then:
- light.turn_on:
id: $devicename
brightness: 100%
red: 0%
green: 0%
blue: 0%
white: 100%
wifi:
ssid: "Your-WiFi-SSID" # This is your desired network SSID
password: "Your-WiFi-Password" # This is your network password
manual_ip: # Set a manual IP address that will work with your network here.
static_ip: 192.168.1.11
gateway: 192.168.1.1
subnet: 255.255.255.0
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "$devicename Hotspot"
password: "Fallback-Pass" # Edit this password.
# Enable logging to ESPHome
logger:
# Disable logging to serial
baud_rate: 0
# Enable Home Assistant API
api:
# Setup OTA password
ota:
# Define output pins
output:
- platform: esp8266_pwm
id: output_red
pin: GPIO4
- platform: esp8266_pwm
id: output_green
pin: GPIO12
- platform: esp8266_pwm
id: output_blue
pin: GPIO14
- platform: esp8266_pwm
id: output_white
pin: GPIO5
# Define a light entity
light:
- platform: rgbw
name: $devicename
id: $devicename
red: output_red
green: output_green
blue: output_blue
white: output_white