{"id":14383982,"url":"https://github.com/mwittig/pimatic-johnny-five","last_synced_at":"2025-10-07T08:25:26.693Z","repository":{"id":57324244,"uuid":"44432077","full_name":"mwittig/pimatic-johnny-five","owner":"mwittig","description":"Pimatic Plugin for Johnny Five, a Robotics and IoT programming framework - http://johnny-five.io","archived":false,"fork":false,"pushed_at":"2019-03-26T13:42:12.000Z","size":342,"stargazers_count":10,"open_issues_count":4,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-07T09:18:00.184Z","etag":null,"topics":["home-automation","internet-of-things","iot","johnny-five","pimatic","pimatic-plugin"],"latest_commit_sha":null,"homepage":null,"language":"CoffeeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mwittig.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-17T10:00:23.000Z","updated_at":"2022-03-03T12:54:39.000Z","dependencies_parsed_at":"2022-09-21T01:01:23.951Z","dependency_job_id":null,"html_url":"https://github.com/mwittig/pimatic-johnny-five","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwittig%2Fpimatic-johnny-five","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwittig%2Fpimatic-johnny-five/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwittig%2Fpimatic-johnny-five/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwittig%2Fpimatic-johnny-five/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mwittig","download_url":"https://codeload.github.com/mwittig/pimatic-johnny-five/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248519445,"owners_count":21117758,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["home-automation","internet-of-things","iot","johnny-five","pimatic","pimatic-plugin"],"created_at":"2024-08-28T18:01:04.779Z","updated_at":"2025-10-07T08:25:21.611Z","avatar_url":"https://github.com/mwittig.png","language":"CoffeeScript","funding_links":[],"categories":["CoffeeScript"],"sub_categories":[],"readme":"\n# pimatic-johnny-five\n\n[![npm version](https://badge.fury.io/js/pimatic-johnny-five.svg)](http://badge.fury.io/js/pimatic-johnny-five)\n[![Build Status](https://travis-ci.org/mwittig/pimatic-johnny-five.svg?branch=master)](https://travis-ci.org/mwittig/pimatic-johnny-five)\n\nPimatic Plugin for [Johnny Five](http://johnny-five.io), a Robotics and IoT programming framework. \n\n![Logo](https://github.com/mwittig/pimatic-johnny-five/raw/master/assets/images/johnny-five-icon.png)\n\nThanks to Johnny Five, you can easily integrate a wide range of sensors and actuators attached to \n* an Arduino board, \n* an ESP8266 board, \n* a Photon board, or\n* your Raspberry Pi. Generally, it is possible to use multiple boards at the same time which may be local boards, \ni.e. the host running pimatic or a board attached via USB to the pimatic host, or remote boards connected via LAN, \nWiFi or some proxy device on the local network.\n\nFor Arduino, the universal Firmata library is used which implements a protocol for the \ncommunication with host computer. Thus, there is no need to modify the Arduino sketch when new sensors or actuators \nare connected to your Arduino. Johnny Five also supports a variety of [I2C](https://en.wikipedia.org/wiki/I%C2%B2C) and\n[1-Wire](https://en.wikipedia.org/wiki/1-Wire) devices.\n\nSupport for ESP8266 is experimental at the moment as it requires the \n[\"esp\" development branch](https://github.com/firmata/arduino/tree/esp) of Firmata. \n\n## Status of implementation\n\nThis version supports the following devices\n* ContactSensor, PresenceSensor, and ButtonSensor (digital input)\n* Dimmer (digital output with PWM)\n* Switch (digital output)\n* Relay Switch (relay boards attached to digital output)\n* Temperature Sensor (analog, I2C and 1-Wire)\n* Temperature \u0026 Humidity Sensor (analog, I2C - sorry, no 1-Wire support, to date)\n* Temperature \u0026 Barometric Pressure Sensor (I2C devices such as BMP180, MPL115A2, MPL3115A2)\n* RGB LED (common cathode/common cathode LEDs and PCA9685, an I2C-bus controlled 16-channel LED controller)\n\nThe OLED and LCD display devices are incomplete and, thus, should not be used.\nThey won't do anything useful anyway.\n\nBoard-support has been tested with \"arduino\", \"raspi-io\", \"particle-io\", \"etherport\" and \"expander\" board types.\nSupport for \"etherport-client\" and \"esp8266\" is experimental. \n\n### Contributions\n\nIf you like this plugin, please consider \u0026#x2605; starring \n[the project on github](https://github.com/mwittig/pimatic-johnny-five). Contributions to the project are  welcome. You can simply fork the project and create a pull request with \nyour contribution to start with. \n\n\n### Platform Support\n\nThe plugin currently supports Arduino, Raspberry Pi boards, and tethering. More boards can be\nadded on request. The Johnny Five project provides a detailed\n[list of supported platforms](https://johnny-five.io/platform-support/) with\ndetailed information on supported features and how to set up the board.\n\n\n\n## Plugin Configuration\n\nYou can load the plugin by editing your `config.json` to include the following\nin the `plugins` section. You need to configure the boards you wish to use to control\nyour devices. Generally, a board is a control system as part of pimatic to drive the\nhardware board you use, for example,\n* your Raspberry Pi,\n* an Arduino board attached to your Raspberry Pi via USB,\n* an I2C Expander chip connected to to your Raspberry Pi or Arduino, or\n* a remote board connected via etherport.\n\nThe following configuration is an example for pimatic with an Arduino Nano\nconnected via USB on ttyUSB1 and an Expander connected to the Arduino:\n\n    {\n        \"plugin\": \"johnny-five\",\n        \"boards\": [\n        {\n          \"id\": \"1\",\n          \"boardType\": \"arduino\",\n          \"port\": \"/dev/ttyUSB1\",\n          \"baudrate\": 57600\n        },\n        {\n          \"id\": \"2\",\n          \"boardType\": \"raspi-io\"\n        },\n        {\n          \"id\": \"3\",\n          \"boardType\": \"expander\",\n          \"port\": \"1\",\n          \"controller\": \"MCP23017\"\n        }\n      ]\n    }\n\nThe plugin has the following configuration properties:\n\n| Property  | Default  | Type    | Description                                 |\n|:----------|:---------|:--------|:--------------------------------------------|\n| debug     | false    | Boolean | Provide additional debug output if true     |\n| boards    | -        | Array   | An Array of board configuration objects     |\n\nThe configuration for a board is an object comprising the following properties.\n\n| Property  | Default   | Type    | Description                                 |\n|:----------|:----------|:--------|:--------------------------------------------|\n| id        | -         | String  | Unique identifier used as a reference by a device configuration |\n| boardType | \"arduino\" | String  | The type of board, see supported types below |\n| port      | -         | String  | Path or name of device port                 |\n| token     | -         | String  | Particle token. Only required for particle-io board type |\n| deviceId  | -         | String  | Particle device id. Only required for particle-io board type |\n| controller | -        | String  | Expander controller type (see below). Only required for expander board type |\n| address   | -         | String  | Expander I2C address for expander board type or IP address/hostname for esp8266 or etherport-client board type |\n\nSupported `boardTypes`\n* \"arduino\" - see [Platform Support](http://johnny-five.io/platform-support/)\n* \"raspi-io\" - works with all Raspberry Pi models (Zero has not been tested yet). Note, wiringPi must be installed\n* \"particle-io\" - known to work for\n  [Particle Photon](http://johnny-five.io/platform-support/#particle-photon) and\n  [Sparkfun Photon RedBoard](http://johnny-five.io/platform-support/#sparkfun-photon-redboard)\n* \"etherport\" - works for Arduinos with ethernet or wifi shields, a software relay to integrate a remote Raspberry will be provided soon.\n* \"expander\" - see supported controller types below\n* \"esp8266\" and \"etherport-client\" - works for remote boards like ESP6266 which provide a listener socket pimatic needs \n  to connect to\n\nSupported Expander `controller` types:\n\n* \"MCP23017\"\n* \"MCP23008\"\n* \"PCF8574\"\n* \"PCF8574A\"\n* \"PCF8575\"\n* \"PCA9685\"\n* \"PCF8591\"\n* \"MUXSHIELD2\"\n* \"GROVEPI\"\n* \"CD74HC4067\"\n\nThe `address` needs only to be set if an I2C address other than the default\naddress is used.\n\n| Controller   | Address Range | Default |\n|--------------|---------------|--------|\n| \"MCP23017\"   | \"0x20\"-\"0x27\" | \"0x20\" |\n| \"MCP23008\"   | \"0x20\"-\"0x27\" | \"0x20\" |\n| \"PCF8574\"    | \"0x20\"-\"0x27\" | \"0x20\" |\n| \"PCF8574A\"   | \"0x38\"-\"0x3F\" | \"0x38\" |\n| \"PCF8575\"    | \"0x20\"-\"0x27\" | \"0x20\" |\n| \"PCF8591\"    | \"0x48\"-\"0x4F\" | \"0x48\" |\n| \"PCA9685\"    | \"0x40\"-\"0x4F\" | \"0x40\" |\n| \"GROVEPI\"    | \"0x04\"        | \"0x04\" |\n| \"CD74HC4067\" | \"0x0A\"-\"0x0D\" | \"0x0A\" |\n\n## Device Configuration\n\nDevices must be added manually to the device section of your pimatic config. For pin assignment conventions \nsee the [document on pin naming](https://github.com/mwittig/pimatic-johnny-five/blob/master/assets/docs/pin-naming.md).\n\n### Switch Device\n\n`JohnnyFiveSwitch` is based on the PowerSwitch device class. You need to provide\nthe address of the output `pin`. The device is mapped to a [JF \"digital output\" Pin](http://johnny-five.io/api/pin/).\n\n    {\n          \"id\": \"jf-do-1\",\n          \"class\": \"JohnnyFiveSwitch\",\n          \"name\": \"Digital Output (pin 13)\",\n          \"pin\": \"13\",\n          \"boardId\": \"1\"\n    }\n\nIt has the following configuration properties:\n\n| Property  | Default  | Type    | Description                                 |\n|:----------|:---------|:--------|:--------------------------------------------|\n| pin       |          | String  | Pin address of the digital output           |\n| boardId   | -        | String  | Id of the board to be used                  |\n\nThe Digital Output Device exhibits the following attributes:\n\n| Property      | Unit  | Type    | Acronym | Description                            |\n|:--------------|:------|:--------|:--------|:---------------------------------------|\n| state         | -     | Boolean | -       | Switch State, true is on, false is off |\n\nThe following predicates and actions are supported:\n\n* {device} is turned on|off\n* switch {device} on|off\n* toggle {device}\n\n### PWM Output (Dimmer)\n\n`JohnnyFivePwmOutput` is based on the DimmerActuator device class. You need to provide\nthe address of the output `pin`. The device is mapped to a [JF Led](http://johnny-five.io/api/led/).\n\n    {\n          \"id\": \"jf-pwm-1\",\n          \"class\": \"JohnnyFivePwmOutput\",\n          \"name\": \"Digital PWM Output (pin 3)\",\n          \"pin\": \"3\",\n          \"boardId\": \"1\"\n    }\n\nIt has the following configuration properties:\n\n| Property  | Default  | Type    | Description                                 |\n|:----------|:---------|:--------|:--------------------------------------------|\n| pin       |          | String  | Pin address of the (PWM capable) digital output           |\n| boardId   | -        | String  | Id of the board to be used                  |\n\nThe Digital Output Device exhibits the following attributes:\n\n| Property      | Unit  | Type    | Acronym | Description                            |\n|:--------------|:------|:--------|:--------|:---------------------------------------|\n| state         | -     | Boolean | -       | Switch State, true is on, false is off |\n| dimlevel      | %     | Number  | -       | A percentage value of the PWM duty cycle | \n\nThe following predicates and actions are supported:\n\n* {device} is turned on|off\n* switch {device} on|off\n* toggle {device}\n* dim {device} to {value}\n\n### RGB LED\n\n`JohnnyFiveRgbLed` is based on the DimmerActuator device class. You need to provide\nthe address of the output `pins` for red, green, and blue. The property `isAnode` is\nused to specify whether the LED has common anode or cathode.\nThe device is mapped to a [JF Led.RGB](http://johnny-five.io/api/led.rgb/).\n\n    {\n          \"id\": \"jf-pwm-1\",\n          \"class\": \"JohnnyFiveRgbLed\",\n          \"name\": \"RGB LED\",\n          \"boardId\": \"2\",\n          \"pins\": {\n              \"red\": \"GPIO16\",\n              \"green\": \"GPIO20\",\n              \"blue\": \"GPIO21\"\n          },\n          \"isAnode\": true,\n    }\n\nIt has the following configuration properties:\n\n| Property  | Default  | Type    | Description                                 |\n|:----------|:---------|:--------|:--------------------------------------------|\n| pins      |          | Object  | The pins assigned to the RGB LED, defined by an object with the following properties.           |\n| pins.red  |          | String  | The pin for red           |\n| pins.green |         | String  | The pin for green           |\n| pins.blue  |         | String  | The pin for blue           |\n| isAnode   | false    | Boolean | If set to true the LED is a common anode LED. Defaults to false, indicating a common cathode LED |\n| boardId   | -        | String  | Id of the board to be used                  |\n\nThe Digital Output Device exhibits the following attributes:\n\n| Property      | Unit  | Type    | Acronym | Description                            |\n|:--------------|:------|:--------|:--------|:---------------------------------------|\n| state         | -     | Boolean | -       | Switch State, true is on, false is off |\n| dimlevel      | %     | Number  | -       | A percentage value of the PWM duty cycle | \n| color         | -     | String  | RGB     | A 6-digit RGB hex string starting with, or a CSS color name, or a variable reference |\n\nThe following predicates and actions are supported:\n\n* {device} is turned on|off\n* switch {device} on|off\n* toggle {device}\n* dim {device} to {value}\n* j5 set color {device} to {value}\n\n### Presence Sensor\n\n`JohnnyFivePresenceSensor` is a digital input device based on the `PresenceSensor` device class. You need\nto provide the address of the input `pin` and the `boardId`.\n\n    {\n          \"id\": \"jf-cs-1\",\n          \"class\": \"JohnnyFiveContactSensor\",\n          \"name\": \"Digital Input (pin 4)\",\n          \"pin\": \"4\",\n          \"boardId\": \"1\"\n    }\n\nIt has the following configuration properties:\n\n| Property  | Default  | Type    | Description                                 |\n|:----------|:---------|:--------|:--------------------------------------------|\n| pin       | -        | String  | Pin address of the digital output           |\n| boardId   | -        | String  | Id of the board to be used                  |\n| invert    | false    | Boolean | If true, invert the presence sensor state   |\n\nThe presence sensor exhibits the following attributes:\n\n| Property      | Unit  | Type    | Acronym | Description                            |\n|:--------------|:------|:--------|:--------|:---------------------------------------|\n| presence      | -     | Boolean | -       | Presence State, true is present, false is absent |\n\nThe following predicates are supported:\n\n* {device} is present|absent\n\n\n### Contact Sensor\n\n`JohnnyFiveContactSensor` is a digital input device based on the `ContactSensor` device class. You need\nto provide the address of the input `pin`.\n\n    {\n          \"id\": \"jf-cs-1\",\n          \"class\": \"JohnnyFiveContactSensor\",\n          \"name\": \"Digital Input (pin 4)\",\n          \"pin\": \"4\",\n          \"boardId\": \"1\"\n    }\n\nIt has the following configuration properties:\n\n| Property  | Default  | Type    | Description                                 |\n|:----------|:---------|:--------|:--------------------------------------------|\n| pin       |          | String  | Pin address of the digital output           |\n| boardId   | -        | String  | Id of the board to be used                  |\n| invert    | false    | Boolean | If true, invert the contact sensor state    |\n\nThe presence sensor exhibits the following attributes:\n\n| Property      | Unit  | Type    | Acronym | Description                            |\n|:--------------|:------|:--------|:--------|:---------------------------------------|\n| contact       | -     | Boolean | -       | Contact State, true is opened, false is closed |\n\n\nThe following predicates are supported:\n\n* {device} is opened|closed\n\n### Button Device\n\nThe Button Device is a digital input device based on the ContactSensor device class. You need\nto provide the address of the input `pin`.\n\n    {\n          \"id\": \"jf-b-1\",\n          \"class\": \"JohnnyFiveButton\",\n          \"name\": \"Button (pin 2)\",\n          \"pin\": \"2\",\n          \"boardId\": \"1\"\n    }\n\nThe Button Device has the following configuration properties:\n\n| Property   | Default  | Type    | Description                                                                   |\n|:-----------|:---------|:--------|:------------------------------------------------------------------------------|\n| pin        | -        | String  | Pin address of the digital output                                             |\n| boardId    | -        | String  | Id of the board to be used                                                    |\n| pullUp     | false    | Boolean | If true, activate the internal pull-up. As a result, a high signal will be read if push-button is open |\n| invert     | false    | Boolean | If true, invert the button state                                              |\n| holdTime   | 500      | Number  | Time in milliseconds that the button must be held until triggering an event   |\n| controller | \"\"       | String  | Controller interface type if an EVshield is used. Supports 'EVS_EV3' and 'EVS_NXT' shields |\n\nFor wiring examples, see:\n\n* [Button](http://johnny-five.io/examples/button/)\n* [Button - Pull-up](http://johnny-five.io/examples/button-pullup/)\n* [Button - EVShield NXT](http://johnny-five.io/examples/button-EVS_NXT/)\n\nThe following predicates are supported:\n\n* {device} is opened|closed\n\n### Relay\n\nThe Relay Device represents a single digital Relay attached to the physical board. You need\nto provide the address of the output `pin` controlling the relay.\n\n    {\n        \"id\": \"jf-r-1\",\n        \"name\": \"Johnny Five Relay\",\n        \"class\": \"JohnnyFiveRelay\",\n        \"boardId\": \"1\",\n        \"pin\": \"12\",\n        \"type\": \"NO\"\n    }\n\nThe Relay Device supports two wiring options:\n\n* \"NO\", Normally Open: When provided with any voltage supply, the output is on. The default mode is LOW or \"off\",\n  requiring a HIGH signal to turn the relay off.\n* \"NC\", Normally Closed: When provided with any voltage supply, the output is off. The default mode is LOW or “off”,\n  requiring a HIGH signal to turn the relay on.\n\nFor wiring examples, see:\n\n* [Relay \"NO\" and \"NC\" wiring](http://johnny-five.io/examples/relay/)\n\n\nThe Relay Device has the following configuration properties:\n\n| Property   | Default  | Type    | Description                                                                   |\n|:-----------|:---------|:--------|:------------------------------------------------------------------------------|\n| pin        | -        | String  | Pin address of the digital output                                             |\n| boardId    | -        | String  | Id of the board to be used                                                    |\n| type       | \"NO\"     | String  | Whether the relay is wired to be normally open (\"NO\"), or normally closed (\"NC\") if pin output is LOW |\n\n### Temperature Sensor\n\nThe Temperature Sensor is an input device based on the TemperatureSensor device class. It currently\nsupports 4,7k NTC thermistors (\"TINKERKIT\"), various I2C sensors, and the DS18B20 1Wire sensor.\nDepending on type of sensor different properties are required.\n\n    {\n        \"id\": \"jf-t-1\",\n        \"name\": \"Johnny Five Temperature\",\n        \"class\": \"JohnnyFiveTemperature\",\n        \"boardId\": \"1\",\n        \"controller\": \"SI7020\",\n        \"address\": \"0x40\",\n        \"temperatureOffset\": -1\n    },\n    {\n        \"id\": \"jf-t-2\",\n        \"name\": \"Johnny Five Temperature 2\",\n        \"class\": \"JohnnyFiveTemperature\",\n        \"boardId\": \"1\",\n        \"pin\": \"A0\",\n        \"controller\": \"TINKERKIT\",\n        \"offset\": -2.75,\n        \"units\": \"metric\"\n    }\n\nThe Temperature Sensor has the following configuration properties:\n\n| Property   | Default     | Type     | Description                                                                   |\n|:-----------|:------------|:---------|:------------------------------------------------------------------------------|\n| controller | \"TINKERKIT\" | String   | Controller interface type to be used, one of TINKERKIT, LM35, TMP36, DS18B20, MPU6050, GROVE, BMP180, MPL115A2, MPL3115A2, HTU21D, SI7020 |                                         |\n| pin        | \"\"          | String   | The pin address. Required if controller is TINKERKIT, optional otherwise |                                         |\n| address    | \"\"          | String   | If controller is an I2C device and address is not provided the device-specfic default address applies |                                         |\n| boardId    | -           | String   | Id of the board to be used                                                    |\n| interval   | 10          | Number   | The time interval in seconds at which the sensor will be read |\n| units      | \"metric\"    | String   | Defines whether metric, imperial, or standard units shall be used                                              |\n| offset     | 0           | Number   | A positive or negative offset value to adjust a deviation of the temperature sensor |\n| controller | \"\"          | String   | Controller interface type if an EVshield is used. Supports 'EVS_EV3' and 'EVS_NXT' shields |\n\naddress:\n        description: \"\"\"\n          The I2C address. If controller is an I2C device and address is not provided the device-specfic\n          default address applies.\n        \"\"\"\n        type: \"string\"\n        required: false\n      \nFor wiring examples, see:\n* [Temperature TINKERKIT](http://johnny-five.io/examples/tinkerkit-thermistor/)\n    * If you don't have the tinkerkit shield, here's a\n    [wiring sketch](https://github.com/mwittig/pimatic-johnny-five/raw/master/assets/sketches/arduino-temperature-4k7-thermistor.png)\n    for the thermistor.\n* [Temperature MPU6050](http://johnny-five.io/examples/temperature-mpu6050/)\n\n## Release History\n\nSee [Release History](https://github.com/mwittig/pimatic-johnny-five/blob/master/HISTORY.md).\n\n## Credits\n\nThe 'johnny-five-icon' files have been created with [Inkscape](https://inkscape.org) using artwork\nby [Mike Sgier](http://msgierillustration.com/) published as part of the Johnny Five project.\n\nCopyright (c) 2012, 2013, 2014 Rick Waldron \u003cwaldron.rick@gmail.com\u003e\nCopyright (c) 2014, 2015, 2016 The Johnny-Five Authors\n\nMIT-License: https://github.com/rwaldron/johnny-five/blob/master/LICENSE-MIT\n\n## License\n\nCopyright (c) 2015-2017, Marcus Wittig and contributors. All rights reserved.\n\n[AGPL-3.0](https://github.com/mwittig/pimatic-johnny-five/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmwittig%2Fpimatic-johnny-five","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmwittig%2Fpimatic-johnny-five","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmwittig%2Fpimatic-johnny-five/lists"}