home-automation example project converts commands such as “Get the coffee boiling” into a call to a home system. It uses a dozen small choice decisions instead of one large model call, and it rejects off-topic questions.
The flow
1
Ask in parallel
Three decisions run at once on the command: which room, which device, and which device class (lights, fans, locks, appliances, speakers, thermostats). One action decision per class also runs, for example “What should happen to the lights?” with the options
on and off.2
Gate on confidence
Each decision sets
minConfidence. A low-confidence class becomes none_of_these and goes to a noop node. An unclear room or device goes to a clarify node.3
Use only the matching class
Each
call-<class> node has join: "all". It runs only when the class decision matched its class, the action is known, and the room and device were understood.4
Call the home system
The
http node posts { device, room, action } to {{input.homeUrl}}/devices/{{device}}. Point homeUrl at Home Assistant, an MQTT bridge or any webhook.Run it without hardware
From thehome-automation example directory:
pnpm test in that directory runs the flow against a keyword-based stand-in provider and the fake device server, so it needs no API key.
Change the backend
The flow names a providerjev. Point that id at any provider that can decide. The config in the example uses Jev with a local OpenAI-compatible server as a fallback. Replace the entry with an openai, anthropic or http provider and the flow stays the same.
Regenerate the flow
build-flow.ts builds flow.json with the TypeScript flow() builder. Run pnpm flow after you edit it.