2022-09-01 13:52:07 +02:00
|
|
|
substitutions:
|
|
|
|
name: "raspiaudio-muse-luxe"
|
2023-05-01 20:57:16 +02:00
|
|
|
friendly_name: "RaspiAudio Muse Luxe"
|
|
|
|
|
|
|
|
# Enable Home Assistant API
|
|
|
|
api:
|
|
|
|
encryption:
|
|
|
|
key: !secret apikey
|
|
|
|
ota:
|
|
|
|
password: !secret ota
|
|
|
|
|
2022-09-01 13:52:07 +02:00
|
|
|
wifi:
|
2022-12-17 11:49:09 +01:00
|
|
|
ssid: Voltage-legacy
|
|
|
|
password: !secret voltage_legacy_psk
|
2023-05-27 16:52:05 +02:00
|
|
|
use_address: ${name}.home
|
2022-09-01 15:25:46 +02:00
|
|
|
power_save_mode: high
|
|
|
|
fast_connect: on
|
|
|
|
# Enable fallback hotspot (captive portal) in case wifi connection fails
|
|
|
|
ap:
|
|
|
|
ssid: "Raspiaudio Fallback Hotspot"
|
|
|
|
password: !secret fallback_psk
|
|
|
|
|
2023-05-04 10:15:16 +02:00
|
|
|
esphome:
|
2023-05-27 15:29:36 +02:00
|
|
|
name: ${name}
|
|
|
|
friendly_name: ${friendly_name}
|
2023-05-04 10:15:16 +02:00
|
|
|
name_add_mac_suffix: false
|
|
|
|
project:
|
|
|
|
name: raspiaudio.muse-luxe
|
|
|
|
version: "1.0"
|
2023-05-27 15:29:36 +02:00
|
|
|
min_version: 2023.5.0
|
|
|
|
on_boot:
|
|
|
|
then:
|
|
|
|
- media_player.volume_set:
|
|
|
|
id: luxe_out
|
|
|
|
volume: 50%
|
2023-05-04 10:15:16 +02:00
|
|
|
|
|
|
|
esp32:
|
|
|
|
board: esp-wrover-kit
|
|
|
|
framework:
|
|
|
|
type: arduino
|
|
|
|
|
|
|
|
logger:
|
|
|
|
|
|
|
|
i2c:
|
|
|
|
sda: GPIO18
|
|
|
|
scl: GPIO23
|
|
|
|
|
|
|
|
dashboard_import:
|
|
|
|
package_import_url: github://esphome/media-players/raspiaudio-muse-luxe.yaml@main
|
|
|
|
|
2023-05-01 20:57:16 +02:00
|
|
|
captive_portal:
|
2022-09-01 15:25:46 +02:00
|
|
|
|
2023-05-01 20:57:16 +02:00
|
|
|
improv_serial:
|
|
|
|
|
|
|
|
external_components:
|
2023-05-27 15:29:36 +02:00
|
|
|
- source: github://pr#3552 # DAC support https://github.com/esphome/esphome/pull/3552
|
2023-05-01 20:57:16 +02:00
|
|
|
components: [es8388]
|
|
|
|
refresh: 0s
|
|
|
|
|
2023-05-27 15:29:36 +02:00
|
|
|
es8388:
|
|
|
|
|
2023-05-01 20:57:16 +02:00
|
|
|
i2s_audio:
|
2023-05-04 10:15:16 +02:00
|
|
|
- i2s_lrclk_pin: GPIO25
|
|
|
|
i2s_bclk_pin: GPIO5
|
2023-05-01 20:57:16 +02:00
|
|
|
|
|
|
|
media_player:
|
|
|
|
- platform: i2s_audio
|
2023-05-27 15:29:36 +02:00
|
|
|
name: None
|
|
|
|
id: luxe_out
|
2023-05-01 20:57:16 +02:00
|
|
|
dac_type: external
|
|
|
|
i2s_dout_pin: GPIO26
|
|
|
|
mode: stereo
|
|
|
|
mute_pin:
|
|
|
|
number: GPIO21
|
|
|
|
inverted: true
|
|
|
|
|
2023-05-27 15:29:36 +02:00
|
|
|
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
|
2022-09-01 15:25:46 +02:00
|
|
|
|
|
|
|
sensor:
|
2023-05-27 15:29:36 +02:00
|
|
|
- platform: adc
|
|
|
|
pin: GPIO33
|
|
|
|
name: Battery
|
|
|
|
icon: "mdi:battery-outline"
|
|
|
|
device_class: voltage
|
|
|
|
state_class: measurement
|
|
|
|
entity_category: diagnostic
|
|
|
|
unit_of_measurement: V
|
|
|
|
update_interval: 15s
|
|
|
|
accuracy_decimals: 3
|
|
|
|
attenuation: 11db
|
|
|
|
raw: true
|
|
|
|
filters:
|
|
|
|
- multiply: 0.00173913 # 2300 -> 4, for attenuation 11db, based on Olivier's code
|
|
|
|
- exponential_moving_average:
|
|
|
|
alpha: 0.2
|
|
|
|
send_every: 2
|
|
|
|
- delta: 0.002
|
2023-05-01 20:57:16 +02:00
|
|
|
|
|
|
|
binary_sensor:
|
|
|
|
- platform: gpio
|
|
|
|
pin:
|
|
|
|
number: GPIO19
|
|
|
|
inverted: true
|
|
|
|
mode:
|
|
|
|
input: true
|
|
|
|
pullup: true
|
2023-05-27 15:29:36 +02:00
|
|
|
name: Volume Up
|
2023-05-01 20:57:16 +02:00
|
|
|
on_click:
|
2023-05-27 15:29:36 +02:00
|
|
|
- media_player.volume_up: luxe_out
|
2023-05-01 20:57:16 +02:00
|
|
|
- platform: gpio
|
|
|
|
pin:
|
|
|
|
number: GPIO32
|
|
|
|
inverted: true
|
|
|
|
mode:
|
|
|
|
input: true
|
|
|
|
pullup: true
|
2023-05-27 15:29:36 +02:00
|
|
|
name: Volume Down
|
2023-05-01 20:57:16 +02:00
|
|
|
on_click:
|
2023-05-27 15:29:36 +02:00
|
|
|
- media_player.volume_down: luxe_out
|
2023-05-01 20:57:16 +02:00
|
|
|
- platform: gpio
|
|
|
|
pin:
|
|
|
|
number: GPIO12
|
|
|
|
inverted: true
|
|
|
|
mode:
|
|
|
|
input: true
|
|
|
|
pullup: true
|
2023-05-27 15:29:36 +02:00
|
|
|
name: Action
|
|
|
|
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:
|
|
|
|
- timing:
|
|
|
|
- ON FOR AT LEAST 350ms
|
|
|
|
- OFF FOR AT LEAST 10ms
|
|
|
|
then:
|
|
|
|
- voice_assistant.stop:
|
|
|
|
|
2023-05-01 20:57:16 +02:00
|
|
|
light:
|
|
|
|
- platform: fastled_clockless
|
2023-05-27 15:29:36 +02:00
|
|
|
name: None
|
|
|
|
id: top_led
|
2023-05-01 20:57:16 +02:00
|
|
|
pin: GPIO22
|
|
|
|
chipset: SK6812
|
|
|
|
num_leds: 1
|
|
|
|
rgb_order: grb
|
2023-05-27 15:29:36 +02:00
|
|
|
gamma_correct: 2.8
|
|
|
|
effects:
|
|
|
|
- pulse:
|
|
|
|
transition_length: 250ms
|
|
|
|
update_interval: 250ms
|