mirror of
https://github.com/esphome/esphome.git
synced 2024-11-23 23:48:11 +01:00
66 lines
1.7 KiB
YAML
66 lines
1.7 KiB
YAML
esphome:
|
|
on_boot:
|
|
then:
|
|
- media_player.volume_set: 0.5
|
|
- media_player.volume_up:
|
|
- media_player.volume_down:
|
|
- if:
|
|
condition:
|
|
or:
|
|
- media_player.is_idle:
|
|
- media_player.is_playing:
|
|
then:
|
|
- media_player.play_media: http://localhost/media.mp3
|
|
- media_player.pause:
|
|
- media_player.toggle:
|
|
- media_player.stop:
|
|
- speaker_media_player.play_local_media_file: wake_word_trigger_sound
|
|
- speaker_media_player.stop_stream: media
|
|
- speaker_media_player.play_local_media_file:
|
|
media_file: wake_word_trigger_sound
|
|
announcement: true
|
|
- speaker_media_player.stop_stream: announcement
|
|
|
|
wifi:
|
|
ssid: MySSID
|
|
password: password1
|
|
|
|
i2s_audio:
|
|
i2s_mclk_pin: 15
|
|
i2s_lrclk_pin: 16
|
|
i2s_bclk_pin: 17
|
|
|
|
speaker:
|
|
- platform: i2s_audio
|
|
id: speaker_id
|
|
dac_type: external
|
|
i2s_dout_pin: 12
|
|
sample_rate: 16000
|
|
|
|
media_player:
|
|
- platform: speaker
|
|
id: speaker_media_player
|
|
name: Media Player
|
|
speaker: speaker_id
|
|
sample_rate: 16000
|
|
volume_increment: 0.02
|
|
volume_min: 0.0
|
|
volume_max: 1.0
|
|
files:
|
|
- id: wake_word_trigger_sound
|
|
file: https://github.com/esphome/home-assistant-voice-pe/raw/dev/sounds/wake_word_triggered.flac
|
|
on_mute:
|
|
- wait_until:
|
|
media_player.is_idle:
|
|
on_unmute:
|
|
- wait_until:
|
|
media_player.is_idle:
|
|
on_volume:
|
|
- speaker_media_player.set_ducking:
|
|
decibel_reduction: 20
|
|
duration: 0.0s
|
|
- wait_until:
|
|
media_player.is_idle:
|
|
- speaker_media_player.set_ducking:
|
|
decibel_reduction: 0
|
|
duration: 2.0s
|