abstract-thingsΒΆ
abstract-things is a JavaScript library that provides a simple base for building libraries that interact with physical things, such as IoT-devices, and virtual things.
This library provides a base class named Thing that supports mixins of various types. Things are described using two types of tags, one describing the type of the thing and one describing its capabilities. Things are also expected to describe their public API, to make remote use easier.
Types and capabilities are designed to be stable and to be combined. When combined they describe a thing and what it can do.
Note
This documentation is a work in progress. Things are missing and may sometimes be inaccurate. Please open issues on Github if you find something that seems wrong.
Getting started
Types and capabilities
- Common capabilities
cap:children
- access child thingscap:state
- state trackingcap:restorable-state
- capture and restore statecap:nameable
- renameable thingscap:power
- monitor power statecap:switchable-power
- switch power statecap:mode
- monitor modecap:switchable-mode
- switch modecap:error-state
- error reportingcap:battery-level
- monitor battery levelcap:charging-state
- monitor if chargingcap:autonomous-charging
- request chargingcap:audio-feedback
- if thing emits audio feedbackcap:switchable-audio-feedback
- enable or disable audio feedback
- Controllers
- Lights
- Implementing lights
type:light-bulb
- Light bulbstype:light-strip
- Light stripscap:fading
- support for fading changescap:brightness
- read brightnesscap:dimmable
- change brightnesscap:colorable
- coloring of lightscap:color:temperature
- light supports temperaturecap:color:full
- light supports full range of color
- Sensors
cap:atmospheric-pressure
- read atmospheric pressurecap:carbon-dioxide-detection
- detect abnormal CO2 levelscap:carbon-dioxide-level
- read carbon dioxide levelcap:carbon-monoxide-detection
- detect abnormal CO levelscap:carbon-monoxide-leve
- read carbon monoxide levelcap:contact-detection
- contact sensingcap:illuminance
- read illuminancecap:motion-detection
- motion sensingcap:pm2.5
- read PM2.5 density (air quality)cap:pm10
- read PM10 density (air quality)cap:power-consumed
- read power consumedcap:power-load
- read the current power loadcap:relative-humidity
- read humidity of aircap:smoke-detection
- detect smokecap:temperature
- read temperaturecap:voltage
- read voltage of somethingcap:water-detection
- detect water
- Climate
cap:target-humidity
- read the target humiditycap:adjustable-target-humidity
- change the target humiditycap:cleaning-state
- get if cleaningcap:autonomous-cleaning
- activate cleaningcap:spot-cleaning
- support for spot cleaningtype:air-monitor
- Air quality monitortype:air-purifier
- Air purifierstype:humidifier
- Humidifierstype:dehumidifier
- Dehumidiferstype:vacuum
- Vacuum cleaners
- Electrical