summaryrefslogtreecommitdiffstats
path: root/esphome/config/tvlight.yaml
blob: 19e8c1c1f30f8ff463bae3e88d65d0c107a27f7e (plain)
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
substitutions:
  device_name: tvlight
  friendly_name: "TV Light"

esphome:
  name: ${device_name}
  friendly_name: ${friendly_name}

esp8266:
  board: d1_mini

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: !secret api_encryption_key

# OTA
ota:
  - platform: esphome
    password: !secret ota_password

# WiFi Credentials
wifi:
  domain: .lan
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  # see https://github.com/esphome/issues/issues/1532
  power_save_mode: HIGH

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "${device_name} Fallback Hotspot"
    password: !secret wifi_ap_password

captive_portal:

light:
  - platform: monochromatic
    name: "TV"
    output: dimmer_tvlight
    default_transition_length: 1.5s
    gamma_correct: 0
    restore_mode: RESTORE_AND_OFF

  - platform: binary
    name: "WLED"
    icon: "mdi:led-strip-variant"
    output: relay_wled
    restore_mode: ALWAYS_OFF

output:
  - platform: esp8266_pwm
    id: dimmer_tvlight
    pin: D5 # GPIO14
    frequency: 1000 Hz
    inverted: true
    # lower 22% are not useable. use max_power because of inverted
    max_power: 0.78
    power_supply: relay_tvlight

  - platform: gpio
    id: relay_wled
    pin: D1 # GPIO5

  - platform: gpio
    id: unused_gpio0
    pin:
      number: D3 # GPIO0
      mode: INPUT_PULLUP
  - platform: gpio
    id: unused_gpio1
    pin:
      number: TX # GPIO1
      mode: INPUT_PULLUP
  - platform: gpio
    id: unused_gpio2
    pin:
      number: D4 # GPIO2
      mode: INPUT_PULLUP
  - platform: gpio
    id: unused_gpio3
    pin:
      number: RX # GPIO3
      mode: INPUT_PULLUP
  - platform: gpio
    id: unused_gpio12
    pin:
      number: D6 # GPIO12
      mode: INPUT_PULLUP
  - platform: gpio
    id: unused_gpio13
    pin:
      number: D7 # GPIO13
      mode: INPUT_PULLUP
  - platform: gpio
    id: unused_gpio15
    pin:
      number: D8 # GPIO15
      mode: INPUT_PULLUP
  - platform: gpio
    id: unused_gpio16
    pin:
      number: D0 # GPIO16
      mode: INPUT_PULLDOWN

power_supply:
  - id: relay_tvlight
    pin: D2 # GPIO4
    #enable_time: 3s
    keep_on_time: 20ms