Home automation nerve center

Usage no npm install needed!

<script type="module">
  import cherryCore from '';




An extensible hub for home automation/Internet of Things.


Cherry acts as a hub for your house and allows any connected component to communicate with each other. Cherry's power comes from its plugin system. Connected devices can talk to each other. Adding a new component to the system is as simple as writing a few lines of code (Node.js module).

As an example, let's say you have a Philips Hue light and you want to turn it on by pressing a button. You just need a few lines of code:

module.exports = function (cherry) {
  console.log("lightswitch ready to rock");

    pin: function (message) {
      var plugins = cherry.plugins();
      if (message.state === "high") {
        plugins.hue({on: true});
      } else if (message.state === "low") {
        plugins.hue({on: false});

See this blog post for more background:


npm install -g cherry-core
# you may install additional plugins through npm
# npm install -g cherry-wit cherry-spotify cherry-hue
cherry path/to/config.json

config.json looks something like that (cf. config.json.sample):

  "port": 4433,
  "witd_url": "",
  "wit_token": "MY_WIT_TOKEN",
  "hipchat_jid": "",
  "hipchat_pwd": "mypwd",
  "hipchat_room": "",
  "hue_host": "",
  "hue_user": "willyblandin",
  "demo_port": 5576,
  "gpio_pins": {
    "22": ["in", "both"]
  "plugins": [

 Using existing plugins

In your config.json file, you specify the list of plugins you want to use.

Each item can either be:

  • the name of a globally or locally installed npm package, e.g. cherry-spotify
  • a path to a Javascript file, e.g. ./examples/lightswitch.js
  • a CoffeeScript file

 Creating a plugin

We've focused on making it really simple and easy to write a plugin for Cherry. You can check the examples directory, cherry-spotify, cherry-hue or below:

mkdir cherry-logger
npm init

cat > index.js <<EOF
module.exports = function (cherry) {
  // listen for chat messages and turn lights on or play next song
    chat: function (msg) {
      var plugins = cherry.plugins();

      if (msg === 'next song') {
      } else if (msg === 'lights on') {
        plugins.hue({on: true});

npm publish

Built-in plugins

You can configure plugins through a config.json file.


Note: this will be extracted into a cherry-hipchat plugin pretty soon. Produces: "from: chat"

"hipchat_jid": "",
"hipchat_pwd": "mypassword",
"hipchat_room": " Username",


cp config.json.sample config.json
lein cljsbuild auto
node dist/cherry.js config.json


We use cherry everyday at the office and have put together a small script that should get everything up and running from a Raspberry Pi:

curl -s | sudo -E sh


  • figure out how to allow CLJS plugins