Skip to content

Instantly share code, notes, and snippets.

@yougotborked
Last active March 9, 2025 17:23
Show Gist options
  • Save yougotborked/5f3270e8fc6da9f82f72832cc48946a1 to your computer and use it in GitHub Desktop.
Save yougotborked/5f3270e8fc6da9f82f72832cc48946a1 to your computer and use it in GitHub Desktop.
blueprint:
name: Tuya Zigbee Siren/Doorbell
description: "Set Tuya Zigbee sirens to play a selected melody before activating them."
domain: script
input:
devices:
name: Tuya Zigbee Devices
description: "Select the sirens/doorbells to control."
selector:
device:
integration: zha
multiple: true
melody:
name: Melody
description: "Choose the melody to play."
selector:
select:
options:
- Melody 00 (Doorbell Chime)
- Melody 01 (Fur Elise)
- Melody 02 (Westminster Chimes)
- Melody 03 (Fast double door bell)
- Melody 04 (William Tell Overture)
- Melody 05 (Turkish March)
- Melody 06 (Safe/Security Alarm)
- Melody 07 (Chemical Spill Alert)
- Melody 08 (Piercing Alarm Clock)
- Melody 09 (Smoke Alarm)
- Melody 10 (Dog Barking)
- Melody 11 (Police Siren)
- Melody 12 (Doorbell Chime reverb)
- Melody 13 (Mechanical Telephone)
- Melody 14 (Fire/Ambulance)
- Melody 15 (3/1 Elevator)
- Melody 16 (Buzzing Alarm Clock)
- Melody 17 (School Bell)
duration:
name: Duration (seconds)
description: "How long the sound should play."
default: 15
selector:
number:
min: 1
max: 60
step: 1
volume:
name: Volume
description: "Set the volume level."
selector:
select:
options:
- Low
- Medium
- High
sequence:
- repeat:
for_each: "{{ devices | list }}"
sequence:
- service: number.set_value
data:
value: "{{ duration }}"
target:
device_id: "{{ repeat.item }}"
entity_id: "{{ device_entities(repeat.item) | select('search', 'duration') | list | first }}"
- service: select.select_option
data:
option: "{{ volume }}"
target:
device_id: "{{ repeat.item }}"
entity_id: "{{ device_entities(repeat.item) | select('search', 'volume') | list | first }}"
- service: select.select_option
data:
option: "Melody {{ melody.split(' ')[1] }}"
target:
device_id: "{{ repeat.item }}"
entity_id: "{{ device_entities(repeat.item) | select('search', 'melody') | list | first }}"
- service: switch.turn_on
target:
device_id: "{{ repeat.item }}"
entity_id: "{{ device_entities(repeat.item) | select('search', 'switch') | list | first }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment