From 1c3264312de669c99d99abee19495261cf6fff80 Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Thu, 2 Feb 2023 15:09:40 +0000 Subject: [PATCH] New house - clear everything --- bedroom-celing-light.yaml | 43 -------- bedroom-lamp.yaml | 46 -------- bedroom-switch.yaml | 110 ------------------ hall-celing-light.yaml | 43 -------- hall-switch-1.yaml | 57 ---------- kettle.yaml | 43 -------- kitchen-lamp.yaml | 65 ----------- kitchen-switch.yaml | 164 --------------------------- lounge-arch.yaml | 46 -------- lounge-celing-light.yaml | 43 -------- lounge-light-1.yaml | 46 -------- lounge-light-2.yaml | 65 ----------- lounge-switch.yaml | 227 -------------------------------------- secrets.yaml | Bin 72 -> 0 bytes study-celing-light.yaml | 43 -------- study-switch.yaml | 57 ---------- 16 files changed, 1098 deletions(-) delete mode 100644 bedroom-celing-light.yaml delete mode 100644 bedroom-lamp.yaml delete mode 100644 bedroom-switch.yaml delete mode 100644 hall-celing-light.yaml delete mode 100644 hall-switch-1.yaml delete mode 100644 kettle.yaml delete mode 100644 kitchen-lamp.yaml delete mode 100644 kitchen-switch.yaml delete mode 100644 lounge-arch.yaml delete mode 100644 lounge-celing-light.yaml delete mode 100644 lounge-light-1.yaml delete mode 100644 lounge-light-2.yaml delete mode 100644 lounge-switch.yaml delete mode 100644 study-celing-light.yaml delete mode 100644 study-switch.yaml diff --git a/bedroom-celing-light.yaml b/bedroom-celing-light.yaml deleted file mode 100644 index ceede89..0000000 --- a/bedroom-celing-light.yaml +++ /dev/null @@ -1,43 +0,0 @@ -#BlitzWolf BW-LT21 -#https://www.banggood.com/BlitzWolf-BW-LT21-RGBWW-10W-E27-APP-Smart-LED-Light-Bulb-Work-With-Amazon-Alexa-Google-Assistant-AC100-240V-p-1551059.html?rmmds=myorder&cur_warehouse=CN - -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 deleted file mode 100644 index e719bc7..0000000 --- a/bedroom-lamp.yaml +++ /dev/null @@ -1,46 +0,0 @@ -#SONOFF BASICR2 -#https://www.banggood.com/SONOFF-BASICR2-10A-2200W-WIFI-Wireless-Smart-Switch-Remote-Control-Socket-APP-Timer-AC90-250V-50-or-60Hz-Works-with-Amazon-Alexa-Google-Home-Assistant-Nest-IFTTT-p-1019971.html?rmmds=myorder&cur_warehouse=CN - -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 deleted file mode 100644 index 5d1dbde..0000000 --- a/bedroom-switch.yaml +++ /dev/null @@ -1,110 +0,0 @@ -#SONOFF T1 EU/UK (1 button) -#https://www.banggood.com/SONOFF-T1-EU-or-UK-AC-100-240V-1-or-2-or-3-Gang-TX-Series-WIFI-Wall-Switch-433Mhz-RF-Remote-Controlled-Wifi-Switch-Smart-Home-Switch-Works-With-Alexa-Google-Home-p-1470883.html?rmmds=myorder&cur_warehouse=UK&ID=6278514 - -esphome: - name: bedroom_switch - platform: ESP8266 - board: esp01_1m - -wifi: - ssid: !secret wifi-ssid - password: !secret wifi-password - -logger: -api: -ota: - -# This is the button on the switch -# It is no longer published to home assistant, it is instead used by esphome to -# update the state of a "virtual" sensor. This is how I distinguish -# between a single, double and hold push -binary_sensor: - - platform: gpio - name: "Bedroom Sensor" - 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";' - # 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";' - # 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";' - # There is a bit of a delay between pushing the button on the switch and - # the light turning on. This is for 2 main reasons: - # * There is a bit of a delay for the switch to decide if a single or - # double press was wanted - # * The smart bulbs take a little while to turn on - # To give some instant feedback to the user, I re-purpose the wifi light. - # Whenever the touchpad is being pushed, the light is on. - # This makes it clear that the push has been registered. - on_press: - then: - - output.turn_on: blue_led - on_release: - then: - - output.turn_off: blue_led - -# This switch gives electrisity to the bulb. We want it on all the time really -switch: - - platform: gpio - name: "Bedroom Relay" - pin: GPIO12 - restore_mode: ALWAYS_ON - -# This is the blue wifi led. -# It is used above to determine whether or not a push is registered -output: - - platform: esp8266_pwm - id: blue_led - pin: GPIO13 - inverted: True - -# This sensor is published to homeassistant with the value: -# * single -# * double -# * hold -# This can be used to trigger automations by type "state" -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 "";' diff --git a/hall-celing-light.yaml b/hall-celing-light.yaml deleted file mode 100644 index 78fe809..0000000 --- a/hall-celing-light.yaml +++ /dev/null @@ -1,43 +0,0 @@ -#BlitzWolf BW-LT21 -#https://www.banggood.com/BlitzWolf-BW-LT21-RGBWW-10W-E27-APP-Smart-LED-Light-Bulb-Work-With-Amazon-Alexa-Google-Assistant-AC100-240V-p-1551059.html?rmmds=myorder&cur_warehouse=CN - -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/hall-switch-1.yaml b/hall-switch-1.yaml deleted file mode 100644 index 31a7cfe..0000000 --- a/hall-switch-1.yaml +++ /dev/null @@ -1,57 +0,0 @@ -#SONOFF T1 EU/UK (1 button) -#https://www.banggood.com/SONOFF-T1-EU-or-UK-AC-100-240V-1-or-2-or-3-Gang-TX-Series-WIFI-Wall-Switch-433Mhz-RF-Remote-Controlled-Wifi-Switch-Smart-Home-Switch-Works-With-Alexa-Google-Home-p-1470883.html?rmmds=myorder&cur_warehouse=UK&ID=6278514 - -esphome: - name: hall_switch_1 - platform: ESP8266 - board: esp01_1m - -wifi: - ssid: !secret wifi-ssid - password: !secret wifi-password - -logger: -api: -ota: - -# This is the button on the switch -# It is no longer published to home assistant, it is instead used by esphome to -# update the state of a "virtual" sensor. This is how I distinguish -# between a single, double and hold push -binary_sensor: - - platform: gpio - name: "Hall Switch 1 Sensor" - pin: - number: GPIO0 - mode: INPUT_PULLUP - inverted: True - # There is a bit of a delay between pushing the button on the switch and - # the light turning on. This is for 2 main reasons: - # * There is a bit of a delay for the switch to decide if a single or - # double press was wanted - # * The smart bulbs take a little while to turn on - # To give some instant feedback to the user, I re-purpose the wifi light. - # Whenever the touchpad is being pushed, the light is on. - # This makes it clear that the push has been registered. - on_press: - then: - - output.turn_on: blue_led - on_release: - then: - - output.turn_off: blue_led - -# This switch gives electrisity to the bulb. We want it on all the time really -switch: - - platform: gpio - name: "Hall Switch Relay" - pin: GPIO12 - restore_mode: ALWAYS_ON - -# This is the blue wifi led. -# It is used above to determine whether or not a push is registered -output: - - platform: esp8266_pwm - id: blue_led - pin: GPIO13 - inverted: True - diff --git a/kettle.yaml b/kettle.yaml deleted file mode 100644 index 6f188bf..0000000 --- a/kettle.yaml +++ /dev/null @@ -1,43 +0,0 @@ -#SONOFF S26 -#https://www.amazon.co.uk/gp/product/B07TS5P2K1/ref=ppx_yo_dt_b_asin_title_o02_s00?ie=UTF8&psc=1 - -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/kitchen-lamp.yaml b/kitchen-lamp.yaml deleted file mode 100644 index 84bb396..0000000 --- a/kitchen-lamp.yaml +++ /dev/null @@ -1,65 +0,0 @@ -#SONOFF BASICR2 -#https://www.banggood.com/SONOFF-BASICR2-10A-2200W-WIFI-Wireless-Smart-Switch-Remote-Control-Socket-APP-Timer-AC90-250V-50-or-60Hz-Works-with-Amazon-Alexa-Google-Home-Assistant-Nest-IFTTT-p-1019971.html?rmmds=myorder&cur_warehouse=CN - -esphome: - name: kitchen_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: "Kitchen 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 - -#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/kitchen-switch.yaml b/kitchen-switch.yaml deleted file mode 100644 index e7909ff..0000000 --- a/kitchen-switch.yaml +++ /dev/null @@ -1,164 +0,0 @@ -#SONOFF T1 EU/UK (3 buttons) -#https://www.banggood.com/SONOFF-T1-EU-or-UK-AC-100-240V-1-or-2-or-3-Gang-TX-Series-WIFI-Wall-Switch-433Mhz-RF-Remote-Controlled-Wifi-Switch-Smart-Home-Switch-Works-With-Alexa-Google-Home-p-1470883.html?rmmds=myorder&cur_warehouse=UK&ID=6278514 - -esphome: - name: kitchen_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: "Kitchen 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: "Kitchen Touchpad 2" - on_press: - if: - condition: - - light.is_off: kitchen_celing_light - then: - - light.turn_on: kitchen_celing_light - - output.turn_on: blue_led - else: - - light.turn_off: kitchen_celing_light - - output.turn_on: blue_led - on_release: - then: - output.turn_off: blue_led - - - platform: gpio - pin: - number: GPIO10 - mode: INPUT_PULLUP - inverted: True - name: "Kitchen Touchpad 3" - on_press: - if: - condition: - - light.is_off: under_lights_light - then: - - light.turn_on: under_lights_light - - output.turn_on: blue_led - else: - - light.turn_off: under_lights_light - - 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 - restore_mode: ALWAYS_OFF -# - 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 - - platform: gpio - id: kitchen_celing - pin: GPIO5 - - platform: gpio - id: under_lights - pin: GPIO4 - -light: - - platform: binary - name: "Kitchen Celing" - output: kitchen_celing - id: kitchen_celing_light - - platform: binary - name: "Kitchen Under Lighting" - output: under_lights - id: under_lights_light - - -# This sensor is published to homeassistant with the value: -# * single -# * double -# * hold -# This can be used to trigger automations by type "state" -#text_sensor: -# - platform: template -# name: "Lounge Touchpad 1" -# id: louge_button_1 -# icon: "mdi:toggle-switch" -# on_value: -# then: -# - if: -# condition: -# text_sensor.state: -# id: louge_button_1 -# state: "" -# else: -# - delay: 20ms -# - text_sensor.template.publish: -# id: louge_button_1 -# state: !lambda 'return "";' -# - platform: template -# name: "Lounge Touchpad 2" -# id: louge_button_2 -# icon: "mdi:toggle-switch" -# on_value: -# then: -# - if: -# condition: -# text_sensor.state: -# id: louge_button_2 -# state: "" -# else: -# - delay: 20ms -# - text_sensor.template.publish: -# id: louge_button_2 -# state: !lambda 'return "";' -# - platform: template -# name: "Lounge Touchpad 3" -# id: louge_button_3 -# icon: "mdi:toggle-switch" -# on_value: -# then: -# - if: -# condition: -# text_sensor.state: -# id: louge_button_3 -# state: "" -# else: -# - delay: 20ms -# - text_sensor.template.publish: -# id: louge_button_3 -# state: !lambda 'return "";' diff --git a/lounge-arch.yaml b/lounge-arch.yaml deleted file mode 100644 index 1a12e55..0000000 --- a/lounge-arch.yaml +++ /dev/null @@ -1,46 +0,0 @@ -#SONOFF BASICR2 -#https://www.banggood.com/SONOFF-BASICR2-10A-2200W-WIFI-Wireless-Smart-Switch-Remote-Control-Socket-APP-Timer-AC90-250V-50-or-60Hz-Works-with-Amazon-Alexa-Google-Home-Assistant-Nest-IFTTT-p-1019971.html?rmmds=myorder&cur_warehouse=CN - -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 deleted file mode 100644 index c09bfc6..0000000 --- a/lounge-celing-light.yaml +++ /dev/null @@ -1,43 +0,0 @@ -#BlitzWolf BW-LT21 -#https://www.banggood.com/BlitzWolf-BW-LT21-RGBWW-10W-E27-APP-Smart-LED-Light-Bulb-Work-With-Amazon-Alexa-Google-Assistant-AC100-240V-p-1551059.html?rmmds=myorder&cur_warehouse=CN - -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 deleted file mode 100644 index 4babcea..0000000 --- a/lounge-light-1.yaml +++ /dev/null @@ -1,46 +0,0 @@ -#SONOFF BASICR2 -#https://www.banggood.com/SONOFF-BASICR2-10A-2200W-WIFI-Wireless-Smart-Switch-Remote-Control-Socket-APP-Timer-AC90-250V-50-or-60Hz-Works-with-Amazon-Alexa-Google-Home-Assistant-Nest-IFTTT-p-1019971.html?rmmds=myorder&cur_warehouse=CN - -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 deleted file mode 100644 index 3dd7a2c..0000000 --- a/lounge-light-2.yaml +++ /dev/null @@ -1,65 +0,0 @@ -#SONOFF BASICR2 -#https://www.banggood.com/SONOFF-BASICR2-10A-2200W-WIFI-Wireless-Smart-Switch-Remote-Control-Socket-APP-Timer-AC90-250V-50-or-60Hz-Works-with-Amazon-Alexa-Google-Home-Assistant-Nest-IFTTT-p-1019971.html?rmmds=myorder&cur_warehouse=CN - -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 deleted file mode 100644 index 178088c..0000000 --- a/lounge-switch.yaml +++ /dev/null @@ -1,227 +0,0 @@ -#SONOFF T1 EU/UK (3 buttons) -#https://www.banggood.com/SONOFF-T1-EU-or-UK-AC-100-240V-1-or-2-or-3-Gang-TX-Series-WIFI-Wall-Switch-433Mhz-RF-Remote-Controlled-Wifi-Switch-Smart-Home-Switch-Works-With-Alexa-Google-Home-p-1470883.html?rmmds=myorder&cur_warehouse=UK&ID=6278514 - -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 - 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: louge_button_1 - state: !lambda 'return "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: louge_button_1 - state: !lambda 'return "double";' - # Hold - - timing: - - ON for 1s to 3s - - OFF for at least 0.5s - then: - - text_sensor.template.publish: - id: louge_button_1 - state: !lambda 'return "hold";' - name: "Lounge Raw 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 - 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: louge_button_2 - state: !lambda 'return "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: louge_button_2 - state: !lambda 'return "double";' - # Hold - - timing: - - ON for 1s to 3s - - OFF for at least 0.5s - then: - - text_sensor.template.publish: - id: louge_button_2 - state: !lambda 'return "hold";' - name: "Lounge Raw 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 Raw Touchpad 3" - 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: louge_button_3 - state: !lambda 'return "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: louge_button_3 - state: !lambda 'return "double";' - # Hold - - timing: - - ON for 1s to 3s - - OFF for at least 0.5s - then: - - text_sensor.template.publish: - id: louge_button_3 - state: !lambda 'return "hold";' - 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 - restore_mode: ALWAYS_OFF - - platform: gpio - name: "Lounge Relay 2" - pin: GPIO5 - restore_mode: ALWAYS_ON - - platform: gpio - name: "Lounge Relay 3" - pin: GPIO4 - restore_mode: ALWAYS_OFF - -output: - # Register the blue LED as a dimmable output .... - - platform: esp8266_pwm - id: blue_led - pin: GPIO13 - inverted: True - -# This sensor is published to homeassistant with the value: -# * single -# * double -# * hold -# This can be used to trigger automations by type "state" -text_sensor: - - platform: template - name: "Lounge Touchpad 1" - id: louge_button_1 - icon: "mdi:toggle-switch" - on_value: - then: - - if: - condition: - text_sensor.state: - id: louge_button_1 - state: "" - else: - - delay: 20ms - - text_sensor.template.publish: - id: louge_button_1 - state: !lambda 'return "";' - - platform: template - name: "Lounge Touchpad 2" - id: louge_button_2 - icon: "mdi:toggle-switch" - on_value: - then: - - if: - condition: - text_sensor.state: - id: louge_button_2 - state: "" - else: - - delay: 20ms - - text_sensor.template.publish: - id: louge_button_2 - state: !lambda 'return "";' - - platform: template - name: "Lounge Touchpad 3" - id: louge_button_3 - icon: "mdi:toggle-switch" - on_value: - then: - - if: - condition: - text_sensor.state: - id: louge_button_3 - state: "" - else: - - delay: 20ms - - text_sensor.template.publish: - id: louge_button_3 - state: !lambda 'return "";' diff --git a/secrets.yaml b/secrets.yaml index 365e052db36777a4db12587e12b7a75a5896142b..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 GIT binary patch literal 0 HcmV?d00001 literal 72 zcmV-O0Jr}DM@dveQdv+`00lGxcHBgmVxr|Hh$Q_qz)%Q;={3DH^k4{)4AbhTGqIpe e;PD<+KxgMG_?qh1!SLTjOPaF4O^kmoCD<)Z4k6J1 diff --git a/study-celing-light.yaml b/study-celing-light.yaml deleted file mode 100644 index cb616b3..0000000 --- a/study-celing-light.yaml +++ /dev/null @@ -1,43 +0,0 @@ -#BlitzWolf BW-LT21 -#https://www.banggood.com/BlitzWolf-BW-LT21-RGBWW-10W-E27-APP-Smart-LED-Light-Bulb-Work-With-Amazon-Alexa-Google-Assistant-AC100-240V-p-1551059.html?rmmds=myorder&cur_warehouse=CN - -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 - diff --git a/study-switch.yaml b/study-switch.yaml deleted file mode 100644 index ed276c2..0000000 --- a/study-switch.yaml +++ /dev/null @@ -1,57 +0,0 @@ -#SONOFF T1 EU/UK (1 button) -#https://www.banggood.com/SONOFF-T1-EU-or-UK-AC-100-240V-1-or-2-or-3-Gang-TX-Series-WIFI-Wall-Switch-433Mhz-RF-Remote-Controlled-Wifi-Switch-Smart-Home-Switch-Works-With-Alexa-Google-Home-p-1470883.html?rmmds=myorder&cur_warehouse=UK&ID=6278514 - -esphome: - name: study_switch - platform: ESP8266 - board: esp01_1m - -wifi: - ssid: !secret wifi-ssid - password: !secret wifi-password - -logger: -api: -ota: - -# This is the button on the switch -# It is no longer published to home assistant, it is instead used by esphome to -# update the state of a "virtual" sensor. This is how I distinguish -# between a single, double and hold push -binary_sensor: - - platform: gpio - name: "Study Sensor" - pin: - number: GPIO0 - mode: INPUT_PULLUP - inverted: True - # There is a bit of a delay between pushing the button on the switch and - # the light turning on. This is for 2 main reasons: - # * There is a bit of a delay for the switch to decide if a single or - # double press was wanted - # * The smart bulbs take a little while to turn on - # To give some instant feedback to the user, I re-purpose the wifi light. - # Whenever the touchpad is being pushed, the light is on. - # This makes it clear that the push has been registered. - on_press: - then: - - output.turn_on: blue_led - on_release: - then: - - output.turn_off: blue_led - -# This switch gives electrisity to the bulb. We want it on all the time really -switch: - - platform: gpio - name: "Study Relay" - pin: GPIO12 - restore_mode: ALWAYS_ON - -# This is the blue wifi led. -# It is used above to determine whether or not a push is registered -output: - - platform: esp8266_pwm - id: blue_led - pin: GPIO13 - inverted: True -