[APP][Pro] Gemini AI - Control your Smart Home with Google's Gemini

Okay

I’ve created a little same idea got also that message

Do you know if if it’s also possible to ask question in telegram chat and how to build

For Google search you need to use the 2.5 API.

I think it can be possible to use the text in Telegram as input text for Gemini.

in the text field you can use a variable.

Not 3.5?

No that gives me the error “You have exceeded your daily quota”.

I’ll try to shed some light on the topic of models and quotas.

Google AI Studio allows you to create a free or billable API key.

The free API key is more than sufficient for generating text (send a prompt) and analyzing images (send a prompt with image), but it’s practically useless for smart home management (send a command to a smart home).

The latest Gemini models (2.5 and later) have added the ability to manage tools independently (called function calling) alongside simple text/image generation/analysis. Smart home management through Gemini is based precisely on this function, and for each individual command, Gemini uses one or more tools to complete it. For example, if you ask Gemini to turn on the kitchen light, it first calls a tool to find all the devices in the kitchen (the first tool), and once it has identified the light, it turns it on (the second tool). Furthermore, every piece of information Gemini processes consumes tokens. Therefore, the longer the list of devices in the kitchen, the greater the token consumption, and the more complicated the task, the more tools are involved, and the greater the token absorption.

For all these reasons, managing your smart home with Gemini’s free API Keys allows, at best, only a single simple command, so for everyday use, you’ll need to switch to the paid APIs. However Gemini’s token cost to manage a smart home is minimal (few euros cents per month).

Regarding models, I recommend using Gemini 2.5-flash-lite for text generation and image analysis, and Gemini 3.1-flash-lite for smart home management.
Gemini 2.5-flash-lite is the most affordable model overall, so even with a free API Key, it allows for more than adequate daily text generation and/or image analysis. On the other hand, it’s a bit limited for smart home management (it can execute basic commands, but it struggles with more structured requests).

The Gemini 3.1-flash-lite is ideal for smart home management because it’s still an affordable model, but the entire Gemini 3 family has advanced reasoning capabilities, more than adequate for managing a home.

For example, I have a second home where I only go on weekends. In the winter, I ask Gemini to check how long it took for the temperature to reach 21 degrees Celsius the last time and to set the heating to turn on accordingly. This request is successful with the Gemini 3.1-flash-lite, but it isn’t executed by the Gemini 2.5-flash-lite.

All the other, more powerful models obviously work even better, but for managing a smart home, I think they’re more than adequate.

Good idea! I could create a condition card that returns true or false if the question posed to Gemini can be traced back to a Boolean, or returns an error if it can’t.
Once I’ve finished working on the advanced flows, I’ll get to work on it.

In the first post you will find some usage examples including WhatsApp / Telegram Integration

Uhm when i test my flow it works.

But this morning the flow didn’t run.

I see in the Google AI Studio the error “503 service unavailable”

Maybe i need to tweak it to use the 2.5 flash lite API instead of the 2.5 flash.

Ciao, the error 503 means that Gemini was currently unreachable (usually due to heavy traffic). This is a temporary error. When it receives a 503 error, the app relaunches the same prompt two more times. If the 503 error persists, it returns the error to the user, asking them to try again later.

I’ve got the same problem

the message “an error occurred. Please try again.” it’s actually a timeout error. It means Gemini hasn’t responded within 10 seconds (homey limit for widget), and therefore a generic error is displayed. However, Gemini works in the background, so even though that error is displayed, it doesn’t necessarily mean the command was unsuccessful. If you reload the app, you’ll see that the generic error is replaced by the actual Gemini message.
In the next version of the app, I should be able to overcome the timeout issue so that to receive Gemini’s response on the screen (whether it’s an error or a “done” message).

I tried what you said and switch the model to recommended. I asked to turn something simple on to test it . I still get the message or I are we doing something wrong :face_with_peeking_eye:

send me a diagnostic report so I can take a look

I’ve send you a private message with the code

Exactly same problem for me :frowning:

Ciao @Daniel_Fille! I checked @Cedric_Gijsen’s log and figured out the problem.

The problem arises with Gemini’s free API key because they offer limited functions and a limited number of tokens.
In any case, I’m working on a fix: first of all, I’ve introduced less generic error messages. I’ve also streamlined the smart home management process for free accounts.

From the tests I’ve done, the only model supported by the free API keys for smart home management is the Gemini 2.5-Flash-Lite. It’s certainly not a high-performance model (it has a low level of reasoning so it can only execute basic commands), but it’s the one that uses the least tokens.

For daily use of the smart home functions, a paid API key is required (the cost is still low - we’re talking about a few cents a month).

If I can, I’ll publish a test version with these fixes this evening.

Thanks for the explanation, I understand.
But is it not very strange it have never worked a single time, I running Gemini 2.5-Flash-Lite just to test and not even a prompt like ”turn off the TV light” have never worked.

/D

The reason it never worked is that a few updates ago I implemented context caching (a cache system for saving tokens in situations with very long and complex operating instructions like in Homey). Context caching isn’t supported by the Free Tiers, so it didn’t work even once.

In any case, I just released a test version that disables context caching for free API keys. Try this test version, and if you still have problems, send me a diagnostic report and I’ll take a look.

Remember to use Gemini 2.5 Flash or 2.5 Flash-Lite. The other models are too heavy and don’t even allow a single instruction for smart home with the free tier.

It works! Cool..I think it is time to fix a Paid API key :slight_smile:
I am totally new to this and buy API keys for AI.. does have different tier? Is it someone you strongly recommend?

It depends on how you plan to use the app. If you use it to check camera photos, create custom greetings, receive weather information, or the latest news, the free tier is more than sufficient.
If you want to use the app to manage your home automation system like Google Home but be able to take advantage of all the features of Homey, you’ll need a paid API key.

My suggestion is to try it out; it’s a pay-as-you-go service, so if you don’t use the API key, you don’t pay. You can also set both spending alerts and a maximum limit, beyond which it stops. Also, as I said, the cost is quite negligible: in addition to using the app every day, I also do several development tests (mostly because of those damned advanced flows…) and in May I spent €0.91.