#-------------------------------------------
# Guest Mode Announcements
# Description: Manages audio announcements for guest mode activation and deactivation
#
# Features:
# - Announces when guest mode is enabled
# - Provides weather summary for guests
# - Resets guest mode when family returns home
#
# Integration: Uses speech_engine script for announcements
# uses ChromeCast for audio output
# Follow me on https://www.vcloudinfo.com/click-here
#-------------------------------------------
- alias: 'Guest Mode Audio Feedback'
  id: 3622ba04-9a28-4c02-807c-be4abc663fe0

  trigger:
    - platform: state
      entity_id:
        - input_boolean.guest_mode
      from: 'off'
      to: 'on'

  action:
    - service: script.speech_engine
      data:
        value1: >
          Guest Mode has been enabled. Must be a party. [Summarize the weather for our guests]
        call_no_announcement: 1
        call_inside_weather: 1
        call_outside_weather: 1
        call_garage_check: 1
        call_window_check: 1

- alias: 'Guest Mode Reset'
  id: b4434ffd-476b-4d79-bd9d-65222883f9da

  trigger:
    - platform: state
      entity_id:
        - group.family
      from: 'not_home'
      to: 'home'

  condition:
    - condition: state
      entity_id: input_boolean.guest_mode
      state: 'on'

  action:
    - service: input_boolean.turn_off
      entity_id:
        - input_boolean.guest_mode
    - service: script.speech_engine
      data:
        value1: >-
          Guest Mode has been disabled and normal automations will continue.
        call_no_announcement: 1