You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
164 lines
3.9 KiB
164 lines
3.9 KiB
#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 "";'
|
|
|