×

Free Chat AI Gemini in Home Assistant step by step #ChatGPT #FromZeroToHomeAutomation #16 #gemini

Welcome to the series From Zero to Automated Home. I will take you with me on an adventure of creating an automated home from scratch based on Home Assistant. I will try to upload to this series all the things that I do on my new equipment. I do everything from scratch! There will be a lot of it…
In this episode, I will show you how to add free Gemini chat, artificial intelligence from Google, to Home Assistant and how to use it. In the second part, which will be a continuation of this topic, I will add Text-to-speech and speech-to-text so that we can talk more with the AI ​​chat, and we will hear everything on the speakers in the house. If you have any questions or something does not work for you, write in the comments. Good luck!

https://youtu.be/GvoruiCq7Mg

alias: smarttube_film
description: ""
sequence:
  - action: google_generative_ai_conversation.generate_content
    metadata: {}
    data:
      prompt: >-
        Be normal. Like an assistant. "{{ range(1, 1000) | random }}" I want you to
        write a text that will be spoken when I wake up. tell me what the weather will be like, based on the following data, max temperature felt {{ states('sensor.home_maximum_temperature_realfeel_day_0') }} min
        temperature felt {{ states('sensor.home_minimum_temperature_realfeel_day_0') }}, general
        weather information {{ states('sensor.home_weather_conditions_day_0')
        }}. Say something about the temperature in my house, which is now {{
        states('sensor.corridor_t_temperature') }}, previous interesting fact
        {{ states('input_text.home_morning_routine') }}. write a completely different
        interesting fact than the previous one. max 255 characters. Write in Polish. No
        emojis. all in one paragraph, no next line characters, simple text.
    response_variable: generated_content
  - action: input_text.set_value
  data:
    entity_id: input_text.home_morning_routine
    value: "{{ generated_content.text }}"

Video in text form:

🏡 From Zero to Automated Home: Adding Magic with Google’s Gemini AI 🎩

Welcome to episode 16 of the “From Zero to Automated Home” series! Today, we’re diving into how to add a touch of magic to your smart home by integrating Google’s Gemini AI with Home Assistant – all completely free of charge! 🆓✨

Imagine this:

  • 🧺 Your assistant announces (with a bit of humor!) when the washing machine or dishwasher finishes.
  • 🌅 In the morning, you wake up to your assistant sharing the weather, your home temperature, and even a joke to brighten your day!

Sounds incredible? Let’s walk through the step-by-step process to configure this integration and use Gemini AI for fun, creative, and practical tasks. Let’s dive in! 🚀


🌟 Why Use Gemini AI in Your Smart Home?

Gemini AI is Google’s generative AI tool that can:

  • Create witty or informative announcements 🎤.
  • Respond creatively to your prompts 🤖.
  • Generate fun and practical content for your everyday routines 🗓️.

With the free version, you can get started quickly without worrying about costs. While it’s not perfect, it’s powerful enough to bring your smart home to life. 💪


🛠️ Step 1: Setting Up Gemini AI in Home Assistant

Here’s how to get Gemini AI working with Home Assistant:

1️⃣ Add the Integration

  1. Go to SettingsIntegrations → Click Add Integration ➕.
  2. Search for Google Generative AI and select it.

2️⃣ Generate an API Key 🔑

  1. You’ll need a Google account.
  2. Follow the prompts to create an API Key.
  3. Copy the key and return to Home Assistant.
  4. Paste the key, assign an area (e.g., “Home”), and finish the setup.

✅ Now, the integration is active, and you’re ready to use it!


✍️ Step 2: Customizing Gemini AI Behavior

Once integrated, you can adjust Gemini AI to fit your needs:

  1. Navigate to SettingsGoogle Generative AIConfigure ⚙️.
  2. Adjust parameters like:
    • Creativity level: Higher settings generate more unique responses 🌀.
    • Answer style: Keep responses concise and factual 📄.

🎯 Pro Tip: Include a random variable in your prompts to ensure varied responses. For example, add a random number to queries to avoid repeated answers.


🛠️ Step 3: Using Gemini AI for Smart Home Tasks

Example: Morning Routine 🌅

Create a helper for your morning routine:

  1. Go to SettingsHelpers → Add a Text Helper.
  2. Name it (e.g., “Home Morning Routine”) and set a max character length (e.g., 500).

🎯 Use this helper in scripts to store and display responses from Gemini AI.


🎭 Step 4: Building a Script for Fun and Function

Here’s how to make Gemini AI part of your scripts:

  1. Navigate to SettingsScripts → Create a new script 📜.
  2. Add actions such as:
    • Conversation Process: Send prompts like “What’s the weather today?” and get creative replies.
    • Text-to-Speech (TTS): Use the AI response for voice announcements 🎙️.

🎉 Example Prompt:
“What do you think about Home Assistant?”
✅ Response: “Home Assistant is a powerful, flexible solution for home automation!”


🌀 Advanced Features and Tips

  • Add dynamic queries: Combine multiple sensor states (e.g., weather, temperature, etc.) to create personalized messages.
  • Test and refine: Check the developer tools to see how responses update in real-time 🛠️.
  • Keep it simple: Avoid overly complex formatting to ensure smooth performance ✨.

🗒️ What’s Next?

Stay tuned for future episodes where we’ll:

  • Explore Text-to-Speech (TTS) in multiple languages 🗣️.
  • Showcase how to enhance automation with Gemini AI.

For now, try integrating Gemini AI and enjoy the creativity and fun it brings to your smart home! 🏡✨


🎬 SmartTube invites you to subscribe and explore more ways to elevate your smart home experience! Hit the bell 🔔 to stay updated.

Let us know in the comments how you plan to use Gemini AI! 💬

Post Comment