Commit b4c9b70f authored by Peter Müller's avatar Peter Müller

Added readme, updated package.json

parent d9fd8332
## v1.0.0 2017-05-28
- First official release
# Pimatic PCF8574 Plugin
[![npm version](](
[![build status](](
(c) 2017 Peter Müller <>
# pimatic-pcf8574
`pimatic-pcf8574` is a [pimatic]( plugin that enables PCF8574 portexpander ICs to be used as **Switch**, **ContactSensor**, **PresenceSensor** or **ShutterController**.
The PCF8574/PCF8574A is an 8 bit/pin port expander IC, which can be controlled over the I2C-Bus.
Each of the 8 pins can be separately used as an input or output.
It also offers an interrupt signal, which can be used to detect input changes by the I2C master (e.g. a Raspberry Pi).
For more information about the PCF8574/PCF8574A please consult the [datasheet from Texas Instruments](
## Installation
You can simply install this plugin via the frontend.
Alternatively you can add it manually to the `config.json` of pimatic:
"plugin": "pcf8574",
"i2cBusNr": 1
This will fetch the most recent version from npm-registry on the next pimatic start and install the plugin.
## Configuration
The whole configuration can be made via the frontend in the *Devices* section.
You have to add one `PCF8574IC` device first, because the other devices will need this.
If you delete a `PCF8574IC` device, all devices associated to this device will also be deleted.
### Device PCF8574IC
This is a basic device which provides the inputs and outputs (8 pins) for the other devices.
You have to set the `address` of the IC.
Optionally you can enable the detection of input changes using an `interrupt` or using active `polling`.
If you need input change detection you should prefer using the interrupt, because polling leeds to a higher load on the I2C bus.
The pin number of the interrupt pin must to be the *BCM* pin number of the Raspberry Pi. (see
### PCF8574ContactSensor, PCF8574PresenceSensor, PCF8574Switch and PCF8574Shutter
All other devices (`PCF8574ContactSensor`, `PCF8574PresenceSensor`, `PCF8574Switch` and `PCF8574Shutter`) needs an `PCF8574IC` device and a pin number of the IC.
Also you can define each pin as `inverted`, which assumes that the hardware inverts the logical signal.
A `PCF8574Shutter` device needs two `PCF8574IC` devices (which can be the same device) and also two pin numbers for up and down.
## License
Licensed under GPL Version 2
Copyright (c) 2017 Peter Müller <> (
......@@ -10,17 +10,24 @@
"raspberry pi",
"main": "pcf8574",
"files": [
"version": "0.0.1",
"homepage": "",
"private": true,
"version": "1.0.0",
"homepage": "",
"license": "GPL-2.0",
"repository": {
"type": "git",
"url": ""
......@@ -112,9 +112,10 @@ module.exports = (env) ->
# remove all devices which belongs to this device
_.forEach @framework.deviceManager.getDevices(), (device) =>
if device.config.PCF8574IC is @id "removing device #{} because it belongs to #{@id}"
_.forEach pcf8574DevicesEnums, (deviceEnum) =>
if device.config[deviceEnum]? and device.config[deviceEnum] is @id "removing device #{} because it belongs to #{@id}"
# remove from the other device classes configs
_.forEach pcf8574Devices, (device) =>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment