Skip to content

Instantly share code, notes, and snippets.

@ludeeus
Last active February 3, 2024 14:43
Show Gist options
  • Save ludeeus/cbd7fcab70e36be31af16354e1a76201 to your computer and use it in GitHub Desktop.
Save ludeeus/cbd7fcab70e36be31af16354e1a76201 to your computer and use it in GitHub Desktop.
blueprint test
blueprint:
name: Pause Playing Media During Calls
description: >
Automatically pause the playing media when you get a call!
Currently this only works with the Home Assistant Companion app for Android.
domain: automation
input:
update_entity:
name: Update entities
description: The update entities that should be controlled
selector:
entity:
filter:
domain: update
supported_features: [update.UpdateEntityFeature.SPECIFIC_VERSION]
trigger:
platform: state
entity_id: "media_player.test"
from: idle
action:
- service: media_player.media_pause
data:
entity_id: "media_player.test"
- wait_for_trigger:
- platform: template
value_template: "{{ states[trigger.entity_id].state == 'idle' }}"
- service: media_player.media_play
data:
entity_id: "media_player.test"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment