https://github.com/dpjanes/node-iotdb
Easily control the Internet of Things using Semantics
https://github.com/dpjanes/node-iotdb
Last synced: about 1 month ago
JSON representation
Easily control the Internet of Things using Semantics
- Host: GitHub
- URL: https://github.com/dpjanes/node-iotdb
- Owner: dpjanes
- License: apache-2.0
- Created: 2014-06-15T15:25:55.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2017-04-15T19:05:35.000Z (about 9 years ago)
- Last Synced: 2024-04-26T03:45:05.010Z (almost 2 years ago)
- Language: JavaScript
- Homepage:
- Size: 1.66 MB
- Stars: 47
- Watchers: 10
- Forks: 10
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-starred - dpjanes/node-iotdb - Easily control the Internet of Things using Semantics (others)
- awesome-iot - node-iotdb ★ 19 ⧗ 61 - Easily control the Internet of Things using Semantics. (Storage / Low Level)
- awesome_iot - node-iotdb ★ 19 ⧗ 61 - Easily control the Internet of Things using Semantics. (Storage / Low Level)
README
# node-iotdb

A Node.JS platform for semantically control all your Things.
100% test coverage.
**Node.JS 6 or higher is required!**
# Hello, World
## Install IOTDB
$ npm install iotdb
## Turn WeMo on or off
const iotdb = require("iotdb");
iotdb.use("homestar-wemo");
things = iotdb.connect("WeMoSocket");
things.set(":on", true)
things.set(":on", false)
N.B.
* you must have installed the NPM package homestar-wemo
* :on is the "semantic" term that universally means "turn/is something on or off". It expands to iot-purpose:on which in turn expands to the URL https://iotdb.org/pub/iot-purpose#on.
## Wait for a WeMo to change state
const iotdb = require("iotdb");
iotdb.use("homestar-wemo");
things = iotdb.connect("WeMoSocket");
things.on("istate", thing => {
console.log("istate", thing.state("istate"));
console.log("on", thing.get(":on"));
})
N.B.
* istate is the actual current state of the Thing. In IOTDB a Thing may have many states associated with it, called bands.
# Documentation
We are in the process of collecting all the documents into this project.
Start here:
* [https://github.com/dpjanes/node-iotdb/tree/master/docs](https://github.com/dpjanes/node-iotdb/tree/master/docs)