Creating cards with GenAI

Every now and then I stumble upon posts of fellow Homeassistant enthusiasts that leverage GenAI (Ollama, ChatGTP, Gemini, Grok) to create nice looking dashboards and cards. I have been picking my brain, but cannot figure out how to do that myself. Is it as simple as going to https://platform.openai.com/playground and asking for a card? If that’s so then the AI model does not know which sensors I have. Also tried to do something with “Developer tools” - “Assist”, but that produces unusable results.

So question is: how can I leverage the power of GenAI, aware of my setup, to create additional functionality in Homeassistant?

I’m on the forum on a daily basis but I cannot say I ever saw a post about some one creating dashboards with it. Many are experimenting with AI integrations to create a better voice assistant. I also see my fair share of people creating automations with it, but the ones that post about it obviously do so because it does not produce the intended result.

AI is becoming more capable with generating code. For creating a lovelace card the AI would not need to know your entities, it does however need to understand how custom cards are built. For generating dashboards using existing cards, it needs to know your entities, so that would indeed require you to integrate AI with Home Assistant.

Most (all?) AI integrations for HA focus on controlling and querying devices rather than creating code. But neither is simple now. You’d want to do so to learn and leverage the power of AI. If you are looking to do more with less knowledge, most likely you’ll fail because integrating AI in HA is not a simple task. Prompt engineering to get meaningful results is hard.

An important thing to also note is that HA is evolving fast, so many AI will have outdated knowledge about HA code. For instance, the Tile card in HA, which is by far the nicest one now, is bound to get a lot of new features next wednesday. The rapid improvements will complicate writing correct code. And you’ll need your own fair share of knowledge about the code it produces to fix what is wrong. Until AI and AI HA integrations mature, there is no quick fix.

2 Likes