Assistant now working with speaker component, still issues with volume and LED.
This commit is contained in:
parent
e44ec663f0
commit
40e18e493b
@ -1 +1 @@
|
|||||||
2023.5.2
|
2023.5.4
|
@ -21,11 +21,18 @@ wifi:
|
|||||||
password: !secret fallback_psk
|
password: !secret fallback_psk
|
||||||
|
|
||||||
esphome:
|
esphome:
|
||||||
name: "${name}"
|
name: ${name}
|
||||||
|
friendly_name: ${friendly_name}
|
||||||
name_add_mac_suffix: false
|
name_add_mac_suffix: false
|
||||||
project:
|
project:
|
||||||
name: raspiaudio.muse-luxe
|
name: raspiaudio.muse-luxe
|
||||||
version: "1.0"
|
version: "1.0"
|
||||||
|
min_version: 2023.5.0
|
||||||
|
on_boot:
|
||||||
|
then:
|
||||||
|
- media_player.volume_set:
|
||||||
|
id: luxe_out
|
||||||
|
volume: 50%
|
||||||
|
|
||||||
esp32:
|
esp32:
|
||||||
board: esp-wrover-kit
|
board: esp-wrover-kit
|
||||||
@ -46,17 +53,20 @@ captive_portal:
|
|||||||
improv_serial:
|
improv_serial:
|
||||||
|
|
||||||
external_components:
|
external_components:
|
||||||
- source: github://pr#3552
|
- source: github://pr#3552 # DAC support https://github.com/esphome/esphome/pull/3552
|
||||||
components: [es8388]
|
components: [es8388]
|
||||||
refresh: 0s
|
refresh: 0s
|
||||||
|
|
||||||
|
es8388:
|
||||||
|
|
||||||
i2s_audio:
|
i2s_audio:
|
||||||
- i2s_lrclk_pin: GPIO25
|
- i2s_lrclk_pin: GPIO25
|
||||||
i2s_bclk_pin: GPIO5
|
i2s_bclk_pin: GPIO5
|
||||||
|
|
||||||
media_player:
|
media_player:
|
||||||
- platform: i2s_audio
|
- platform: i2s_audio
|
||||||
name: ${friendly_name}
|
name: None
|
||||||
|
id: luxe_out
|
||||||
dac_type: external
|
dac_type: external
|
||||||
i2s_dout_pin: GPIO26
|
i2s_dout_pin: GPIO26
|
||||||
mode: stereo
|
mode: stereo
|
||||||
@ -64,15 +74,68 @@ media_player:
|
|||||||
number: GPIO21
|
number: GPIO21
|
||||||
inverted: true
|
inverted: true
|
||||||
|
|
||||||
es8388:
|
speaker:
|
||||||
|
- platform: i2s_audio
|
||||||
|
id: luxe_out_speaker
|
||||||
|
dac_type: external
|
||||||
|
i2s_dout_pin: GPIO26
|
||||||
|
mode: stereo
|
||||||
|
|
||||||
|
microphone:
|
||||||
|
- platform: i2s_audio
|
||||||
|
id: luxe_microphone
|
||||||
|
i2s_din_pin: GPIO35
|
||||||
|
adc_type: external
|
||||||
|
pdm: false
|
||||||
|
|
||||||
|
voice_assistant:
|
||||||
|
microphone: luxe_microphone
|
||||||
|
speaker: luxe_out_speaker
|
||||||
|
on_start:
|
||||||
|
- light.turn_on:
|
||||||
|
id: top_led
|
||||||
|
blue: 100%
|
||||||
|
red: 0%
|
||||||
|
green: 0%
|
||||||
|
effect: none
|
||||||
|
on_tts_start:
|
||||||
|
- light.turn_on:
|
||||||
|
id: top_led
|
||||||
|
blue: 60%
|
||||||
|
red: 20%
|
||||||
|
green: 20%
|
||||||
|
effect: none
|
||||||
|
on_tts_end:
|
||||||
|
- light.turn_on:
|
||||||
|
id: top_led
|
||||||
|
blue: 60%
|
||||||
|
red: 20%
|
||||||
|
green: 20%
|
||||||
|
effect: pulse
|
||||||
|
on_end:
|
||||||
|
- delay: 1s
|
||||||
|
- wait_until:
|
||||||
|
not:
|
||||||
|
speaker.is_playing: luxe_out_speaker
|
||||||
|
- light.turn_off: top_led
|
||||||
|
on_error:
|
||||||
|
- light.turn_on:
|
||||||
|
id: top_led
|
||||||
|
blue: 0%
|
||||||
|
red: 100%
|
||||||
|
green: 0%
|
||||||
|
effect: none
|
||||||
|
- delay: 1s
|
||||||
|
- light.turn_off: top_led
|
||||||
|
|
||||||
sensor:
|
sensor:
|
||||||
- platform: adc
|
- platform: adc
|
||||||
pin: GPIO33
|
pin: GPIO33
|
||||||
name: ${name} Battery
|
name: Battery
|
||||||
icon: "mdi:battery-outline"
|
icon: "mdi:battery-outline"
|
||||||
device_class: voltage
|
device_class: voltage
|
||||||
state_class: measurement
|
state_class: measurement
|
||||||
|
entity_category: diagnostic
|
||||||
unit_of_measurement: V
|
unit_of_measurement: V
|
||||||
update_interval: 15s
|
update_interval: 15s
|
||||||
accuracy_decimals: 3
|
accuracy_decimals: 3
|
||||||
@ -93,9 +156,9 @@ binary_sensor:
|
|||||||
mode:
|
mode:
|
||||||
input: true
|
input: true
|
||||||
pullup: true
|
pullup: true
|
||||||
name: ${friendly_name} Volume Up
|
name: Volume Up
|
||||||
on_click:
|
on_click:
|
||||||
- media_player.volume_up:
|
- media_player.volume_up: luxe_out
|
||||||
- platform: gpio
|
- platform: gpio
|
||||||
pin:
|
pin:
|
||||||
number: GPIO32
|
number: GPIO32
|
||||||
@ -103,9 +166,9 @@ binary_sensor:
|
|||||||
mode:
|
mode:
|
||||||
input: true
|
input: true
|
||||||
pullup: true
|
pullup: true
|
||||||
name: ${friendly_name} Volume Down
|
name: Volume Down
|
||||||
on_click:
|
on_click:
|
||||||
- media_player.volume_down:
|
- media_player.volume_down: luxe_out
|
||||||
- platform: gpio
|
- platform: gpio
|
||||||
pin:
|
pin:
|
||||||
number: GPIO12
|
number: GPIO12
|
||||||
@ -113,23 +176,33 @@ binary_sensor:
|
|||||||
mode:
|
mode:
|
||||||
input: true
|
input: true
|
||||||
pullup: true
|
pullup: true
|
||||||
name: ${friendly_name} Play Button
|
name: Action
|
||||||
on_press:
|
on_multi_click:
|
||||||
|
- timing:
|
||||||
|
- ON FOR AT MOST 350ms
|
||||||
|
- OFF FOR AT LEAST 10ms
|
||||||
|
then:
|
||||||
|
- media_player.toggle: luxe_out
|
||||||
|
- timing:
|
||||||
|
- ON FOR AT LEAST 350ms
|
||||||
|
then:
|
||||||
- voice_assistant.start:
|
- voice_assistant.start:
|
||||||
on_release:
|
- timing:
|
||||||
|
- ON FOR AT LEAST 350ms
|
||||||
|
- OFF FOR AT LEAST 10ms
|
||||||
|
then:
|
||||||
- voice_assistant.stop:
|
- voice_assistant.stop:
|
||||||
|
|
||||||
light:
|
light:
|
||||||
- platform: fastled_clockless
|
- platform: fastled_clockless
|
||||||
name: ${friendly_name}
|
name: None
|
||||||
|
id: top_led
|
||||||
pin: GPIO22
|
pin: GPIO22
|
||||||
chipset: SK6812
|
chipset: SK6812
|
||||||
num_leds: 1
|
num_leds: 1
|
||||||
rgb_order: grb
|
rgb_order: grb
|
||||||
|
gamma_correct: 2.8
|
||||||
microphone:
|
effects:
|
||||||
- platform: i2s_audio
|
- pulse:
|
||||||
id: lux_microphone
|
transition_length: 250ms
|
||||||
i2s_din_pin: GPIO35
|
update_interval: 250ms
|
||||||
|
|
||||||
voice_assistant:
|
|
||||||
microphone: lux_microphone
|
|
||||||
|
Loading…
Reference in New Issue
Block a user