Skip to content

Instantly share code, notes, and snippets.

@cassidyjames
Last active June 2, 2026 13:40
Show Gist options
  • Select an option

  • Save cassidyjames/270f877c359f082c1c587c20d03467d4 to your computer and use it in GitHub Desktop.

Select an option

Save cassidyjames/270f877c359f082c1c587c20d03467d4 to your computer and use it in GitHub Desktop.
Coin Toss blueprint for Home Assistant
blueprint:
name: Coin Toss
description: Flip a coin in response to common voice prompts, like “flip a coin” or “heads or tails.” If triggered from a voice satellite, play a little coin toss sound effect as well.
domain: automation
input:
sound_effect:
name: Sound Effect
description: Sound to be played before answering when triggered by a Voice Assist satellite
selector:
media:
accept:
- audio/*
triggers:
- trigger: conversation
command:
- (flip|toss|throw) [me|us] [a] coin [for] [me|us]
- "[what] [is it] (heads|head) or (tails|tail)"
- "[what] [is it] (tails|tail) or (heads|head)"
- fifty fifty
- (do|give) [me|us] [a] coin (flip|toss|throw) [for] [me|us]
conditions: []
actions:
- variables:
prefix: |
{{ [
"It's ",
"You flipped ",
"You got ",
"Looks like… ",
"It landed on"
] | random }}
result: |
{{ [
"heads",
"tails"
] | random }}
response: "{{ prefix ~ ' ' ~ result }}"
- variables:
satellite: |
{% set ents = device_entities(trigger.device_id)
| select('match', 'assist_satellite\\.')
| list %}
{{ ents[0] if ents else none }}
- if:
- condition: template
value_template: "{{ trigger.device_id is not none }}"
enabled: true
- condition: template
value_template: "{{ satellite is not none }}"
then:
- action: assist_satellite.announce
data:
message: "{{ response }}"
preannounce: true
preannounce_media_id: !input sound_effect
target:
entity_id: "{{ satellite }}"
else:
- set_conversation_response: "{{ response }}"
@cassidyjames

Copy link
Copy Markdown
Author

Import to Home Assistant by copying the raw link to the yml file, or just hit this button:

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment