What is the Smart home MVP? #62
Notifications
Due Date
No due date set.
Depends on
Reference: bobby/hapi#62
Reference in new issue
Block a user
Part of #44
Question
What does the smart home domain need at MVP: which controls or automations hAPI exposes, the shape of a job sent to Home Assistant, how results/state come back, and what is explicitly deferred?
Unblocked by Which bridge carries jobs to Home Assistant? (ADR-0006). The Smart home domain owns Jobs (
/v1/smart_home/jobs): Household data that name an HAhapi_*script plus variables, which HA polls for. HA → hAPI data is not part of the bridge: it goes to ordinary Smart home endpoints with HA acting as a Bot. The MVP decides which of those endpoints and records exist beyond Jobs. Thehapi_*scripts live in a separate HA config repo.Resolution
The Smart home MVP is Jobs only, built on ADR-0006. Bridge health (
ha_bridge,job_backlog, metrics) is already settled by ADR-0009.script+variables). There are no typed control endpoints (e.g./thermostat), and hAPI keeps no script catalogue. Any documentation of thehapi_*scripts lives in the HA config repo.not_before. Recurring Jobs are out of scope, because HA automations already do that.response(e.g. ahapi_report_locksscript), with about 30 s of latency. There's no live state endpoint; real-time state stays in HA's app.POST /v1/smart_home/jobstakes an optionalexternal_id, unique per creating Principal. A repeat POST returns the existing Job with200instead of creating one with201. This matches the Fitness and Maintenance convention.GET /v1/smart_home/jobsuses cursor pagination, newest first, with filters onstatus,script,recorded_byand a created-at range.GET /jobs/{id}returns the full Job, including its result and attempt count.POST /jobs/{id}/cancelworks onpendingJobs.smart_home:readto read them.POST /jobs/{id}/resultis the single way to finish a Job, whoever finishes it. It accepts a result from any Household member (e.g. closing a Job by hand after doing the action manually) or from any Bot withsmart_home:write. It's allowed while the Job ispending, whether or not it's currently leased. Recorded by shows who resolved it. A terminal Job returns409, so a late HA report on a hand-closed Job is harmlessly rejected. Results are not restricted to the leasing Bot in v1, since there's one consumer; revisit if a second appears.create_job, but no domain code calls it yet; domain-triggered Jobs wait on scheduling.Glossary: added a Smart home scope line. No new terms, and no ADR (nothing here is hard to reverse beyond ADR-0006).