[APP][Pro] Cortex AI – an AI brain for your Flows and your home

Hi all,

I built Cortex AI because I wanted AI in my Flows that a Flow can actually use: not a blob of text, but an answer.

What it does

  • Ask any AI model from a Flow and get a typed answer: yes/no (also as an And card), a number within your range, one of your own options, or text. “Let Cortex decide” picks between your options and fires a “Cortex chose…” trigger, so your own Flows do the work.
  • Every card has a timeout and a fallback value, so a Flow never hangs. A log shows what was asked, the answer and the reason.
  • Brains decide what Cortex knows: the devices, rooms and variables you pick, your own house rules, and Homey Energy (live power, solar forecast, your electricity price), weather and sun times.
  • Chat from a dashboard widget, the app settings or a Flow card (with memory per conversation, handy behind a WhatsApp or Telegram bot). When you ask, it switches devices too; locks and alarm only if you allow it.
  • Voice commands: a device per sentence that Google can switch on (“Hey Google, turn on Good night”), after which Cortex carries out your instruction.

Providers: OpenAI, Claude, Gemini, Ollama and LM Studio (local), OpenRouter, Mistral, Groq, xAI, DeepSeek or any OpenAI-compatible server. Your own key, with a daily budget you set.

Good to know: works on Homey Pro (2023), Homey Pro mini and Homey Self-Hosted Server; not on Homey Cloud, because it needs access to all your devices. Google doesn’t pass free text to any app, so voice is keyboard dictation in the widget or fixed Google sentences.

Tutorials

Store: Cortex AI | Homey

Questions, bugs and ideas are welcome right here.

Tutorial: let Cortex decide whether to water the garden

My own setup: a Gardena water control with two valves and a soil moisture sensor. Instead of stacking conditions (moisture below X, no rain coming, not too cold…), I let Cortex make the call and keep the Flow small.

1. Make a brain “Garden”
Devices → + → Cortex AI → Brain. Tick the soil sensor and the water control. In the brain’s settings keep Weather and Sunrise and sunset on, and put your own rules in House rules, for example:

Water when the soil moisture is below 40 %. Skip when rain is expected in the next 12 hours or when it’s colder than 5 °C.

Tip: on the Cortex AI settings page, “What does it see?” shows exactly the text the AI model gets.

2. Build the Flow

  • When: every day at 07:00
  • And: Cortex answers yes to “Should the garden be watered this morning?”, on the Garden brain. Set otherwise to no: if the model is slow or offline, the garden simply isn’t watered that morning.
  • Then: open the valve for 20 minutes. Else: a notification, if you like.

3. See why it decided
Every question, answer and reason is in the Cortex AI settings under Log. The picture above is a real answer from my brain this evening.

Good to know

  • It works the same with a local model (Ollama, LM Studio) if you don’t want a cloud key.
  • Cortex gets the weather forecast, not the rain that already fell. The soil sensor covers that part.
  • A question like this costs a fraction of a cent with the small OpenAI or Gemini models, and you can set a daily budget.

Tutorial: run the washing machine on the best solar day

The washing machine is the classic “shiftable” load: it doesn’t matter much when it runs, as long as it runs. I let Cortex pick the day, using my solar forecast, the weather, my tariff (EDF Tempo here) and my own house rules.

1. Make a brain “Energy”
Devices → + → Cortex AI → Brain. Tick your solar, home battery and grid devices, plus your tariff app if you have one. In its settings keep Energy now and today, Solar forecast and Weather on. Add rules that only you know, for example:

On a red tariff day, no washing or drying between 06:00 and 22:00.

2. Build three small Flows

  1. Every morning at 08:00, if your Yes/No variable Laundry waiting is yes: Let Cortex decide “Run the laundry today on solar, or wait for a sunnier day?” from the options Run today, Wait. Set otherwise to Run today, so the laundry never waits forever when the model is offline.
  2. When Cortex chose “Run today”: start the washer around noon (remote start in your washer’s app, or a reminder) and set Laundry waiting to no.
  3. When Cortex chose “Wait”: a notification with the reason token, so you know why.

Laundry waiting is set by you: a dashboard button, an NFC tag next to the machine, or the door contact of the washer.

Why “Let Cortex decide” instead of a yes/no question? Each option fires its own “Cortex chose…” trigger, so every outcome gets its own small, readable Flow, and you can add a third option later (say Run tonight on cheap power) without touching the first Flow.

Good to know

  • Homey Energy gives Cortex the solar forecast for today and tomorrow. Further ahead it only has the weather, as you can see in its answer above.
  • The reason for every choice is in the Cortex AI settings under Log.
  • The same pattern works for the dishwasher, the dryer or charging the car.

Tutorial: when everyone leaves, is anything still on?

A classic “leaving home” Flow checks devices one by one, and you have to update it every time you add one. Here a single question does the job: the brain already sees the home, and my own house rules tell it what’s normal.

1. A brain that sees the home
Use an existing brain or add one (Devices → + → Cortex AI → Brain). Tick the rooms or devices that matter, or tick All other devices of the home. Then say in its House rules what’s normal while you’re out, for example:

The dishwasher starts by itself at 01:00. The fridge and the network stay on.

2. Build the Advanced Flow

  • When: Presence → The last person leaves.
  • Then: Ask Cortex a yes/no question on that brain: “Everyone has just left home. Is anything still on, open or unlocked that shouldn’t be?” Wait at most 30 s, otherwise no, so a slow or offline model just means no push.
  • And: Logic → Answer (yes/no) is equal to yes.
  • Then: a push notification “Still on at home: Reason”.

Prefer a standard Flow? Use the And-card Cortex answers yes with the same question and push “Something is still on at home”. You only miss the reason in the push (it’s still in the Cortex AI log).

What happened in my test
It flagged the PC (171 W) and the pool pump. You can argue about the pump: the home battery was soaking up the sun, so there was hardly any surplus left. But it applied my own house rule to the letter, and that’s the point: to change what it flags, I change one sentence in the rules, not the Flow. The dishwasher, waiting for its 01:00 start, wasn’t flagged.

Good to know

  • This card only asks; it doesn’t switch anything. If you want Cortex to switch things off too, use Chat with Cortex on a brain that may control devices, for example “Nobody is home: switch off what shouldn’t be on.” Locks and the alarm are never touched unless you allow it.
  • Homey’s presence comes from the Homey app on everyone’s phone, so that has to work first.
  • A question like this costs a fraction of a cent with the small models.