Saturday

18 April 2026 Vol 19

I asked Gemini to write my Home Assistant automations, and it actually worked well

Home Assistant is one of the most powerful pieces of equipment out there for anyone who has smart-home electronics. It’s also one of the most complicated. Many people are willing to try it out for a while, and then will quickly bounce off in favor of the simplicity of Google Home or Alexa. Rather than tapping a few simple buttons, Home Assistant is best used by those who are willing to dive deep into their smart home ecosystem and are willing to learn YAML or Jinja2.

However, rather than scouring forum boards in search of my next smart home addition, I’ve learned that Gemini is surprisingly capable of making new Home Assistant additions. As long as I explain what I want and when I want it, HA and Gemini work hand in hand rather nicely.

gemini on smartphone screen with gemini logos.

Gemini isn’t as useless as it was when you tried it two years ago

AI that I first despised is now my Google Assistant replacement.

YAML and Jinja2 are complex

Gemini helped me get my stuff straightened out quickly

Gemini YAML code Credit: Shaun Cichacki/MUO

I spent a weekend turning an old Chromebook into a Home Assistant server. One that I could keep running at all times, and I admittedly let it just kind of rot after that point. Home Assistant is a complex beast that I didn’t dedicate enough time to in the past, but now that I’ve learned that Gemini can take my wildest ideas and make them work, I’ve been devoting a bit more time to it. One of the things that I’ve been wanting to experiment with, for example, is making it so that as long as my phone is within a specific range of my router, the TV lights in my office will turn on, and then turn off when I leave for an extended period of time.

By asking Gemini “Create me a YAML code that tells the TV lights to turn on when my phone is within 2 meters of the router, even if the TV is off,” I receive YAML code that signals to Home Assistant when I’m within the range, for a specific amount of time, and the action that it needs to take. For those with coding experience, this may not be the most impressive thing in the world, but the speed and how quickly it works astounds me. If I want to refine this even further, I could use something like an ESP32 Bluetooth proxy to get the best results overall.

For those who are interested in seeing what Gemini spit out, here is the exact YAML code it produced:

alias: "Turn on TV Lights when Phone is Near Router"
description: "Triggers TV lights when phone distance is less than 2 meters"
mode: single

trigger:
- platform: numeric_state
# Replace this with your actual phone's distance entity ID
entity_id: sensor.shauns_phone_distance
below: 2
# The 'for' prevents the lights from flickering if the signal bounces
for:
seconds: 5

action:
- action: light.turn_on
# Replace this with the actual entity ID of your TV lights
target:
entity_id: light.tv_backlights
data:
brightness_pct: 80
transition: 3

Complex requests made simple

I’ve yet to run into a roadblock with even the strangest request

When I say I like to try and create weird requests, like the aforementioned TV lights situation, I wouldn’t have the slightest idea of where to start doing something like that. My creativity far outweighs my skill level when it comes to YAML, and that’s where Gemini has come in clutch for me as of late. Seeing as I’m starting to slowly migrate out of Google Home and Alexa to see what Home Assistant can really do, I’m also curious to try and push it to the limit.

I’ve always heard that Home Assistant can do far more complex things than Google Home or Alexa, and after messing around with YAML, I can see why. Rather than just having generic triggers that will activate, I can implement wild requests. Something like “when the sun goes down, and the bathroom door sensor is closed, turn the lights in the hallway red”, and it will pop something out.

If something fails, I can ask what it was

Rather than guessing and ruining it, I can ask what went wrong

Google Gemini opened on MacBook Credit: Shimul Sood / MakeUseOf

Learning a new thing, like coding or how to work with YAML, is difficult, and I give anyone who naturally knows how to use it a ton of credit. It’s something that I’d love to learn more about in the future, as it seems like the things you can do with Home Assistant and YAML code are quite astonishing. But right now, I’m still trying to figure out how to get things running properly. If something fails when it initializes, I can ask Gemini what went wrong, and it can help me refine it and get it working.

All I have to do is paste the Trace, which is the step-by-step log that Home Assistant gives when an automation triggers, into Gemini, and it can determine what happened and why something didn’t trigger properly. It can then give me a new automation to try in place of it, and it will keep working until everything is running as needed.

AI doesn’t have human smarts

Hallucinations and Version issues can cause problems for new releases

A smartphone with ChatGPT on the screen showing a seahorse hallucination Credit: Amir Bohlooli / MUO

If you’re hoping to keep up with Home Assistant, you’ll need to pay attention to new releases carefully. If you’ve been using Home Assistant for a while, the 2024 change of replacing “service” with “action” may have caused you enough of a headache. AI models can sometimes hallucinate and use these older terms, causing things to break. You’ll need to use a human eye to ensure that you’re not putting the wrong things in.

To be fair, Gemini didn’t have any issues with this. But other, older LLMs and AI models can encounter this issue. While they’re doing the busy work, it’s up to the user to ensure that they’re getting the right output from Gemini, Claude, or whichever model you plan on trying for something like this. With the June 2026 deadline right around the corner, you may want to run some of your previous automations through Gemini or another model to ensure that all the “friendly_name” instances in your automations have been swapped over. Use the “Repair” tab to your advantage, and get to work.

Google Gemini AI app icon.

OS

Android

Developer

Google

Price model

Subscription


Now I just need to start upgrading more stuff to Matter

If you’ve been curious about Home Assistant but scared to dive into the more technical side of things? This could be the perfect middle ground. I could see what Gemini was doing, and I could also study the YAML code that it outputs, so I could start trying to do things like this for myself. It’s the best of both worlds, really.

It’s a great way for me to get my feet wet when using a program like this, and it’s inspired me to take my Home Assistant setup a little more seriously, now that I know that I can get some of my wilder ideas off the ground. If creativity outweighs your YAML skills, give this a try yourself.

Source link

QkNews Argent

Leave a Reply

Your email address will not be published. Required fields are marked *