@@ -93,7 +93,7 @@ esphome:
93
93
blue : 95%
94
94
color_brightness : 60%
95
95
- delay : 3s
96
- - script.execute : reset_led
96
+ - script.execute : update_led
97
97
98
98
# Enable logging
99
99
logger :
@@ -181,23 +181,12 @@ switch:
181
181
restore_mode : RESTORE_DEFAULT_OFF
182
182
optimistic : true
183
183
turn_on_action :
184
- - light.turn_on :
185
- id : doorman_rgb_status_led
186
- red : 100%
187
- green : 100%
188
- blue : 3%
189
- effect : slow_pulse
190
- - delay : 300ms
191
- - if :
192
- condition :
193
- - switch.is_on : doorman_ring_to_open_confirmation
194
- then :
195
- - tcs_intercom.send :
196
- command : !lambda "return id(apartment_doorbell_command);"
184
+ - script.execute : update_led
197
185
- script.execute : ring_to_open_timer
198
186
turn_off_action :
199
187
- light.turn_off : doorman_rgb_status_led
200
188
- script.stop : ring_to_open_timer
189
+ - script.execute : update_led
201
190
202
191
- platform : template
203
192
name : " Ring To Open: Confirmation"
@@ -487,6 +476,14 @@ binary_sensor:
487
476
lambda : !lambda "return id(ring_to_open_toggle_command);"
488
477
on_press :
489
478
- switch.toggle : doorman_ring_to_open
479
+ - delay : 300ms
480
+ - if :
481
+ condition :
482
+ - switch.is_on : doorman_ring_to_open
483
+ - switch.is_on : doorman_ring_to_open_confirmation
484
+ then :
485
+ - tcs_intercom.send :
486
+ command : !lambda "return id(apartment_doorbell_command);"
490
487
entity_category : DIAGNOSTIC
491
488
disabled_by_default : true
492
489
@@ -689,10 +686,23 @@ event:
689
686
- " triple"
690
687
691
688
script :
692
- - id : reset_led
689
+ - id : update_led
693
690
then :
694
691
# TODO: Restore specific state conditionally
695
- - light.turn_off : doorman_rgb_status_led
692
+ - if :
693
+ condition :
694
+ - switch.is_on : doorman_ring_to_open
695
+ then :
696
+ - light.turn_on :
697
+ id : doorman_rgb_status_led
698
+ red : 100%
699
+ green : 100%
700
+ blue : 3%
701
+ effect : slow_pulse
702
+ else :
703
+ - light.turn_off :
704
+ id : doorman_rgb_status_led
705
+ transition_length : 1s
696
706
697
707
- id : ring_to_open_timer
698
708
then :
0 commit comments