homeassistant-config/esphome/raspiaudio-muse-luxe.yaml

136 lines
2.5 KiB
YAML
Raw Normal View History

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
wifi:
2022-12-17 11:49:09 +01:00
ssid: Voltage-legacy
password: !secret voltage_legacy_psk
use_address: raspiaudio-muse-luxe.home
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
esphome:
name: "${name}"
name_add_mac_suffix: false
project:
name: raspiaudio.muse-luxe
version: "1.0"
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:
2023-05-01 20:57:16 +02:00
improv_serial:
external_components:
- source: github://pr#3552
components: [es8388]
refresh: 0s
i2s_audio:
- i2s_lrclk_pin: GPIO25
i2s_bclk_pin: GPIO5
2023-05-01 20:57:16 +02:00
media_player:
- platform: i2s_audio
name: ${friendly_name}
2023-05-01 20:57:16 +02:00
dac_type: external
i2s_dout_pin: GPIO26
mode: stereo
mute_pin:
number: GPIO21
inverted: true
es8388:
sensor:
- platform: adc
pin: GPIO33
name: ${name} Battery
icon: "mdi:battery-outline"
device_class: voltage
state_class: measurement
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
name: ${friendly_name} Volume Up
on_click:
- media_player.volume_up:
- platform: gpio
pin:
number: GPIO32
inverted: true
mode:
input: true
pullup: true
name: ${friendly_name} Volume Down
on_click:
- media_player.volume_down:
- platform: gpio
pin:
number: GPIO12
inverted: true
mode:
input: true
pullup: true
name: ${friendly_name} Play Button
on_press:
- voice_assistant.start:
on_release:
- voice_assistant.stop:
2023-05-01 20:57:16 +02:00
light:
- platform: fastled_clockless
name: ${friendly_name}
2023-05-01 20:57:16 +02:00
pin: GPIO22
chipset: SK6812
num_leds: 1
rgb_order: grb
microphone:
- platform: i2s_audio
id: lux_microphone
i2s_din_pin: GPIO35
voice_assistant:
microphone: lux_microphone