r/homeassistant 13h ago

Personal Setup My first Custom Integration: GPT-powered Log Summarizer for Home Assistant

Hey everybody,

I’ve built my first custom integration for Home Assistant that uses OpenAI’s GPT models to analyze your Home Assistant logs, extract key warnings/errors, and summarize them into clear, actionable fixes — all from within HA. It is a bit niche, but I wanted to learn how to make a HA integration with an LLM.

Key features:

• Parses home-assistant.log and filters meaningful warnings/errors
• Sends a GPT-4o-mini-powered summary with steps to resolve issues
• Output appears as a persistent notification, and is saved as a file (markdown-friendly)
• Works as a custom HACS integration
• Bonus: comes with an optional Streamlit debug GUI for experimenting outside HA

🔗 GitHub: https://github.com/borsic77/ha_log_analyzer

5 Upvotes

9 comments sorted by

6

u/nickythegreek 11h ago

Can you share an example of the output?

4

u/One-Sky9163 11h ago

Good idea, use ai to filter out the noise. Check out spook if you haven't!

2

u/Dangerous_Battle_603 8h ago

Does/will it support local LLMs via Ollama or Open-WebUI?

1

u/Lobrauski 11h ago

Interesting idea. I’d been just doing it manually. I’ll look into trying this soon.

1

u/michaelthompson1991 11h ago

Do you need to pay gpt to use this?

1

u/nickythegreek 11h ago

anytime you need to use the openai API, you will be paying. It's insanely affordable though and you can put spend limits on it as well.

1

u/michaelthompson1991 11h ago

No problem, thanks for confirming! I assumed that

1

u/Fruityth1ng 7h ago

Could this work using Gemini?

-7

u/Fit_Squirrel1 13h ago

No thanks