Coder Social home page Coder Social logo

homebridge-revpidio's Introduction

Homebridge plugin for Revolution PIs digital I/O modules

This plugin provides HomeKit switches for the digital outputs of the RevPi DIO & RevPi DO. Additional the digital inputs can be configured as some type of sensor inpur.

Both digital outputs and inputs uses the type names of the digital outputs as setup in PiCtory.

Installation

  • Prepare RevPi core
  • Install homebridge
  • Install & Setup this plugin

You can skip the first 2 steps, if homebridge is already running on your RevPi core.

Prepare Revolution Pi

Install at least a jessie image on the Rev Pi core.

Remove old node.js:

sudo -i
apt-get remove nodered -y
apt-get remove nodejs nodejs-legacy -y
exit

Install node.js version manager. This will install node.js and npm.

curl -L https://git.io/n-install | bash

Create configuration in PiCtory

Install homebridge

The installation instructions can also be found here.

sudo apt-get install libavahi-compat-libdnssd-dev

sudo npm install -g --unsafe-perm homebridge

run homebridge using homebridge to check if it is correctly installed. The message "No plugins found. See the README for information on installing plugins." should appear.

Install & Setup RevPiDO plugin

Install plugin dependencie "RevPiModIO":

sudo apt-get update

sudo apt-get install python3-revpimodio2

sudo apt-get dist-upgrade

Install this plugin using: npm install -g homebridge-revpidio

Create or Update your hombridge configuration file. See sample_config.json or snippets below.

Configuration Digital Ouptuts

Configuration sample:

accessories : [
  {
    "accessory": "RevPiDO",
    "name": "A Light",
    "output_name": "O_3",
    "type": "light",
    "invert": false
  }
]

Fields:

  • "accessory": Must always be "RevPiDO" (required)
  • "name": Can be anything (required)
  • "output_name": type name of the digital output given in PiCtory (e.g. "O_1" for output 1). (required)
  • "type" : one of the following option ["switch", "light", "fan"] default: "switch"
  • "invert": true or false, output is logical inverted, optional default: false

Configuration Digital Inputs

Configuration sample:

accessories : [
  {
    "accessory": "RevPiDI",
    "name": "An Input",
    "input_name": "I_3",
    "type" : "motion",
    "invert": false
  }
]

Fields:

  • "accessory": Must always be "RevPiDI" (required)
  • "name": Can be anything (required)
  • "input_name": type name of the digital input given in PiCtory (e.g. "I_1" for input 1). (required)
  • "type" : one of the following option ["contact", "motion", "smoke", "leak", "occupancy", "button"*, "state"**, "doorbell"***] default: "contact"
  • "invert": true or false, input is logical inverted, optional default: false

*: Button with no state, e.g. trigger for a scene

**: Like a switch, this switch can not switche manually

***: currently not supported in iOS (may be in the future, use motion)

Configuration PiCore Info

To show the RevPi core temperatur use this accessory.

Configuration sample:

accessories : [
  {
    "accessory": "RevPiCore",
    "name": "My RevPi core"
  }
]

Fields:

  • "accessory": Must always be "RevPiCore" (required)
  • "name": Can be anything (required)

Contributions & Thanks

Special thanks for contributions:

homebridge-revpidio's People

Contributors

christian1313 avatar

Stargazers

Tuan Duc Tran avatar  avatar Siwakorn Sukprasertchai avatar Markus Knapp avatar

Watchers

Markus Knapp avatar James Cloos avatar  avatar

homebridge-revpidio's Issues

Devices (Output) not switching

First of all: This is great work and I'm so glad, that I found this project! :)

But my problem is, that nothing happens when I switch a port/device in my iPhone.

I installed homebridge and homebridge-revpidio and everything looks fine:

[2018-9-24 12:55:16] Loaded config.json with 4 accessories and 0 platforms.
[2018-9-24 12:55:16] ---
[2018-9-24 12:55:16] Loaded plugin: homebridge-revpidio
[2018-9-24 12:55:16] Registering accessory 'homebridge-revpidio.RevPiDO'
[2018-9-24 12:55:16] Registering accessory 'homebridge-revpidio.RevPiDI'
[2018-9-24 12:55:16] Registering accessory 'homebridge-revpidio.RevPiCore'
[2018-9-24 12:55:16] ---
[2018-9-24 12:55:16] Loading 0 platforms...
[2018-9-24 12:55:16] Loading 4 accessories...
[2018-9-24 12:55:16] [Brunnen] Initializing RevPiDO accessory...
[2018-9-24 12:55:16] [Rasensprenger] Initializing RevPiDO accessory...
[2018-9-24 12:55:16] [Licht] Initializing RevPiDO accessory...
[2018-9-24 12:55:16] [Mein RevPi Core] Initializing RevPiCore accessory...
Setup Payload:
X-HM://0023ISYWZD80J
Scan this code with your HomeKit app on your iOS device to pair with Homebridge:

I can also switch my output port via cmd line:

pi@RevPi6155:~ $ piTest -x
pi@RevPi6155:~ $ piTest -w Brunnen,1
Set bit 0 on byte at offset 81. Value 1
pi@RevPi6155:~ $ piTest -w Brunnen,0
Set bit 0 on byte at offset 81. Value 0

Also the devices were recognised in HomeKit (iPhone).

This is my (anonymised) config.json, placed in .homebridge/config.json:

{
	"bridge": {
		"name": "RevPiHomebridge",
		"username": "FF:FF:FF:FF:FF:FF",
		"port": 12345,
		"pin": "123-45-678"
	},
	"description": "Meine RevPi HomeBridge",
	"accessories": [{
		"accessory": "RevPiDO",
		"name": "Brunnen",
		"output_name": "Brunnen",
		"type": "switch"
	},
	{
		"accessory": "RevPiDO",
		"name": "Rasensprenger",
		"output_name": "O_2",
		"type": "switch"
	},
	{
		"accessory": "RevPiDO",
		"name": "Licht",
		"output_name": "O_3",
		"type": "light"
	},
	{
		"accessory": "RevPiCore",
		"name": "Mein RevPi Core"
	}
	],
	"platforms": []
}

And here's my config on the RevPi:
schnappschuss 2018-09-24 13 20 00

Any ideas?
Is there a way to view a log or to debug? The only thing I found it this:

pi@RevPi6155:~ $ tail /var/log/kern.log
Sep 24 13:36:33 RevPi6155 kernel: [   79.280529] piControl:
Sep 24 13:36:33 RevPi6155 kernel: [   79.389751] piControl: start data exchange
Sep 24 13:36:33 RevPi6155 kernel: [   79.612027] piControl: piDIOComm_Init done 0
Sep 24 13:36:33 RevPi6155 kernel: [   79.613722] piControl: sniff2A: input value 0
Sep 24 13:36:33 RevPi6155 kernel: [   79.613733] piControl: sniff2B: input value 0
Sep 24 13:36:33 RevPi6155 kernel: [   79.613743] piControl: set BridgeState to running
Sep 24 13:37:04 RevPi6155 kernel: [  110.605133] piControl piControl0: Invalid Ioctl
Sep 24 13:37:04 RevPi6155 kernel: [  110.626846] piControl piControl0: Invalid Ioctl
Sep 24 13:45:22 RevPi6155 kernel: [  608.376165] piControl piControl0: Invalid Ioctl
Sep 24 13:45:22 RevPi6155 kernel: [  608.393478] piControl piControl0: Invalid Ioctl

Any help appreciated...! :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.