This is an automated archive made by the Lemmit Bot.

The original was posted on /r/homeassistant by /u/ByzantiumIT on 2024-11-16 08:19:28+00:00.


🏠 Smart Morning Briefing: My Home Assistant automation that turns my Sonos into a smart AI assistant when I enter the kitchen (7-8 AM). It gives personalized updates about weather ⛅, solar production ☀️, battery levels 🔋, energy costs 💰, bin collection days 🗑️, dad’s location 📍, dishwasher status 🍽️, and even reminds about PE kit days for the kids 🎒! Uses OpenAI for natural conversation and Shimmer TTS for a human-like voice 🗣️

Automation extract:

alias: Morning Briefing - AI Assistant
description: Provides a daily morning briefing when motion is detected in the kitchen
triggers:
  - entity_id: binary_sensor.kitchen_presence_sensor_presence
    from: "off"
    to: "on"
    trigger: state
conditions:
  - condition: state
    entity_id: input_boolean.daily_briefing
    state: "on"
  - condition: time
    after: "07:00:00"
    before: "08:00:00"
    weekday:
      - mon
      - tue
      - wed
      - thu
      - fri
      - sat
      - sun
actions:
  - target:
      entity_id: media_player.sonos
    data:
      volume_level: 0.5
    action: media_player.volume_set
  - metadata: {}
    data:
      entry_id: 
    enabled: true
    action: homeassistant.reload_config_entry
  - type: toggle
    device_id: 
    entity_id: 
    domain: switch
  - delay:
      hours: 0
      minutes: 0
      seconds: 2
      milliseconds: 0
    enabled: true
  - data:
      agent_id: conversation.openai_conversation_2
      text: >
        {% set greetings = ['Whats up', 'Hello', 'Hi there', 'Greetings'] %} {{
        greetings | random }}! {{ states('sensor.time_of_day') }}. It's {{
        states('sensor.day_of_week') }}. You are named Alice, providing a daily
        report. Use text only, don't leave gaps. Expand any technical acronyms.
        Please provide a concise update on the following:

        {% if states('weather.forecast_home') != 'unavailable' %} - Current
        weather conditions: {{ states('weather.forecast_home') }}, {{
        state_attr('weather.forecast_home', 'temperature') }} degrees {% endif
        %}

        [... rest of template code ...]

    enabled: true
    response_variable: ai_assistant_response
    action: conversation.process
  - action: media_player.media_stop
    metadata: {}
    data: {}
    target:
      device_id: 
    enabled: false
  - target:
      entity_id: media_player.sonos
    data:
      cache: false
      media_player_entity_id: media_player.sonos
      message: "{{ ai_assistant_response.response.speech.plain.speech }}"
    target:
      entity_id: tts.openai_tts_shimmer
    enabled: true
    action: tts.speak
  - target:
      entity_id: input_boolean.daily_briefing
    data: {}
    action: input_boolean.toggle
  - target:
      entity_id: media_player.sonos
    data:
      volume_level: 0.2
    action: media_player.volume_set