Skip to content

Instantly share code, notes, and snippets.

@Snipercaine
Last active July 18, 2023 13:39
Show Gist options
  • Save Snipercaine/977007fb28ef135c15090b0ed9a25323 to your computer and use it in GitHub Desktop.
Save Snipercaine/977007fb28ef135c15090b0ed9a25323 to your computer and use it in GitHub Desktop.
esphome:
name: esphome-web-e70e3c
friendly_name: D2G Voice Beta
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Esphome-Web-E70E3C"
password: ""
captive_portal:
# Paste everything below for Dig2Go Voice Assistant and Magic Box :)
web_server:
port: 80
i2s_audio:
- id: bus0
i2s_lrclk_pin: GPIO4
i2s_bclk_pin: GPIO18
- id: bus1
i2s_lrclk_pin: GPIO21
i2s_bclk_pin: GPIO22
microphone:
- platform: i2s_audio
adc_type: external
pdm: false
id: mic
i2s_audio_id: bus0
i2s_din_pin: GPIO19
voice_assistant:
microphone: mic
on_tts_end:
- media_player.play_media: !lambda return x;
binary_sensor:
- platform: gpio
pin:
number: GPIO0
inverted: true
name: Button
id: d2g_button
on_press:
- voice_assistant.start:
on_release:
- voice_assistant.stop:
on_click:
- media_player.toggle: media_out
media_player:
- platform: i2s_audio
id: media_out
name: Speaker
dac_type: external
i2s_audio_id: bus1
i2s_dout_pin: GPIO25
mode: stereo
light:
- platform: fastled_clockless
id: led
name: None
pin: GPIO16
chipset: WS2812
num_leds: 15
rgb_order: grb
effects:
- addressable_rainbow:
- addressable_color_wipe:
- addressable_flicker:
- addressable_fireworks:
- addressable_scan:
- random:
- flicker:
- addressable_random_twinkle:
- strobe:
switch:
- platform: gpio
id: power
pin:
number: GPIO12
restore_mode: ALWAYS_ON
servo:
- id: d2g_voice_servo
output: mb_pwm_output
output:
- platform: ledc # On ESP32, use ledc output
id: mb_pwm_output
pin: GPIO23
frequency: 50 Hz
number:
- platform: template
name: Servo
min_value: -100
max_value: 100
step: 1
optimistic: true
set_action:
then:
- servo.write:
id: d2g_voice_servo
level: !lambda 'return x / 100.0;'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment