152 lines
6.4 KiB
Markdown
152 lines
6.4 KiB
Markdown
# hAPI
|
|
|
|
hAPI ("home API") is a personal, cloud-hosted API serving one household and its automations: finance, fitness, maintenance, and smart home. Access is restricted to a small, known set of Principals.
|
|
|
|
## Language
|
|
|
|
### Access
|
|
|
|
**Principal**:
|
|
Anything that authenticates to hAPI.
|
|
_Avoid_: User, account, client
|
|
|
|
**Person**:
|
|
A human Principal (the Owner, family, friends).
|
|
_Avoid_: User, human user, member
|
|
|
|
**Bot**:
|
|
A non-human Principal: a script, automation, or integration such as Home Assistant. Some Bots are built into hAPI itself, such as the scheduler, and never hold a Token.
|
|
_Avoid_: Service account, machine user, integration account
|
|
|
|
**Owner**:
|
|
The single Person with administrative authority over hAPI and every other Principal. That authority covers Principals and the platform, not other Persons' Personal data.
|
|
_Avoid_: Admin, root, superuser
|
|
|
|
**Token**:
|
|
A Principal's secret credential for the API.
|
|
_Avoid_: API key, password
|
|
|
|
**Scope**:
|
|
A domain paired with read or write access: the unit of access that Household grants and Bindings carry.
|
|
_Avoid_: Permission, privilege
|
|
|
|
**Binding**:
|
|
A Person's consent letting a specific Bot act on that Person's Personal data in one domain, up to a given Scope.
|
|
_Avoid_: Delegation, impersonation, link
|
|
|
|
**Household grant**:
|
|
The Owner's permission for a specific Bot to act on one domain's Household data, up to a given Scope.
|
|
_Avoid_: Permission, role
|
|
|
|
### Ownership
|
|
|
|
**Household**:
|
|
The single group of Persons that hAPI serves. There is exactly one.
|
|
_Avoid_: Family, tenant, organization, group
|
|
|
|
**Household member**:
|
|
A Person who belongs to the Household. A Person can be a Principal without being a Household member (e.g. a friend).
|
|
_Avoid_: Family member, resident
|
|
|
|
**Personal data**:
|
|
A record owned by one Person, visible only to that Person (and to Bots bound to them).
|
|
_Avoid_: Private data, user data
|
|
|
|
**Household data**:
|
|
A record owned by the Household, visible to every Household member.
|
|
_Avoid_: Shared data, common data
|
|
|
|
**Recorded by**:
|
|
The Principal that created or last changed a record, distinct from who owns it.
|
|
_Avoid_: Author, owner, creator
|
|
|
|
### Notifications
|
|
|
|
**Notification**:
|
|
A message hAPI keeps for one Person or for the Household about something that needs their attention, delivered through one or more channels such as ntfy. A Notification to a Person is seen only by that Person; one to the Household by every Household member. Platform alerts to the Owner (from CI, delivery, or monitoring) are not Notifications.
|
|
_Avoid_: Alert, event, message
|
|
|
|
### Smart home
|
|
|
|
Smart home is hAPI's side of the house: queuing Jobs for Home Assistant, which remains the source of truth for the house's state.
|
|
|
|
**Job**:
|
|
A request, queued in hAPI, for Home Assistant to carry out an action in the house. Jobs are Household data. Domain code, Persons, and Bots can all create them.
|
|
_Avoid_: Task, command, message
|
|
|
|
### Finance
|
|
|
|
**Financial Account**:
|
|
A bank, credit card, or cash account whose money hAPI tracks. It is owned by a Person or by the Household, and its Transactions share that owner.
|
|
_Avoid_: Account (on its own), bank account, wallet
|
|
|
|
**Transaction**:
|
|
A single posted movement of money into or out of one Financial Account.
|
|
_Avoid_: Entry, charge, payment
|
|
|
|
**Category**:
|
|
A named bucket that Transactions are sorted into, of kind expense, income, or transfer. Household Categories can be used by the Household and by every Household member; Personal Categories only by their Person.
|
|
_Avoid_: Tag, label, envelope
|
|
|
|
**Budget**:
|
|
One owner's zero-based monthly plan: expected income assigned across Categories, then rebalanced during the month with Moves. The Household has one, and each Person may have one.
|
|
_Avoid_: Plan, envelope
|
|
|
|
**Target**:
|
|
A Budget's standing amount for one Category over a period (monthly, quarterly, or annual), spread into even monthly shares.
|
|
_Avoid_: Goal, limit
|
|
|
|
**Allocation**:
|
|
What a Budget assigns to one Category in one month: the Target's monthly share, adjusted by Moves.
|
|
_Avoid_: Budgeted amount, envelope
|
|
|
|
**Move**:
|
|
A shift of money from one Category's Allocation to another's within one month of a Budget. It never changes the month's total.
|
|
_Avoid_: Transfer (a kind of Category), reallocation
|
|
|
|
**Banked**:
|
|
Said of a Category whose Target period is longer than a month. Its unspent Allocations carry forward as a banked balance until the bill draws it down.
|
|
_Avoid_: Sinking fund, rollover, savings
|
|
|
|
**Payee mapping**:
|
|
An owner's remembered link from a payee to a Category, learned from manual categorization and applied to newly ingested Transactions.
|
|
_Avoid_: Rule, auto-categorization
|
|
|
|
### Maintenance
|
|
|
|
Maintenance is the recurring upkeep of the Household's property: the home, its land, its equipment, its vehicles, and its digital systems (such as the hAPI cluster). It is not a to-do list: errands, bills, and one-off chores don't belong.
|
|
|
|
**Asset**:
|
|
A thing the Household keeps up, such as the roof, the furnace, a car, or the hAPI cluster. It may have a meter whose Readings track its use.
|
|
_Avoid_: Equipment, item, entity (a Home Assistant term); in Finance, use another word
|
|
|
|
**Task**:
|
|
A recurring piece of upkeep, due either a fixed interval after it was last done or on a calendar rhythm, and optionally also after a set amount of use. Tasks always recur; one-off work is recorded only as a Service.
|
|
_Avoid_: Chore, reminder, to-do (and never a Job)
|
|
|
|
**Service**:
|
|
One piece of maintenance work done on a date. It may fulfill a Task, and may concern an Asset.
|
|
_Avoid_: Completion, repair, log entry
|
|
|
|
**Reading**:
|
|
An Asset's meter value (an odometer's distance or a runtime counter) taken on a date, used to decide when usage-based Tasks come due.
|
|
_Avoid_: Measurement (a Fitness term), metric
|
|
|
|
### Fitness
|
|
|
|
**Workout**:
|
|
One session of exercise by one Person: an ordered list of Exercises performed, with what was done in each. A run is a Workout with a single cardio Exercise.
|
|
_Avoid_: Session, activity, training
|
|
|
|
**Exercise**:
|
|
A named movement that Workouts record, of kind strength, bodyweight, timed, or cardio; the kind decides what is recorded for it. Household Exercises can be used by every Household member; Personal Exercises only by their Person.
|
|
_Avoid_: Movement, lift, activity
|
|
|
|
**Set**:
|
|
One bout of a strength, bodyweight, or timed Exercise within a Workout: reps and load, or a duration. A warmup Set doesn't count toward records.
|
|
_Avoid_: Rep, round
|
|
|
|
**Measurement**:
|
|
One reading of a Person's body (weight, body fat, or a circumference) at a point in time.
|
|
_Avoid_: Metric, stat, body stat
|