From 5ae5c5d1f77ef2184a50b45a093fe1d7215f9ab0 Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Sun, 31 Jan 2021 13:28:24 +0000 Subject: [PATCH] Adds initial config files --- .gitattributes | 1 + .gitignore | 9 +++ bedroom-celing-light.yaml | 41 +++++++++++++ bedroom-lamp.yaml | 44 ++++++++++++++ bedroom-switch.yaml | 119 ++++++++++++++++++++++++++++++++++++++ hall-celing-light.yaml | 41 +++++++++++++ heated-blanket.yaml | 63 ++++++++++++++++++++ kettle.yaml | 41 +++++++++++++ lounge-arch.yaml | 44 ++++++++++++++ lounge-celing-light.yaml | 41 +++++++++++++ lounge-light-1.yaml | 44 ++++++++++++++ lounge-light-2.yaml | 63 ++++++++++++++++++++ lounge-switch.yaml | 76 ++++++++++++++++++++++++ secrets.yaml | Bin 0 -> 72 bytes study-celing-light.yaml | 41 +++++++++++++ 15 files changed, 668 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 bedroom-celing-light.yaml create mode 100644 bedroom-lamp.yaml create mode 100644 bedroom-switch.yaml create mode 100644 hall-celing-light.yaml create mode 100644 heated-blanket.yaml create mode 100644 kettle.yaml create mode 100644 lounge-arch.yaml create mode 100644 lounge-celing-light.yaml create mode 100644 lounge-light-1.yaml create mode 100644 lounge-light-2.yaml create mode 100644 lounge-switch.yaml create mode 100644 secrets.yaml create mode 100644 study-celing-light.yaml diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..b0835ba --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +secrets.yaml filter=git-crypt diff=git-crypt diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..abba939 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +# Gitignore settings for ESPHome +# This is an example and may include too much for your use-case. +# You can modify this file to suit your needs. +/.esphome/ +**/.pioenvs/ +**/.piolibdeps/ +**/lib/ +**/src/ +**/platformio.ini diff --git a/bedroom-celing-light.yaml b/bedroom-celing-light.yaml new file mode 100644 index 0000000..2c1c449 --- /dev/null +++ b/bedroom-celing-light.yaml @@ -0,0 +1,41 @@ +# Basic Config +esphome: + name: bedroom_celieng_light + platform: ESP8266 + board: esp8285 + +wifi: + ssid: !secret wifi-ssid + password: !secret wifi-password + +logger: +api: +ota: + +# Device Specific Config + +light: + - platform: rgbw + id: celing + name: "Bedroom Celing" + color_interlock: true + red: Red + green: Green + blue: Blue + white: White + restore_mode: ALWAYS_ON + +output: + - platform: esp8266_pwm + pin: GPIO14 + id: Red + - platform: esp8266_pwm + pin: GPIO12 + id: Green + - platform: esp8266_pwm + pin: GPIO05 + id: Blue + - platform: esp8266_pwm + pin: GPIO15 + id: White + diff --git a/bedroom-lamp.yaml b/bedroom-lamp.yaml new file mode 100644 index 0000000..09c2df7 --- /dev/null +++ b/bedroom-lamp.yaml @@ -0,0 +1,44 @@ +# Basic Config +esphome: + name: bedroom_lamp + platform: ESP8266 + board: esp8285 + +wifi: + ssid: !secret wifi-ssid + password: !secret wifi-password + +logger: +api: +ota: + +# Device Specific Config + +light: + - platform: binary + id: lamp + name: "Bedroom Lamp" + output: gpio_12 +output: + - platform: gpio + pin: GPIO12 + id: gpio_12 + +binary_sensor: + - platform: gpio + id: push_button + pin: + number: GPIO0 + mode: INPUT_PULLUP + inverted: True + internal: true + on_press: + # Prevents unintended LED lit states. + if: + condition: + - light.is_off: lamp + then: + #- light.turn_on: blue_led + - light.turn_on: lamp + else: + - light.turn_off: lamp diff --git a/bedroom-switch.yaml b/bedroom-switch.yaml new file mode 100644 index 0000000..a2c37be --- /dev/null +++ b/bedroom-switch.yaml @@ -0,0 +1,119 @@ +esphome: + name: bedroom_switch + platform: ESP8266 + board: esp01_1m + +wifi: + ssid: !secret wifi-ssid + password: !secret wifi-password + +logger: +api: +ota: + +binary_sensor: + - platform: gpio + pin: + number: GPIO0 + mode: INPUT_PULLUP + inverted: True + filters: + - delayed_on: 30ms + - delayed_off: 30ms + internal: True + on_multi_click: + # Single + - timing: + - ON for at most 1s + - OFF for at least 0.5s + then: + - text_sensor.template.publish: + id: bedroom_button + state: !lambda 'return "single";' + #- homeassistant.service: + # service: input_boolean.turn_on + # data: + # entity_id: input_boolean.bedroom_single + #- delay: 0.2s + #- homeassistant.service: + # service: input_boolean.turn_off + # data: + # entity_id: input_boolean.bedroom_single + # Double + - timing: + - ON for at most 1s + - OFF for at most 1s + - ON for at most 1s + - OFF for at least 0.2s + then: + - text_sensor.template.publish: + id: bedroom_button + state: !lambda 'return "double";' + #- homeassistant.service: + # service: input_boolean.turn_on + # data: + # entity_id: input_boolean.bedroom_double + #- delay: 0.2s + #- homeassistant.service: + # service: input_boolean.turn_off + # data: + # entity_id: input_boolean.bedroom_double + # Hold + - timing: + - ON for 1s to 3s + - OFF for at least 0.5s + then: + - text_sensor.template.publish: + id: bedroom_button + state: !lambda 'return "hold";' + #- homeassistant.service: + # service: input_boolean.turn_on + # data: + # entity_id: input_boolean.bedroom_hold + #- delay: 0.2s + #- homeassistant.service: + # service: input_boolean.turn_off + # data: + # entity_id: input_boolean.bedroom_hold + on_press: + then: + - output.turn_on: blue_led + on_release: + then: + - output.turn_off: blue_led + +switch: + - platform: gpio + name: "Bedroom Relay" + pin: GPIO12 + +output: + # Register the blue LED as a dimmable output .... + - platform: esp8266_pwm + id: blue_led + pin: GPIO13 + inverted: True + +text_sensor: + - platform: template + name: "Bedroom Touchpad" + id: bedroom_button + icon: "mdi:toggle-switch" + on_value: + then: + - if: + condition: + text_sensor.state: + id: bedroom_button + state: "" + else: + - delay: 20ms + - text_sensor.template.publish: + id: bedroom_button + state: !lambda 'return "";' + +#light: +# # ... and then make a light out of it. +# - platform: monochromatic +# name: "Bedroom switch light" +# output: blue_led diff --git a/hall-celing-light.yaml b/hall-celing-light.yaml new file mode 100644 index 0000000..b31660c --- /dev/null +++ b/hall-celing-light.yaml @@ -0,0 +1,41 @@ +# Basic Config +esphome: + name: hall_celieng_light + platform: ESP8266 + board: esp8285 + +wifi: + ssid: !secret wifi-ssid + password: !secret wifi-password + +logger: +api: +ota: + +# Device Specific Config + +light: + - platform: rgbw + id: celing + name: "Hall Celing" + color_interlock: true + red: Red + green: Green + blue: Blue + white: White + restore_mode: ALWAYS_ON + +output: + - platform: esp8266_pwm + pin: GPIO14 + id: Red + - platform: esp8266_pwm + pin: GPIO12 + id: Green + - platform: esp8266_pwm + pin: GPIO05 + id: Blue + - platform: esp8266_pwm + pin: GPIO15 + id: White + diff --git a/heated-blanket.yaml b/heated-blanket.yaml new file mode 100644 index 0000000..a79efdc --- /dev/null +++ b/heated-blanket.yaml @@ -0,0 +1,63 @@ +# Basic Config +esphome: + name: heated_blanket + platform: ESP8266 + board: esp8285 + +wifi: + ssid: !secret wifi-ssid + password: !secret wifi-password + +logger: +api: +ota: + +# Device Specific Config + +light: + - platform: binary + id: lamp + name: "Heated Blanket" + output: gpio_12 +output: + - platform: gpio + pin: GPIO12 + id: gpio_12 + +binary_sensor: + - platform: gpio + id: push_button + pin: + number: GPIO0 + mode: INPUT_PULLUP + inverted: True + internal: true + on_press: + # Prevents unintended LED lit states. + if: + condition: + - light.is_off: lamp + then: + #- light.turn_on: blue_led + - light.turn_on: lamp + else: + - light.turn_off: lamp + +#switch: +# # The relay switches on the red side of the LED when active. +# - platform: gpio +# name: "Sonoff Basic Relay" +# pin: GPIO12 +# id: relay +# on_turn_off: +# if: +# condition: +# - switch.is_on: blue_led +# then: +# - switch.turn_off: blue_led +# # With this we can control the blue side of the LED. +# - platform: gpio +# id: blue_led +# pin: +# number: GPIO13 +# inverted: True diff --git a/kettle.yaml b/kettle.yaml new file mode 100644 index 0000000..1b78651 --- /dev/null +++ b/kettle.yaml @@ -0,0 +1,41 @@ +# Basic Config +esphome: + name: kettle + platform: ESP8266 + board: esp8285 + +wifi: + ssid: !secret wifi-ssid + password: !secret wifi-password + +logger: +api: +ota: + +# Device Specific Config + +binary_sensor: + - platform: gpio + pin: + number: GPIO0 + mode: INPUT_PULLUP + inverted: True + internal: true + name: "Kettle Button" + on_press: + # Prevents unintended LED lit states. + if: + condition: + - switch.is_off: kettle + then: + #- light.turn_on: blue_led + - switch.turn_on: kettle + else: + - switch.turn_off: kettle + +switch: + - platform: gpio + name: "Kettle" + id: kettle + pin: GPIO12 + diff --git a/lounge-arch.yaml b/lounge-arch.yaml new file mode 100644 index 0000000..d1c0580 --- /dev/null +++ b/lounge-arch.yaml @@ -0,0 +1,44 @@ +# Basic Config +esphome: + name: lounge_arch + platform: ESP8266 + board: esp8285 + +wifi: + ssid: !secret wifi-ssid + password: !secret wifi-password + +logger: +api: +ota: + +# Device Specific Config + +light: + - platform: binary + id: lamp + name: "Lounge Archway" + output: gpio_12 +output: + - platform: gpio + pin: GPIO12 + id: gpio_12 + +binary_sensor: + - platform: gpio + id: push_button + pin: + number: GPIO0 + mode: INPUT_PULLUP + inverted: True + internal: true + on_press: + # Prevents unintended LED lit states. + if: + condition: + - light.is_off: lamp + then: + #- light.turn_on: blue_led + - light.turn_on: lamp + else: + - light.turn_off: lamp diff --git a/lounge-celing-light.yaml b/lounge-celing-light.yaml new file mode 100644 index 0000000..6582536 --- /dev/null +++ b/lounge-celing-light.yaml @@ -0,0 +1,41 @@ +# Basic Config +esphome: + name: lounge_celieng_light + platform: ESP8266 + board: esp8285 + +wifi: + ssid: !secret wifi-ssid + password: !secret wifi-password + +logger: +api: +ota: + +# Device Specific Config + +light: + - platform: rgbw + id: celing + name: "Lounge Celing" + color_interlock: true + red: Red + green: Green + blue: Blue + white: White + restore_mode: ALWAYS_ON + +output: + - platform: esp8266_pwm + pin: GPIO14 + id: Red + - platform: esp8266_pwm + pin: GPIO12 + id: Green + - platform: esp8266_pwm + pin: GPIO05 + id: Blue + - platform: esp8266_pwm + pin: GPIO15 + id: White + diff --git a/lounge-light-1.yaml b/lounge-light-1.yaml new file mode 100644 index 0000000..ad88eea --- /dev/null +++ b/lounge-light-1.yaml @@ -0,0 +1,44 @@ +# Basic Config +esphome: + name: lounge_light_1 + platform: ESP8266 + board: esp8285 + +wifi: + ssid: !secret wifi-ssid + password: !secret wifi-password + +logger: +api: +ota: + +# Device Specific Config + +light: + - platform: binary + id: lamp + name: "Desk Lamp" + output: gpio_12 +output: + - platform: gpio + pin: GPIO12 + id: gpio_12 + +binary_sensor: + - platform: gpio + id: push_button + pin: + number: GPIO0 + mode: INPUT_PULLUP + inverted: True + internal: true + on_press: + # Prevents unintended LED lit states. + if: + condition: + - light.is_off: lamp + then: + #- light.turn_on: blue_led + - light.turn_on: lamp + else: + - light.turn_off: lamp diff --git a/lounge-light-2.yaml b/lounge-light-2.yaml new file mode 100644 index 0000000..601eb4b --- /dev/null +++ b/lounge-light-2.yaml @@ -0,0 +1,63 @@ +# Basic Config +esphome: + name: lounge_light_2 + platform: ESP8266 + board: esp8285 + +wifi: + ssid: !secret wifi-ssid + password: !secret wifi-password + +logger: +api: +ota: + +# Device Specific Config + +light: + - platform: binary + id: lamp + name: "Desk Lamp 2" + output: gpio_12 +output: + - platform: gpio + pin: GPIO12 + id: gpio_12 + +binary_sensor: + - platform: gpio + id: push_button + pin: + number: GPIO0 + mode: INPUT_PULLUP + inverted: True + internal: true + on_press: + # Prevents unintended LED lit states. + if: + condition: + - light.is_off: lamp + then: + #- light.turn_on: blue_led + - light.turn_on: lamp + else: + - light.turn_off: lamp + +#switch: +# # The relay switches on the red side of the LED when active. +# - platform: gpio +# name: "Sonoff Basic Relay" +# pin: GPIO12 +# id: relay +# on_turn_off: +# if: +# condition: +# - switch.is_on: blue_led +# then: +# - switch.turn_off: blue_led +# # With this we can control the blue side of the LED. +# - platform: gpio +# id: blue_led +# pin: +# number: GPIO13 +# inverted: True diff --git a/lounge-switch.yaml b/lounge-switch.yaml new file mode 100644 index 0000000..0199652 --- /dev/null +++ b/lounge-switch.yaml @@ -0,0 +1,76 @@ +esphome: + name: lounge_switch + platform: ESP8266 + board: esp01_1m + +wifi: + ssid: !secret wifi-ssid + password: !secret wifi-password + +logger: +api: +ota: + +binary_sensor: + - platform: gpio + pin: + number: GPIO0 + mode: INPUT_PULLUP + inverted: True + name: "Lounge Touchpad 1" + on_press: + then: + - output.turn_on: blue_led + on_release: + then: + - output.turn_off: blue_led + - platform: gpio + pin: + number: GPIO9 + mode: INPUT_PULLUP + inverted: True + name: "Lounge Touchpad 2" + on_press: + then: + - output.turn_on: blue_led + on_release: + then: + - output.turn_off: blue_led + - platform: gpio + pin: + number: GPIO10 + mode: INPUT_PULLUP + inverted: True + name: "Lounge Touchpad 3" + on_press: + then: + - output.turn_on: blue_led + on_release: + then: + - output.turn_off: blue_led + # - platform: status + # name: "Sonoff T1 UK 3 Gang Status" + +switch: + - platform: gpio + name: "Lounge Relay 1" + pin: GPIO12 + - platform: gpio + name: "Lounge Relay 2" + pin: GPIO5 + - platform: gpio + name: "Lounge Relay 3" + pin: GPIO4 + +output: + # Register the blue LED as a dimmable output .... + - platform: esp8266_pwm + id: blue_led + pin: GPIO13 + inverted: True + +#light: +# # ... and then make a light out of it. +# - platform: monochromatic +# name: "Bedroom switch light" +# output: blue_led diff --git a/secrets.yaml b/secrets.yaml new file mode 100644 index 0000000000000000000000000000000000000000..365e052db36777a4db12587e12b7a75a5896142b GIT binary patch literal 72 zcmV-O0Jr}DM@dveQdv+`00lGxcHBgmVxr|Hh$Q_qz)%Q;={3DH^k4{)4AbhTGqIpe e;PD<+KxgMG_?qh1!SLTjOPaF4O^kmoCD<)Z4k6J1 literal 0 HcmV?d00001 diff --git a/study-celing-light.yaml b/study-celing-light.yaml new file mode 100644 index 0000000..60dbb55 --- /dev/null +++ b/study-celing-light.yaml @@ -0,0 +1,41 @@ +# Basic Config +esphome: + name: study_celieng_light + platform: ESP8266 + board: esp8285 + +wifi: + ssid: !secret wifi-ssid + password: !secret wifi-password + +logger: +api: +ota: + +# Device Specific Config + +light: + - platform: rgbw + id: celing + name: "Study Celing" + color_interlock: true + red: Red + green: Green + blue: Blue + white: White + restore_mode: ALWAYS_ON + +output: + - platform: esp8266_pwm + pin: GPIO14 + id: Red + - platform: esp8266_pwm + pin: GPIO12 + id: Green + - platform: esp8266_pwm + pin: GPIO05 + id: Blue + - platform: esp8266_pwm + pin: GPIO15 + id: White +