Skip to content

Commit

Permalink
added 'Outlet' as device type, minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas22122212 committed Jan 4, 2018
1 parent 3116328 commit 3093ecc
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 15 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ Homebridge plugin purpose-built for controlling 433MHz radio frequency outlets w

This is a forg from homebridge-rfoutlets as it didn't feature different protocols. How ever there is no support for different GPIO pins anymore. I needed protocol 4 to get my [brennenstuhl RC-CE1-4001](https://www.brennenstuhl.com/en-DE/Comfort-Line-Remote-Control-Set-RC-CE1-4001)(same as LIDL Silvercrest RCR DP3 3711-A) working.

Tested on a Raspberry Zero W Raspbian (Debian) and Node.js v8.9.1. This should work on most Raspberry Pi models, however YMMV
Tested on a Raspberry Zero W (armv6) Raspbian (Debian) and Node.js v8.9.1. This should work on most Raspberry Pi models, however YMMV

Supports *lights*, *switches*, and *fans*
Supports *lights*, *switches*, "outlets" and *fans*

## Installation

Expand All @@ -21,16 +21,16 @@ Supports *lights*, *switches*, and *fans*
## Notes

- The user which homebridge is run from does **not** have to be a *sudoer* as like in the original homebridge-rfoutlets
- The 433MHz transmitter must be connected to GPIO pin 0 (physical 11)
- The 433MHz transmitter must be connected to pin 0 (GPIO17, physical 11)
- A great guide on how to record RF signals and set up your Pi to transmit can be found [here](https://www.samkear.com/hardware/control-power-outlets-wirelessly-raspberry-pi "Pi 433Mhz Transmitter Guide"). Note: the web portion of the guide is not required
- A better but german guide is [here](https://tutorials-raspberrypi.de/raspberry-pi-funksteckdosen-433-mhz-steuern/)
- A more specific information on how to record RF signals can be found [here](https://github.com/sui77/rc-switch/issues/103). This was the most valuable hit to get my outlets working as they use protocol 4 and 5 but only 4 is important
- A more specific information on how to record RF signals can be found [here](https://github.com/sui77/rc-switch/issues/103). This was the most valuable hint to get my outlets working as they use protocol 4 and 5 but only 4 is important
- My german guide how to record the codes for Silvercrest/brennenstuhl outlets can be found [here](https://forum.pimatic.org/topic/3337/433-mhz-funksteckdosen-lidl-silvercrest-rcr-dp3-3711-a-brennenstuhl-mit-homeduino/19)

## Configuration

- `name`: Name of your device
- `type`: `Light`, `Switch`, or `Fan` (**required**)
- `type`: `Light`, `Switch`, `Outlet` or `Fan` (**required**, if `Outlet` selected 'outlet in use' will always be 'No')
- `manufacturer`: manufacturer of the device plugged into the outlet (*optional*, defaults to *blank*)
- `model`: model of the device plugged into the outlet (*optional*, defaults to *blank*)
- `serial`: serial number of the device plugged into the outlet (*optional*, defaults to *blank*)
Expand Down
20 changes: 12 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var Service, Characteristic, limiter, cmdBase;
var Service, Characteristic, limiter;
var exec = require("child_process").exec,
RateLimiter = require('limiter').RateLimiter;

Expand Down Expand Up @@ -36,10 +36,6 @@ function RFOutletAccessory(log, config) {
} else {
this.protocol = 1; //Default protocol is 1
}

cmdStart = __dirname + //module directory
"/codesend ";
cmdEnd = " " + this.protocol + " " + this.pulselength;
}

RFOutletAccessory.prototype = {
Expand All @@ -48,10 +44,10 @@ RFOutletAccessory.prototype = {
var cmd;

if (powerOn) {
cmd = cmdStart + this.rf_on + cmdEnd;
cmd = __dirname + "/codesend " + this.rf_on + " " + this.protocol + " " + this.pulselength;
state = "on";
} else {
cmd = cmdStart + this.rf_off + cmdEnd;
cmd = __dirname + "/codesend " + this.rf_off + " " + this.protocol + " " + this.pulselength;
state = "off";
}

Expand Down Expand Up @@ -92,6 +88,14 @@ RFOutletAccessory.prototype = {
case "Fan":
this.outletService = new Service.Fan(this.name);
break;
case "Outlet":
this.outletService = new Service.Outlet(this.name);
break;
/* case "Speaker":
this.outletService = new Service.Speaker(this.name);
break;
//still no support for Speakers in iOS 11.2.1 (Jan18), may be shipped with HomePods
*/
default:
this.outletService = new Service.Switch(this.name);
}
Expand All @@ -102,4 +106,4 @@ RFOutletAccessory.prototype = {

return [informationService, this.outletService];
}
};
};
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "homebridge-rfoutlets-protocol",
"version": "0.1.0",
"version": "0.1.1",
"description": "RF (433MHz) outlet remote control plugin for homebridge which uses different protocols: https://github.com/thomas22122212/homebridge-rfoutlets-protocol",
"license": "(MIT OR ISC)",
"keywords": [
"homebridge-plugin", "433", "433MHz", "Raspberry", "Pi", "rf", "rc-switch", "brennenstuhl", "silvercrest"
"homebridge-plugin", "433", "433MHz", "Raspberry", "Pi", "rf", "rc-switch", "brennenstuhl", "silvercrest","outlets"
],
"engines": {
"node": ">=0.12.0",
Expand Down

0 comments on commit 3093ecc

Please sign in to comment.