-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathvoicePE-TaterTimer.yaml
More file actions
155 lines (142 loc) · 5.9 KB
/
voicePE-TaterTimer.yaml
File metadata and controls
155 lines (142 loc) · 5.9 KB
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
substitutions:
# DEVICE IDENTITY
firmware_version: "1.0.1"
device_name: tatervpe
friendly_name: TaterVPE
# WIFI / NETWORK
wifi_ssid: !secret wifi_ssid
wifi_password: !secret wifi_password
ha_voice_ip: "127.0.0.1" # optional - remove if not needed
# WAKE WORD CONFIG
wake_word_name: hey_tater
wake_word_model_url: https://raw.githubusercontent.com/TaterTotterson/microWakeWords/refs/heads/main/microWakeWords/hey_tater.json
# WAKE WORD SENSITIVITY (probability cutoff)
wake_cutoff_slight: "250" # ~0.98
wake_cutoff_moderate: "245" # ~0.96
wake_cutoff_very: "222" # ~0.87
# Change this to true in case you ahve a hidden SSID at home.
hidden_ssid: "false"
# Substitutions for audio files
jack_connected_sound_file: https://github.com/esphome/home-assistant-voice-pe/raw/dev/sounds/jack_connected.flac
jack_disconnected_sound_file: https://github.com/esphome/home-assistant-voice-pe/raw/dev/sounds/jack_disconnected.flac
mute_switch_on_sound_file: https://github.com/esphome/home-assistant-voice-pe/raw/dev/sounds/mute_switch_on.flac
mute_switch_off_sound_file: https://github.com/esphome/home-assistant-voice-pe/raw/dev/sounds/mute_switch_off.flac
timer_finished_sound_file: https://github.com/esphome/home-assistant-voice-pe/raw/dev/sounds/timer_finished.flac
wake_word_triggered_sound_file: https://github.com/esphome/home-assistant-voice-pe/raw/dev/sounds/wake_word_triggered.flac
center_button_press_sound_file: https://github.com/esphome/home-assistant-voice-pe/raw/dev/sounds/center_button_press.flac
center_button_double_press_sound_file: https://github.com/esphome/home-assistant-voice-pe/raw/dev/sounds/center_button_double_press.flac
center_button_triple_press_sound_file: https://github.com/esphome/home-assistant-voice-pe/raw/dev/sounds/center_button_triple_press.flac
center_button_long_press_sound_file: https://github.com/esphome/home-assistant-voice-pe/raw/dev/sounds/center_button_long_press.flac
factory_reset_initiated_sound_file: https://github.com/esphome/home-assistant-voice-pe/raw/dev/sounds/factory_reset_initiated.mp3
factory_reset_cancelled_sound_file: https://github.com/esphome/home-assistant-voice-pe/raw/dev/sounds/factory_reset_cancelled.mp3
factory_reset_confirmed_sound_file: https://github.com/esphome/home-assistant-voice-pe/raw/dev/sounds/factory_reset_confirmed.mp3
easter_egg_tick_sound_file: https://github.com/esphome/home-assistant-voice-pe/raw/dev/sounds/easter_egg_tick.mp3
easter_egg_tada_sound_file: https://github.com/esphome/home-assistant-voice-pe/raw/dev/sounds/easter_egg_tada.mp3
error_cloud_expired_sound_file: https://github.com/esphome/home-assistant-voice-pe/raw/dev/sounds/error_cloud_expired.mp3
packages:
TaterTotterson.VoicePE:
url: https://github.com/TaterTotterson/microWakeWords
ref: main
files:
- voicepe/device.yaml
- voicepe/globals.yaml
- voicepe/controls.yaml
- voicepe/lights.yaml
- voicepe/sensors_events.yaml
- voicepe/scripts.yaml
- voicepe/audio.yaml
- voicepe/voice.yaml
- voicepe/buttons.yaml
globals:
# Remote (device-local) timer total duration in seconds.
- id: remote_timer_total_seconds
type: int
restore_value: yes
initial_value: "0"
# Remote (device-local) timer remaining duration in seconds.
- id: remote_timer_remaining_seconds
type: int
restore_value: yes
initial_value: "0"
# Tracks whether the remote timer is currently running.
- id: remote_timer_running
type: bool
restore_value: yes
initial_value: "false"
interval:
- interval: 1s
then:
- if:
condition:
lambda: return id(remote_timer_running);
then:
- lambda: |-
if (id(remote_timer_remaining_seconds) > 0) {
id(remote_timer_remaining_seconds) -= 1;
}
- script.execute: control_leds
- if:
condition:
lambda: return id(remote_timer_running) && (id(remote_timer_remaining_seconds) <= 0);
then:
- lambda: |-
id(remote_timer_running) = false;
- switch.turn_on: timer_ringing
- script.execute: control_leds
number:
- platform: template
id: remote_timer_seconds
name: "VoicePE Remote Timer Seconds"
icon: mdi:timer
min_value: 0
max_value: 7200
step: 1
optimistic: true
restore_value: true
set_action:
- lambda: |-
int v = (int) x;
if (v < 0) v = 0;
id(remote_timer_total_seconds) = v;
id(remote_timer_remaining_seconds) = v;
id(control_leds).execute();
binary_sensor:
- platform: template
id: voicepe_remote_timer_running
name: "VoicePE Remote Timer Running"
device_class: running
lambda: |-
return id(remote_timer_running);
sensor:
- platform: template
id: voicepe_remote_timer_remaining_seconds
name: "VoicePE Remote Timer Remaining Seconds"
icon: mdi:timer-sand
unit_of_measurement: s
accuracy_decimals: 0
update_interval: 1s
lambda: |-
return id(remote_timer_remaining_seconds);
button:
- platform: template
id: voicepe_remote_timer_start
name: "VoicePE Remote Timer Start"
icon: mdi:play
on_press:
- lambda: |-
// Start/reset the device-local timer
id(remote_timer_remaining_seconds) = id(remote_timer_total_seconds);
id(remote_timer_running) = (id(remote_timer_remaining_seconds) > 0);
- switch.turn_off: timer_ringing
- script.execute: control_leds
- platform: template
id: voicepe_remote_timer_cancel
name: "VoicePE Remote Timer Cancel"
icon: mdi:stop
on_press:
- lambda: |-
id(remote_timer_running) = false;
id(remote_timer_total_seconds) = 0;
id(remote_timer_remaining_seconds) = 0;
- switch.turn_off: timer_ringing
- script.execute: control_leds