feat: add additional doorbell features
This commit is contained in:
parent
a11e1c1943
commit
cf00ce2272
1 changed files with 53 additions and 17 deletions
|
@ -1,6 +1,6 @@
|
||||||
esphome:
|
esphome:
|
||||||
name: swablab-doorbell
|
name: doorbell
|
||||||
friendly_name: Swablab Doorbell
|
friendly_name: Doorbell
|
||||||
name_add_mac_suffix: True
|
name_add_mac_suffix: True
|
||||||
|
|
||||||
esp32:
|
esp32:
|
||||||
|
@ -18,16 +18,52 @@ wifi:
|
||||||
ssid: !secret wifi_ssid
|
ssid: !secret wifi_ssid
|
||||||
password: !secret wifi_password
|
password: !secret wifi_password
|
||||||
|
|
||||||
|
sensor:
|
||||||
|
- platform: uptime
|
||||||
|
name: Uptime
|
||||||
|
- platform: wifi_signal
|
||||||
|
name: WiFi Signal
|
||||||
|
update_interval: 10s
|
||||||
|
|
||||||
|
globals:
|
||||||
|
- id: chime
|
||||||
|
type: bool
|
||||||
|
restore_value: True
|
||||||
|
initial_value: 'true'
|
||||||
|
|
||||||
|
switch:
|
||||||
|
- platform: gpio
|
||||||
|
name: Relay
|
||||||
|
id: relay
|
||||||
|
internal: True
|
||||||
|
pin: GPIO12
|
||||||
|
- platform: restart
|
||||||
|
name: Restart
|
||||||
|
- platform: template
|
||||||
|
id: chime_active
|
||||||
|
name: Chime Active
|
||||||
|
restore_mode: RESTORE_DEFAULT_ON
|
||||||
|
lambda: |-
|
||||||
|
return id(chime);
|
||||||
|
turn_on_action:
|
||||||
|
- globals.set:
|
||||||
|
id: chime
|
||||||
|
value: 'true'
|
||||||
|
turn_off_action:
|
||||||
|
- globals.set:
|
||||||
|
id: chime
|
||||||
|
value: 'false'
|
||||||
|
|
||||||
binary_sensor:
|
binary_sensor:
|
||||||
- platform: gpio
|
- platform: gpio
|
||||||
id: bell_button
|
id: push_button
|
||||||
pin:
|
pin:
|
||||||
number: GPIO15
|
number: GPIO15
|
||||||
mode:
|
mode:
|
||||||
input: True
|
input: True
|
||||||
pulldown: True
|
pulldown: True
|
||||||
filters:
|
filters:
|
||||||
- delayed_on: 10ms
|
- delayed_on: 50ms
|
||||||
- delayed_off: 8s
|
- delayed_off: 8s
|
||||||
on_press:
|
on_press:
|
||||||
then:
|
then:
|
||||||
|
@ -37,12 +73,18 @@ binary_sensor:
|
||||||
green: 1
|
green: 1
|
||||||
blue: 0.7
|
blue: 0.7
|
||||||
effect: pulse
|
effect: pulse
|
||||||
- button.press: chime_button
|
- if:
|
||||||
|
condition:
|
||||||
|
- switch.is_on: chime_active
|
||||||
|
then:
|
||||||
|
- button.press: chime_button
|
||||||
on_release:
|
on_release:
|
||||||
then:
|
then:
|
||||||
- light.turn_off:
|
- light.turn_off:
|
||||||
id: ring
|
id: ring
|
||||||
transition_length: 1s
|
transition_length: 1s
|
||||||
|
- platform: status
|
||||||
|
name: Status
|
||||||
|
|
||||||
button:
|
button:
|
||||||
- platform: template
|
- platform: template
|
||||||
|
@ -51,9 +93,9 @@ button:
|
||||||
icon: mdi:bell
|
icon: mdi:bell
|
||||||
on_press:
|
on_press:
|
||||||
then:
|
then:
|
||||||
- switch.turn_on: relay_chime
|
- switch.turn_on: relay
|
||||||
- delay: 0.3s
|
- delay: 0.3s
|
||||||
- switch.turn_off: relay_chime
|
- switch.turn_off: relay
|
||||||
|
|
||||||
output:
|
output:
|
||||||
- platform: ledc
|
- platform: ledc
|
||||||
|
@ -66,12 +108,6 @@ output:
|
||||||
pin: GPIO16
|
pin: GPIO16
|
||||||
id: led_blue
|
id: led_blue
|
||||||
|
|
||||||
switch:
|
|
||||||
- platform: gpio
|
|
||||||
name: Relay Chime
|
|
||||||
id: relay_chime
|
|
||||||
pin: GPIO12
|
|
||||||
|
|
||||||
light:
|
light:
|
||||||
- platform: rgb
|
- platform: rgb
|
||||||
name: Ring
|
name: Ring
|
||||||
|
@ -81,12 +117,12 @@ light:
|
||||||
red: led_red
|
red: led_red
|
||||||
effects:
|
effects:
|
||||||
- pulse:
|
- pulse:
|
||||||
transition_length: 600ms
|
transition_length: 500ms
|
||||||
update_interval: 600ms
|
update_interval: 500ms
|
||||||
min_brightness: 40%
|
min_brightness: 30%
|
||||||
max_brightness: 100%
|
max_brightness: 100%
|
||||||
- random:
|
- random:
|
||||||
transition_length: 3s
|
transition_length: 1s
|
||||||
update_interval: 1s
|
update_interval: 1s
|
||||||
default_transition_length:
|
default_transition_length:
|
||||||
milliseconds: 200
|
milliseconds: 200
|
||||||
|
|
Loading…
Add table
Reference in a new issue