The DecisionNode integration lets Home Assistant ask calibrated questions about a camera's picture, an image or a state, and get typed answers back: a yes-or-no probability, a choice from options you name, a score on your scale or a number. Use the answers in automations, as sensors, or on a Frigate detection.
- A decide action,
decisionnode.decide, that asks questions and returns the answers as an action response and as the eventdecisionnode_decision. - Standing questions: a question asked on a schedule about a camera, shown as a binary sensor (yes or no) or a sensor (a choice, a score or a number).
- A Frigate trigger: a person or car detection asks your questions about that event's snapshot.
Install#
- 1
Add the repository to HACS#
Until the integration is in HACS's default list, add it as a custom repository: in Home Assistant open HACS, the three-dot menu, Custom repositories, enter
https://github.com/Bynn-Intelligence/decision-node-home-assistanthttps://github.com/, choose the type Integration and select Add.Bynn-Intelligence/ decision-node-home-assistant - 2
Download it#
Find DecisionNode in HACS, select Download, and restart Home Assistant.
- 3
Add the integration#
Go to Settings, Devices & services, Add integration, pick DecisionNode, and paste an API key from your console. The model defaults to
decisionnode-moe;decisionnode-flashis the fast, lower-cost model.
Quickstart: a package at the door#
Questions are written as the API takes them: an id, then a type (truth, choice, score, number, point or box) and instructions. The decide action, its response, and an automation that turns on the porch light when a package is likely there:
action: decisionnode.decide
data:
camera_entity_id: camera.front_door
questions:
package:
type: truth
instructions: Is a package on the doorstep?
visitor:
type: choice
instructions: Who is at the door?
criteria:
courier: a delivery driver
guest: someone visiting
nobody: no one is there
response_variable: decisionInstead of a camera, pass image_url (an https URL that DecisionNode fetches) or image_path (a file in a directory listed in allowlist_external_dirs). Add state to give the questions text or data beside the picture. Every decision also fires decisionnode_decision, with source (service, standing or frigate) and the same fields.
Configuration#
Standing questions#
In the integration's Configure dialog, list standing questions as YAML. A truth question becomes a binary sensor, on when the probability reaches threshold (0.5 when left out). A choice, score or number question becomes a sensor whose state is the choice, the score or the number. interval is in seconds: 60 by default and at least 10. Each account sends at most two requests at a time, at least one second apart.
- name: Package at the door
camera: camera.front_door
question:
type: truth
instructions: Is a package on the doorstep?
interval: 120
threshold: 0.8Frigate#
The Frigate trigger needs Home Assistant's MQTT integration connected to the broker Frigate publishes on. When Frigate reports an event of one of the labels, the integration reads its snapshot from Frigate and asks the questions; the answers arrive as decisionnode_decision (with source: frigate, event_id, camera and label) and on the sensor Last Frigate decision.
enabled: true
frigate_url: http://frigate.local:5000
topic: frigate/events
labels: [person, car]
cameras: [] # all cameras; or list the ones to watch
event_type: new # new, update or end
cooldown: 30 # seconds between two decisions for the same camera
questions:
courier:
type: truth
instructions: Is this person a delivery driver?The API key#
The key is kept in the integration's configuration and never written to the log. If DecisionNode refuses it later, Home Assistant asks you for a new one. Nothing is sent until a decide action runs, a standing question is due or a Frigate event matches your labels; then the picture goes to the API with your questions.
The source, the full README and the issues are in the repository. MIT licence.