diff --git a/README.md b/README.md index f0f5187..ff01a64 100644 --- a/README.md +++ b/README.md @@ -30,13 +30,19 @@ A- Navigate to the "Automations" section. - Enter `https://github.com/lukasjakobi/ha-sync-announcement` into the "Repository" field. - Choose `Python Script` as the category and click "Add." - The repository will appear in you automations overview, click on the repository and install it via the button on the bottom right -- Run the service `python_script.reload` or reload your Home Assistant instance +- Run the service `python_script.reload` or restart your Home Assistant instance ### Manual Installation - Download the `sync_announcements.py` file. - Copy the file into the `homeassistant/python_scripts` folder in your Home Assistant installation. -- Run the service `python_script.reload` or reload your Home Assistant instance +- Run the service `python_script.reload` or restart your Home Assistant instance + +### Enabling UI support + +- Download the `services.yaml` file. +- Add the file content into the `homeassistant/python_scripts/services.yaml` file, create the file if it is not present. +- Run the service `python_script.reload` or restart your Home Assistant instance ## Running the Script - Create a service call within Home Assistant to execute the script. diff --git a/python_scripts/services.yaml b/python_scripts/services.yaml new file mode 100644 index 0000000..c366d34 --- /dev/null +++ b/python_scripts/services.yaml @@ -0,0 +1,45 @@ +sync_announcement: + name: Sync Announcement + description: Sync text-to-speech (TTS) messages across multiple media player entities + fields: + media_players: + name: Media Players + description: The media player entities to sync TTS messages to + selector: + entity: + multiple: true + filter: + domain: media_player + message: + name: Message + description: The TTS message to sync to the media players + selector: + text: + volume: + name: Volume + description: The volume to set the media player to when playing the TTS message + selector: + number: + min: 0 + max: 1 + step: 0.01 + mode: slider + unit_of_measurement: "%" + language: + name: Language + description: The language to use when playing the TTS message (e.g en-US, en-GB, fr-FR, de-DE etc.) + selector: + text: + default: en-US + volume_reset: + name: Volume Reset + description: Whether to reset the volume to its previous value after playing the TTS message + selector: + boolean: + default: false + cache: + name: Cache + description: Whether to cache the TTS message + selector: + boolean: + default: true \ No newline at end of file