Content: Hi everyone! ![]()
I’d like to share a project I’ve been working on for the past few days. It is a custom AI Agent that connects the Google Gemini 2.0 Flash API directly to Home Assistant.
Unlike standard integrations, this agent runs as a lightweight Python application (using a Streamlit interface) on your computer and communicates with your HA instance via the API.
Key Features (v4.0):
- Two-way Communication: The agent doesn’t just read states; it can trigger services via API calls (e.g.,
light.turn_off,cover.open_cover). - Context Aware: It understands conversation history and supports custom aliases (e.g., if I say “Bubble”, it knows I mean
light.garage_main). - Smart Filtering: It intelligently filters out thousands of technical entities and sends only the relevant ones (lights, switches, climate) to the LLM, ensuring fast and accurate responses.
- Secure: It uses
secrets.tomlfor API keys, keeping your credentials safe.
The project is written in Python and is completely open-source. If anyone wants to try it out or has ideas for improvements, the code is available here:
I’d love to hear your feedback or suggestions!
Cheers, Matjaž
