From 9cab8bf69271735243e593c318c3b288860fd4d6 Mon Sep 17 00:00:00 2001 From: manuel Date: Wed, 10 Nov 2021 10:07:19 +0100 Subject: add esphome stuff --- esphome/config/couchlight.yaml | 76 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 esphome/config/couchlight.yaml (limited to 'esphome/config/couchlight.yaml') diff --git a/esphome/config/couchlight.yaml b/esphome/config/couchlight.yaml new file mode 100644 index 0000000..08affc1 --- /dev/null +++ b/esphome/config/couchlight.yaml @@ -0,0 +1,76 @@ +esphome: + name: couchlight + platform: ESP8266 + board: d1_mini + +# Enable logging +logger: + +# Enable Home Assistant API +api: + password: !secret api_password + +# OTA +ota: + password: !secret ota_password + +# WiFi Credentials +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password + + # Enable fallback hotspot (captive portal) in case wifi connection fails + ap: + ssid: "Couchlight Fallback Hotspot" + password: !secret wifi_ap_password + +captive_portal: + +light: + - id: light1 + platform: binary + name: "Couch 1" + output: relay_light1 + + - id: light2 + platform: binary + name: "Couch 2" + output: relay_light2 + +output: + - id: relay_light1 + platform: gpio + pin: D1 + + - id: relay_light2 + platform: gpio + pin: D2 + +binary_sensor: + - id: button_light1 + name: "Couch 1 PushButton" + platform: gpio + pin: + number: D5 + mode: INPUT_PULLUP + filters: + - invert + - delayed_on: 50ms + on_press: + then: + - light.toggle: light1 + internal: true # hide from UI + + - id: button_light2 + name: "Couch 2 PushButton" + platform: gpio + pin: + number: D6 + mode: INPUT_PULLUP + filters: + - invert + - delayed_on: 50ms + on_press: + then: + - light.toggle: light2 + internal: true # hide from UI -- cgit v1.2.3