/
ESPHome-Tuya-Ceiling-Light.yaml
77 lines (65 loc) · 1.53 KB
/
ESPHome-Tuya-Ceiling-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
esphome:
name: ceilinglight
platform: ESP8266
board: esp12e
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
# Create a switch for safe_mode in order to flash the device
# Solution from this thread:
# https://community.home-assistant.io/t/esphome-flashing-over-wifi-does-not-work/357352/1
switch:
- platform: safe_mode
name: "Flash Mode (Safe Mode)"
wifi:
networks:
- ssid: !secret wifi_ssid
password: !secret wifi_password
reboot_timeout: 15min
# manual_ip:
# static_ip: 192.168.1.123
# gateway: 192.168.1.1
# subnet: 255.255.255.0
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Ceiling Light Fallback Hotspot"
password: !secret fallback_ssid_password
captive_portal:
light:
- platform: rgbww
name: "Ceiling Light"
red: red
green: green
blue: blue
cold_white: cold_white
warm_white: warm_white
cold_white_color_temperature: 6500 K
warm_white_color_temperature: 2700 K
restore_mode: ALWAYS_ON
sensor:
- platform: wifi_signal
name: Ceiling Light WiFi Strength
update_interval: 60s
- platform: uptime
name: Ceiling Light Uptime
filters:
- lambda: return x / 60.0;
unit_of_measurement: minutes
output:
- platform: esp8266_pwm
id: red
pin: GPIO15
- platform: esp8266_pwm
id: green
pin: GPIO14
- platform: esp8266_pwm
id: blue
pin: GPIO12
- platform: esp8266_pwm
id: cold_white
pin: GPIO4
- platform: esp8266_pwm
id: warm_white
pin: GPIO13