Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 34 additions & 15 deletions home-assistant-voice.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,9 @@ binary_sensor:
condition:
lambda: return !id(init_in_progress) && !id(color_changed) && !id(group_volume_changed);
then:
- event.trigger:
id: button_press_event
event_type: "single_press"
- if:
condition:
switch.is_on: timer_ringing
Expand All @@ -324,24 +327,29 @@ binary_sensor:
else:
- if:
condition:
media_player.is_playing:
id: external_media_player
lambda: return id(center_button_control).state == "Assistant";
then:
- media_player.pause:
id: external_media_player
else:
- if:
condition:
and:
- switch.is_off: master_mute_switch
- not: voice_assistant.is_running
media_player.is_playing:
id: external_media_player
then:
- script.execute:
id: play_sound
priority: true
sound_file: "center_button_press_sound"
- delay: 300ms
- voice_assistant.start:
- media_player.pause:
id: external_media_player
else:
- if:
condition:
and:
- switch.is_off: master_mute_switch
- not: voice_assistant.is_running
then:
- script.execute:
id: play_sound
priority: true
sound_file: "center_button_press_sound"
- delay: 300ms
- voice_assistant.start:

# Double Click
# . Exposed as an event entity. To be used in automations inside Home Assistant
- timing:
Expand Down Expand Up @@ -1011,13 +1019,13 @@ sensor:

event:
# Event entity exposed to the user to automate on complex center button presses.
# The simple press is not exposed as it is used to control the device itself.
- platform: template
id: button_press_event
name: "Button press"
icon: mdi:button-pointer
device_class: button
event_types:
- single_press
- double_press
- triple_press
- long_press
Expand Down Expand Up @@ -1795,6 +1803,17 @@ select:
id(hey_mycroft).set_probability_cutoff(237); // 0.93 -> 1.878 FAPH on DipCo
}

- platform: template
name: "Center Button Action"
optimistic: true
initial_option: Assistant
restore_value: true
entity_category: config
id: center_button_control
options:
- Assistant
- Event

voice_assistant:
id: va
microphone:
Expand Down