ESPHome Play RTTTL Script Blueprint

This blueprint aims to make it easy to create scripts that can play a selected RTTTL tune from a collection of tunes on one or more devices. Separate scripts can be created for specific collections of tunes or for specific purposes.

Example Uses:

  • Name the tunes for certain appliances, then create an automation that calls the script when the appliances finish their cycle.
  • Have tunes named for specific people in your house, so a distinct notification tune plays when each person comes home.

This blueprint was originally designed to be used with the ESPHome Starter Kit from Apollo Automation, but it should be compatible with any device using the ESPHome RTTTL component, as long as you add the required API action to it’s configuration.

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


https://gist.github.com/Didgeridrew/11d76d824fb2dd4292cdb47e2b1d4c5e

Usage Examples:

YAML Config
use_blueprint:
  path: Didgeridrew/esphome_play_rtttl.yaml
  input:
    rtttl_action:
      - action: esphome.esphome_starter_play_rtttl
        metadata: {}
        data: {}
    tune_collection:
      - name: Washing Machine
        rtttl_code: the_irish_washerwoman:d=4,o=6,b=140:8d,8c,8b5,8g5,8g5,8d5,8g5,8g5,8b5,8g5,8b5,8d,8c,8b5,8c,8a5,8a5,8e5,8a5,8a5,8c,8b5,8c,8e,8d,8c,8b5,8g5,8g5,8d5,8g5,8g5,8b5,8g5,8b5,8d,8c,8b5,8c,8b5,8c,8a5,8d,8c,8b5,8g5,8g5,g5          
      - name: Dryer
        rtttl_code: baa_baa_blacksheep:d=4,o=6,b=56:8c5,8c5,8g5,8g5,16a5,16c,16c,16a5,g5,8f5,8f5,8e5,8e5,8d5,8d5,8c5          
      - name: Dish Washer
        rtttl_code: bleepy_crescendo:d=4,o=6,b=125:32c7,32d7,32e7,32p,32c#6,32d#6,32f6,32p,32d7,32e7,32f#7,32p,32d#6,32f6,32g6,32p,32e7,32f#7,32g#7,32a#7
alias: ESPHome Play RTTTL Appliances
description: ""

Automation using above script to play specific tune when appliance cycle finishes:

triggers:
  - id: Washing Machine
    trigger: state
    entity_id: sensor.washing_machine_current_phase
    to: finished
  - id: Dryer
    trigger: state
    entity_id: sensor.dryer_current_phase
    to: finished
  - id: Dish Washer
    trigger: state
    entity_id: sensor.dishwasher_current_phase
    to: finished
action:
  - action: script.esphome_play_rtttl_appliances
    data:
      tune: "{{ trigger.id }}"    



  • This Post has been set to Wiki Mode. Please feel free edit this post to add configuration examples if you think they might be helpful to other users.