Last active
April 20, 2025 11:01
-
-
Save ndom91/b66d508960dd8587da52aad26c85b15e to your computer and use it in GitHub Desktop.
Voice PE - Pause Media while Listening
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias: Voice PE - Pause TV when Voice PE Listening | |
description: "In order to improve voice command recognition, pause any media players playing in the background while listening for a command." | |
triggers: | |
- trigger: state | |
entity_id: | |
- assist_satellite.home_assistant_voice_090de2_assist_satellite # Voice PE Satellite entity | |
to: listening | |
conditions: | |
- condition: not | |
conditions: | |
- condition: state | |
entity_id: assist_satellite.home_assistant_voice_090de2_assist_satellite # Voice PE Satellite entity | |
state: idle | |
- condition: state | |
entity_id: assist_satellite.home_assistant_voice_090de2_assist_satellite # Voice PE Satellite entity | |
state: unavailable | |
- condition: state | |
entity_id: assist_satellite.home_assistant_voice_090de2_assist_satellite # Voice PE Satellite entity | |
state: unknown | |
actions: | |
- alias: If TV is playing; Pause until Voice Action complete | |
if: | |
- condition: state | |
entity_id: media_player.livingroom_tv_001 # Media Player entity_id | |
state: playing | |
then: | |
- action: media_player.media_pause | |
target: | |
entity_id: media_player.livingroom_tv_001 # Media Player entity_id | |
- wait_for_trigger: | |
- trigger: state | |
entity_id: assist_satellite.home_assistant_voice_090de2_assist_satellite # Voice PE Satellite entity | |
to: idle | |
timeout: | |
hours: 0 | |
minutes: 0 | |
seconds: 20 | |
milliseconds: 0 | |
enabled: true | |
- action: media_player.media_play | |
target: | |
entity_id: media_player.livingroom_tv_001 # Media Player entity_id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To use, create a new automation in the UI. Click the three-dot overflow menu and select "Edit in YAML" and replace all of the existing content with the script above.
Don't forget to replace the entities with yours. I've highlighted those that need to be replaced with a comment describing what you'll need afterwards.
Feel free to share any cool modifications you come up with 😊