chore: use virtual button to trigger chime

This commit is contained in:
Mario 2025-05-31 16:57:35 +02:00
parent bfec9b1a73
commit e6c6d165b0

View file

@ -9,7 +9,6 @@ esp32:
# Enable Home Assistant API # Enable Home Assistant API
api: api:
web_server: web_server:
logger:
ota: ota:
- platform: esphome - platform: esphome
@ -38,15 +37,24 @@ binary_sensor:
green: 1 green: 1
blue: 0.7 blue: 0.7
effect: pulse effect: pulse
- switch.turn_on: relay_chime - button.press: chime_button
- delay: 0.1s
- switch.turn_off: relay_chime
on_release: on_release:
then: then:
- light.turn_off: - light.turn_off:
id: ring id: ring
transition_length: 1s transition_length: 1s
button:
- platform: template
id: chime_button
name: Ring
icon: mdi:bell
on_press:
then:
- switch.turn_on: relay_chime
- delay: 0.1s
- switch.turn_off: relay_chime
output: output:
- platform: ledc - platform: ledc
pin: GPIO2 pin: GPIO2