Table of Contents
A simple Home Assistant app that uses Large Language Models & Agents to perform actions in your smart home.
Integrates with the following model providers:
- OpenAI
- Anthropic
- Gemini
- Ollama
- Groq
- Mistral
- Cohere
- Bedrock
Perform actions like the following:
- Lights, Outlets, Plugs, Switches, etc.
- Garage Door
- Sprinkler System
- Retrieve Weather
- Its easy to customize and add your own
Example of running Home Assistant:
~ python3 assistant.py
> Turn the lights on in the office.
I have turned on the office lights.
~ python3 assistant.py
> Open the garage door.
The garage door is now open.
~ python3 assistant.py
> What's the weather in San Francisco today?
OK. I retrieved the weather information for San Francisco, CA. The current temperature is 52°F, with a PM2.5 of 13.2 μg/m³ and a PM10 of 17.2 μg/m³. The weather forecast for today is a high of 61.2°F and a low of 43.1°F. There is no precipitation expected. The sun will rise at 6:50 AM and set at 6:50 PM.
Home Assistant can be run in two manners, locally or hosted with an API.
- Install Pydantic-AI
pip install pydantic-ai
- Clone the repo
git clone https://github.com/tuxthepenguin84/homeassistant.git
- Fill in API keys & Model info in
params.json - Customize
agents.py. I have provided some generic examples to help get you started.
- Run from terminal
python3 assistant.py
- Build Container
docker build -f Dockerfile . -t tuxthepenguin84/homeassistant:latest --no-cache - Run Container
docker compose up -d
- Send Request to API
curl -s -X PUT http://localhost:5000/request -d "request=Turn the den light on."
While there is no mobile app, you can easily make one on iOS with the Shortcuts app.
- Create a new Shortcut called
Home Assistant - Add
Dictate text - Add
Get Contents of- Add the URL to your API running in Docker
http://your_ip_address:5000/request - Method
PUT - Request Body
Form- Add new field:
request "Dictacte Text"
- Add new field:
- Add the URL to your API running in Docker
- Save the shortcut to your iOS home screen
- Tap the app and speak your request
TBD
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
Distributed under the MIT. See LICENSE.txt for more information.
Project Link: https://github.com/tuxthepenguin84/homeassistant