###################################################################### # @CCOSTAN - Follow Me on X # For more info visit https://www.vcloudinfo.com/click-here # Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig # ------------------------------------------------------------------- # Speech Engine Script - queued announcements to Chromecast targets # Sends templated speech briefings to media players when family/guests are home. # ------------------------------------------------------------------- # Notes: Optional call_* flags control sections (dark_outside, window/garage checks, garbage day, inside/outside weather). Defaults to living room Chromecast if no media_player is provided. ###################################################################### # Usage example: # service: script.speech_engine # data: # call_no_announcement: 1 # call_dark_outside: 1 # call_window_check: 1 # call_garage_check: 1 # call_garbage_day: 1 # call_inside_weather: 1 # call_outside_weather: 1 # Define the "speech_engine" script speech_engine: # Set the mode to "queued" mode: queued # Define the sequence of actions to be performed sequence: # If the state of the "group.family" entity is "home" or the state of the "input_boolean.guest_mode" entity is "on", proceed with the script - condition: or conditions: - condition: state entity_id: group.family state: 'home' - condition: state entity_id: input_boolean.guest_mode state: 'on' # Run the "script.speech_processing" service with the specified media player and speech message - service: script.speech_processing data: # Set the entity ID for the media players to be controlled # If the "media_player" variable is not defined, set it to a list of media player entities # If the "media_player" variable is a list, convert it to a comma-separated string media_player: >- {% if media_player | length == 0 %} {% set media_player = [ 'media_player.livingroomcc' ] %} {% endif %} {% if media_player is not string and media_player is sequence %} {% set media_player = media_player|join(', ') %} {% endif %} {{ media_player }} # Include the speech message from the "speech/briefing.yaml" template file speech_message: !include ../templates/speech/briefing.yaml # Turn off the "input_boolean.home_stats" - service: input_boolean.turn_off data: entity_id: - input_boolean.home_stats