-
Notifications
You must be signed in to change notification settings - Fork 0
/
fireremote-voice.yaml
157 lines (148 loc) · 3.63 KB
/
fireremote-voice.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
esphome:
name: fireremote-voice
platform: ESP32
board: m5stack-fire
# on_boot:
# priority: 600.0
# then:
# - delay: 45s
# - if:
# condition:
# not:
# - wifi.connected:
# then:
# - switch.turn_on: sleep_toggle
logger:
api:
ota:
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
fast_connect: true
id: wifi_id
ap:
ssid: "${friendly_name} Fallback"
password: !secret wifi_fallback_password
external_components:
- source:
type: git
url: https://github.com/ssieb/custom_components
# type: local
# path: ../ssieb_custom_components/components
components: [ ip5306 ]
packages:
# home_media_player: !include homeConfig/media_player_light.yaml
# home_light: !include homeConfig/light.yaml
# home_switch: !include homeConfig/switch.yaml
# ip5306: !include ../homeThing/common/m5stack-fire/ip5306.yaml
# device_base: !include ../homeThing/common/device_base.yaml
# fonts: !include ../homeThing/common/fonts.yaml
# icon_fonts: !include ../homeThing/common/icon_fonts.yaml
# images: !include ../homeThing/common/images.yaml
# settings: !include ../homeThing/common/settings.yaml
remote_package:
url: https://github.com/landonr/homeThing
ref: main
files: [
common/m5stack-fire/ip5306.yaml, # power management and screen backlight
# common/m5stack-fire/sleep.yaml, # deep sleep
# common/m5stack-fire/binary_sensor.yaml, # buttons
common/m5stack-fire/backlight.yaml, # backlight
common/m5stack-fire/sidelight.yaml, # sidelight
# common/UnitEncoderC.yaml, # encoder
]
refresh: 0s
binary_sensor:
- platform: gpio
id: M5_BtnB
pin:
number: 38
inverted: true
on_multi_click:
- timing:
- ON FOR AT MOST 350ms
- OFF FOR AT LEAST 10ms
then:
- media_player.toggle: media_player_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:
spi:
clk_pin: 18
mosi_pin: 23
miso_pin: 19
i2s_audio:
i2s_lrclk_pin: GPIO13
# i2s_bclk_pin: GPIO32
# i2s_mclk_pin: GPIO0
microphone:
- platform: i2s_audio
adc_pin: GPIO34
adc_type: internal
id: adc_mic
media_player:
- platform: i2s_audio
name: "${friendly_name} Internal Media Player"
id: media_player_out
dac_type: internal
mode: right
voice_assistant:
microphone: adc_mic
on_start:
# - media_player.stop:
# id: media_player_out
- light.turn_on:
id: side_light
blue: 100%
red: 0%
green: 0%
effect: none
on_tts_start:
- light.turn_on:
id: side_light
blue: 60%
red: 20%
green: 20%
effect: none
on_tts_end:
# - media_player.play_media:
# id: media_player_out
# media_url: !lambda return x;
- light.turn_on:
id: side_light
blue: 60%
red: 20%
green: 20%
effect: pulse
on_end:
# - delay: 1s
# - wait_until:
# not:
# media_player.is_playing: media_player_out
- light.turn_off: side_light
on_error:
- light.turn_on:
id: side_light
blue: 0%
red: 100%
green: 0%
effect: none
- delay: 1s
- light.turn_off: side_light
display:
- platform: ili9xxx
model: M5STACK
cs_pin: 14
dc_pin: 27
reset_pin: 33
id: my_display
update_interval: 3600s
lambda: |-
// id(homeThingMenu)->draw_menu_screen();
return;