Learn · Foundations · 02 of 04

Hardware-defined automation

Capabilities, not brands. How Opichy models the physical world so AI can compose it.

Traditional automation starts from a vendor's product and its rules engine. Opichy starts from the capability a piece of hardware exposes.

Capabilities

A capability is something a device can do, named for the thing itself rather than the product: Switch, Illumination, Thermostat. Each declares the values it can be asked for and the methods it accepts. A device is anything discovered by Opichy Edge that provides capabilities, whether it was found over GPIO, Bluetooth, Matter, Modbus, OPC UA or a TV's web socket. The catalogue below is rendered live from the same Rust code the controller runs, compiled to WebAssembly.

Loading the capability model…

Three things the model is honest about

These came out of running a real house on the proof of concept, and they are the difference between a model that can be automated against and one that only looks like it.

  1. How a value was obtained. A Kasa outlet reports its own relay, so reading it is a measurement. A Govee bulb reports nothing; all anyone knows is what was last sent. Both provide Switch, but every reading carries a quality: measured is Good, commanded is Uncertain. A caller can always tell a reading from a guess.
  2. The device's resolution. A dimmer reaches any level; a relay reaches two. A capability declares its levels, and asking a relay for 40% honestly answers 0.
  3. Age. A temperature from four minutes ago is a different fact from one taken four seconds ago. Each capability declares a max_age_s; older readings degrade to Uncertain rather than being served as current.

Try it: a relay (2 levels) asked for % reaches ; a dimmer (101 levels) reaches .

Composition

Because the model is uniform, an outcome can be expressed against whatever is present:

Outcome:      keep the greenhouse healthy
Observes:     Thermostat.Actual, Occupancy.Motion, PowerMetering.Watts
Actuates:     Switch.SetState (valve), Illumination.SetLevel (grow light)

"Which devices provide Switch?" is a query, not a lookup table someone maintains. Swap a bulb for a different brand and nothing about the automation changes; the capability is the same.

The model lives in Rust in crates/opichy-core and is shared with the browser and the controller as WebAssembly.