various tidyups and esphome adds
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
substitutions:
|
||||
# Device Naming
|
||||
device_name: "esp-mainbathroomlights"
|
||||
friendly_name: "Main Bathroom Lightswitch (3) 2"
|
||||
friendly_name: "Main Bathroom Lightswitch (3)"
|
||||
description_comment: "BK7231N - Main Bathroom Lightswitch using a Zemismart KS-811 Triple Push Button. Main Lights (1), Shower Lights (2), Cabinet Lights (3)"
|
||||
device_area: "Main Bathroom" # Allows ESP device to be automatically linked to an 'Area' in Home Assistant.
|
||||
|
||||
@@ -159,7 +159,7 @@ binary_sensor:
|
||||
name: "Button 1: ${switch_1_name}"
|
||||
on_press:
|
||||
- delay: 50ms
|
||||
- switch.toggle: Relay_1
|
||||
- switch.toggle: Relay_2 #(FIX shoud be relay 1)
|
||||
|
||||
- platform: gpio
|
||||
pin:
|
||||
@@ -183,7 +183,7 @@ binary_sensor:
|
||||
name: "Button 3: ${switch_3_name}"
|
||||
on_press:
|
||||
- delay: 50ms
|
||||
- switch.turn_off: Relay_1
|
||||
#- switch.turn_off: Relay_1
|
||||
- switch.turn_off: Relay_2
|
||||
- switch.turn_off: Relay_3
|
||||
|
||||
@@ -211,4 +211,23 @@ switch:
|
||||
name: "Relay 3: ${switch_3_name}"
|
||||
pin: P15 #GPIO15
|
||||
id: Relay_3
|
||||
restore_mode: ${relay_restore_mode}
|
||||
restore_mode: ${relay_restore_mode}
|
||||
|
||||
##########################################################################################
|
||||
# TEMPLATE COMPONENT
|
||||
#
|
||||
##########################################################################################
|
||||
# Virtual group switch for Home Assistant
|
||||
- platform: template
|
||||
name: "All Main Bathroom Lights"
|
||||
id: all_main_bathroom_lights
|
||||
optimistic: false
|
||||
restore_mode: RESTORE_DEFAULT_OFF
|
||||
lambda: |-
|
||||
return id(Relay_1).state || id(Relay_2).state || id(Relay_3).state;
|
||||
turn_on_action:
|
||||
- switch.turn_on: Relay_2
|
||||
turn_off_action:
|
||||
#- switch.turn_off: Relay_1
|
||||
- switch.turn_off: Relay_2
|
||||
- switch.turn_off: Relay_3
|
||||
Reference in New Issue
Block a user