diff options
Diffstat (limited to 'esphome/config/couchlight.yaml')
| -rw-r--r-- | esphome/config/couchlight.yaml | 90 |
1 files changed, 66 insertions, 24 deletions
diff --git a/esphome/config/couchlight.yaml b/esphome/config/couchlight.yaml index cfc2f00..4579dc9 100644 --- a/esphome/config/couchlight.yaml +++ b/esphome/config/couchlight.yaml | |||
| @@ -1,5 +1,10 @@ | |||
| 1 | substitutions: | ||
| 2 | device_name: couchlight | ||
| 3 | friendly_name: "Couch Light" | ||
| 4 | |||
| 1 | esphome: | 5 | esphome: |
| 2 | name: couchlight | 6 | name: ${device_name} |
| 7 | friendly_name: ${friendly_name} | ||
| 3 | on_boot: | 8 | on_boot: |
| 4 | then: | 9 | then: |
| 5 | - lock.template.publish: | 10 | - lock.template.publish: |
| @@ -32,30 +37,67 @@ wifi: | |||
| 32 | 37 | ||
| 33 | # Enable fallback hotspot (captive portal) in case wifi connection fails | 38 | # Enable fallback hotspot (captive portal) in case wifi connection fails |
| 34 | ap: | 39 | ap: |
| 35 | ssid: "Couchlight Fallback Hotspot" | 40 | ssid: "${device_name} Fallback Hotspot" |
| 36 | password: !secret wifi_ap_password | 41 | password: !secret wifi_ap_password |
| 37 | 42 | ||
| 38 | captive_portal: | 43 | captive_portal: |
| 39 | 44 | ||
| 40 | light: | 45 | light: |
| 41 | - id: light1 | 46 | - platform: binary |
| 42 | platform: binary | 47 | id: light1 |
| 43 | name: "Couch 1" | 48 | name: "Spot 1" |
| 44 | output: relay_light1 | 49 | output: relay_light1 |
| 45 | 50 | ||
| 46 | - id: light2 | 51 | - platform: binary |
| 47 | platform: binary | 52 | id: light2 |
| 48 | name: "Couch 2" | 53 | name: "Spot 2" |
| 49 | output: relay_light2 | 54 | output: relay_light2 |
| 50 | 55 | ||
| 51 | output: | 56 | output: |
| 52 | - id: relay_light1 | 57 | - platform: gpio |
| 53 | platform: gpio | 58 | id: relay_light1 |
| 54 | pin: D1 | 59 | pin: D1 # GPIO5 |
| 60 | |||
| 61 | - platform: gpio | ||
| 62 | id: relay_light2 | ||
| 63 | pin: D2 # GPIO4 | ||
| 55 | 64 | ||
| 56 | - id: relay_light2 | 65 | # UNUSED GPIO |
| 57 | platform: gpio | 66 | - platform: gpio |
| 58 | pin: D2 | 67 | id: unused_gpio0 |
| 68 | pin: | ||
| 69 | number: D3 # GPIO0 | ||
| 70 | mode: INPUT_PULLUP | ||
| 71 | - platform: gpio | ||
| 72 | id: unused_gpio1 | ||
| 73 | pin: | ||
| 74 | number: TX # GPIO1 | ||
| 75 | mode: INPUT_PULLUP | ||
| 76 | - platform: gpio | ||
| 77 | id: unused_gpio2 | ||
| 78 | pin: | ||
| 79 | number: D4 # GPIO2 | ||
| 80 | mode: INPUT_PULLUP | ||
| 81 | - platform: gpio | ||
| 82 | id: unused_gpio3 | ||
| 83 | pin: | ||
| 84 | number: RX # GPIO3 | ||
| 85 | mode: INPUT_PULLUP | ||
| 86 | - platform: gpio | ||
| 87 | id: unused_gpio14 | ||
| 88 | pin: | ||
| 89 | number: D5 # GPIO14 | ||
| 90 | mode: INPUT_PULLUP | ||
| 91 | - platform: gpio | ||
| 92 | id: unused_gpio15 | ||
| 93 | pin: | ||
| 94 | number: D8 # GPIO15 | ||
| 95 | mode: INPUT_PULLUP | ||
| 96 | - platform: gpio | ||
| 97 | id: unused_gpio16 | ||
| 98 | pin: | ||
| 99 | number: D0 # GPIO16 | ||
| 100 | mode: INPUT_PULLDOWN | ||
| 59 | 101 | ||
| 60 | script: | 102 | script: |
| 61 | - id: reset_child_lock | 103 | - id: reset_child_lock |
| @@ -67,11 +109,11 @@ script: | |||
| 67 | state: UNLOCKED | 109 | state: UNLOCKED |
| 68 | 110 | ||
| 69 | binary_sensor: | 111 | binary_sensor: |
| 70 | - id: button_light1 | 112 | - platform: gpio |
| 71 | name: "Couch 1 PushButton" | 113 | id: button_light1 |
| 72 | platform: gpio | 114 | name: "Spot 1 PushButton" |
| 73 | pin: | 115 | pin: |
| 74 | number: D7 | 116 | number: D7 # GPIO13 |
| 75 | mode: INPUT_PULLUP | 117 | mode: INPUT_PULLUP |
| 76 | filters: | 118 | filters: |
| 77 | - invert | 119 | - invert |
| @@ -85,11 +127,11 @@ binary_sensor: | |||
| 85 | - light.toggle: light1 | 127 | - light.toggle: light1 |
| 86 | internal: true # hide from UI | 128 | internal: true # hide from UI |
| 87 | 129 | ||
| 88 | - id: button_light2 | 130 | - platform: gpio |
| 89 | name: "Couch 2 PushButton" | 131 | id: button_light2 |
| 90 | platform: gpio | 132 | name: "Spot 2 PushButton" |
| 91 | pin: | 133 | pin: |
| 92 | number: D6 | 134 | number: D6 # GPIO12 |
| 93 | mode: INPUT_PULLUP | 135 | mode: INPUT_PULLUP |
| 94 | filters: | 136 | filters: |
| 95 | - invert | 137 | - invert |
| @@ -104,8 +146,8 @@ binary_sensor: | |||
| 104 | internal: true # hide from UI | 146 | internal: true # hide from UI |
| 105 | 147 | ||
| 106 | lock: | 148 | lock: |
| 107 | - id: child_lock | 149 | - platform: template |
| 108 | platform: template | 150 | id: child_lock |
| 109 | name: "Child Lock" | 151 | name: "Child Lock" |
| 110 | optimistic: true | 152 | optimistic: true |
| 111 | on_lock: | 153 | on_lock: |
