Provides actuators and sensors for the raspberry pi gpio pins.
Latest commit 5e4fe78 Mar 20, 2016 @sweetpi sweetpi 0.8.15
Failed to load latest commit information.
LICENSE Added License and v0.9 compatibility, update to onoff 1.0.4 Mar 20, 2016 Added documentation on "defaultState" property - pimatic/pimatic#759 Dec 22, 2015 labels for contact device Aug 22, 2015 pimatic v0.9 fixes Mar 20, 2016
package.json 0.8.15 Mar 20, 2016


Actuators and sensors for the Raspberry Pi GPIO pins. This plugin uses the node.js module onoff.

Plugin Configuration

You can load the plugin by editing your config.json to include:

   "plugin": "gpio"

in the plugins Array.

Device Configuration

Devices can be added by adding them to the devices Array in the config file. Set the class property to GpioSwitch, GpioPresence, or GpioContact, respectively. By default, the device state will be true , i.e. on, opened, or present, when the GPIO pin is HIGH. If you need the device to be active on LOW, set the property inverted to true.

The GpioSwitch device additionally provides the optional defaultState property which can be used to set the initial switch state to the given value. If the property is not present the last state will be recovered from database or it will be set to false if the last state cannot be obtained.

For device configuration options see the device-config-schema file.

GPIO Pin Numbering

Use the GPIO numbers from the RPi Low-level peripherals wiki page.

Device examples

GpioSwitch Device ("active LOW" and "defaultState")

  "id": "led-light",
  "class": "GpioSwitch", 
  "name": "led light",
  "gpio": 17,
  "inverted": true,
  "defaultState": false

GpioPresence Sensor

  "id": "presence-sensor",
  "class": "GpioPresence", 
  "name": "motion detector",
  "gpio": 18 

GpioContact Sensor

  "id": "contact-sensor",
  "class": "GpioContact", 
  "name": "contact detector",
  "gpio": 18