AI-Powered Flow Builder (Prompt → Advanced Flow Generator)

With the current evolution of Large Language Models (LLMs) and the capabilities already exposed by the Homey Web API, it would be extremely powerful to introduce an AI-assisted Flow Builder a system that allows users to describe an automation in natural language and automatically generate an Advanced Flow (complete with cards, conditions, tags, and variable bindings).

Example use case

A user could type or say:

“When the mmWave sensor in the hallway detects presence and it’s after sunset, dim the living room light to 40%, play soft music, and close the blinds.”

Homey’s AI Flow Builder would then automatically:

  1. Identify the correct devices (sensor, light, speaker, blinds).

  2. Build an Advanced Flow with the proper When / And / Then cards.

  3. Bind variables or tags (e.g. lux, time of day, presence).

  4. Save the flow in the user’s workspace ready for review and activation.

How it could be implemented (plausible based on current API capabilities)

  • API Foundation:
    Homey already exposes Web APIs such as HomeyAPIV3Local.ManagerFlow and HomeyAPIV3Cloud.ManagerFlow, which include functions like createFlow, updateFlow, and createAdvancedFlow.
    These could serve as the backend for programmatically creating flows.

  • LLM Integration Layer:
    The system could connect to a local or cloud-based LLM (OpenAI, Gemini, or even Athom’s own AI module).
    The LLM would parse a user’s prompt and output a structured JSON object describing the desired flow, including:

    {
      "trigger": { "device": "Hallway Sensor", "capability": "motion_detected" },
      "conditions": [{ "time": "after_sunset" }],
      "actions": [
        { "device": "Living Room Light", "capability": "dim", "value": 0.4 },
        { "device": "Sonos Speaker", "capability": "play_playlist", "value": "Soft Evening" },
        { "device": "Blinds", "capability": "close" }
      ]
    }
    
    
  • Flow Rendering & Validation:
    Homey’s UI would then use this JSON to automatically render a draft Advanced Flow in the visual editor.
    The user could confirm, edit, or fine-tune it before saving.

  • Security & Permissions:
    Since this feature would rely on creating flows via API, user confirmation and permission tokens would be required (similar to the current Developer API tokens).

Benefits

  • Makes Homey accessible to non-technical users.

  • Greatly reduces setup time for complex automations.

  • Bridges natural language and Homey’s powerful Advanced Flow UI.

  • Would place Homey at the cutting edge of AI-assisted smart home automation.

Related References

If you also think this would be a game-changer for Homey Pro users, please like and comment to help prioritize this feature!

26 Likes

I totally agree. Thinking about this already for some time.

1 Like

Been trying to build and adjust (complicated) flows with ChatGPT and what comes out is absolute BS…

It can’t even get calculations right and just makes up functions and cards Homey is supposed to have but doesn’t…

4 Likes

Thanks for jumping in, @Marcel_Visser and @JohanP — totally agree with both points.

You’re right, current LLMs (including ChatGPT) often “hallucinate” functions or cards that don’t exist in Homey. However, I think we’re at a stage where a hybrid solution could actually work reliably if designed properly.

Here’s one possible approach:

1. AI → JSON Template, not direct UI editing
Instead of letting the LLM try to “click” or simulate the Flow UI, it could output a structured JSON (based on the ManagerFlow API schema) describing triggers, conditions and actions.
Homey could then validate this JSON against its internal capabilities list (to make sure all devices and cards exist) before rendering it in the Advanced Flow editor.

Flow Validation Layer
A middleware could use the same capability database that the Web App already uses (GET /api/manager/devices) to auto-correct or suggest the right card names and tags.
For instance, if the AI says “turn off TV” but no such device exists, Homey could suggest “TV plug” or “Infrared transmitter.”

3. Prompt-Engineered Contexts
LLMs can be given dynamic context a JSON list of the user’s devices, capabilities, and installed apps before generating the Flow.
That way, it only uses cards that are truly available on that user’s Homey.

4. Collaborative mode
The Flow Builder could first propose the “When / And / Then” chain in text and allow the user to approve before it actually creates anything a kind of “AI co-pilot” rather than full automation.

If Athom or a community dev could open up a sandbox endpoint to experiment with createAdvancedFlow, we could start testing this right away.

What do you all think?
Would be great if some developers here could confirm whether createAdvancedFlow() is usable from the local API right now, and if validation hooks are available.

This could become a real community-driven project maybe even open-source an AI Flow Builder prototype.

1 Like

From what i’ve seen I’m not letting ChatGPT, and for now not any other AI near my Homey flows. letting it create Json’s or scripts wich I don’t (fully) understand is asking for mayhem.

ChatGPT offered several times to create a ‘edited’ Json, and with my previous reply I mind, I’m glad I didn’t.

When I create a flow I want to understand what it’s doing, and even more; want to be able to adjust/edit it hen needed. I don’t think I can with a flow someone, or something made for me…

ChatGPT is nice to help me with ideas and suggest solution, but I create and implement them myself…

3 Likes

I was thinking the same thing too…

I do think it is possible to create an AI Flow builder based on what I did with the AI Chat control app. Maybe next week I will play around with this option.

2 Likes

That’s awesome to hear, Jeroen your AI Chat Control app already proves that Homey can interact smoothly with external AI models.

Building an AI Flow Builder on top of that architecture sounds totally doable if we start small and expand step by step.

Here are a few ideas that might help u to define a first prototype:

1. Reuse your existing AI endpoint
Instead of reinventing the wheel, the same MCP (Model Context Protocol) interface used by AI Chat Control could send a “flow-design” intent, returning a structured JSON like:

{
  "intent": "create_flow",
  "flow": {
    "trigger": {"device": "Hallway Sensor", "capability": "motion_detected"},
    "conditions": [{"time": "after_sunset"}],
    "actions": [
      {"device": "Living Room Light", "capability": "dim", "value": 0.4},
      {"device": "Blinds", "capability": "close"}
    ]
  }
}

Then the app could call ManagerFlow.createAdvancedFlow() locally to generate the actual flow.

2. Local capability validation
Before creating anything, the app could cross-check the JSON against ManagerDevices.getDevices() to ensure every capability and device ID actually exists.
That would prevent “hallucinated cards” or invalid functions (the main issue users like @JohanP pointed out).

3. Iterative prompt refinement
Once the draft flow is generated, the AI could return a short text like “Here’s what I built would you like to adjust brightness or timing?” so the user can refine it conversationally before saving.

4. UI integration (future)
In a later stage, you could surface this as a “Create with AI” button in the Flow Editor, opening a text box for the prompt and showing a preview of the generated structure before committing it.

I’d be happy to brainstorm or test a prototype if you start experimenting with it.
You’ve already done the hardest part ( connecting Homey to an LLM ) now it’s just about mapping prompt → flow schema → UI render.

Super excited to see what you come up with, this could really change the way people build automations! :raising_hands:
Regards, Luca.

1 Like

it seems that ChatGpt helped you with this text?

1 Like

No, I use Gemini for translations, which might correct the structure of the post.

2 Likes

Bonjour , je suis ok pour cela également , j’utilise déjà les AI pour corriger, et faire des scripts pour ma HP2023.

I fully agree with Johan. Besides all the errors and hallucinations or current AI’s, for me the fun is to understand my system completely.

If everything is taken out of my hands, my hobby is lost.

1 Like

I found another way to create “flows”: not in Homey but put into the memory of Claude / ChatGPT and then let it use the devices or flows you expose to the Ai to execute the instructions