pimote
Version:
Control Energenie Switches from a Raspberry Pi
89 lines (56 loc) • 1.61 kB
Markdown
[]: https://www.npmjs.com/package/node-energenie-pimote
[]: https://github.com/CliffS/pimote/issues
Control Energinie Switches from a Raspberry Pi
This module is based on [node-energenie-pimote] but
it is structured as a class. Also the pins are set up
and dropped each time. The original module has the problem
that it stops working if the cli version is used while a
long-term program is running.
npm install -g pimote
npm install pimote
1. Press and hold the button on the socket until the light begins
to flash quickly
2. Run `pimote pair N` where `N` is the device number 1 to 4.
* To switch on a socket run `pimote on N` where N is 1 to 4.
* To switch off a socket run `pimote off N` where N is 1 to 4.
* To switch on all four sockets, run `pimote on`
* To switch off all four sockets, run `pimote off`
Note that the module is defined as a static class. You should
not try to run `new` on it.
```javascript
const Pimote = require('pimote');
```
Switch number 1 on
```javascript
Pimote.switchOn(1);
```
Switch number 2 off
```javascript
Pimote.switchOff(2);
```
Switch all devices on
```javascript
Pimote.switchOn()
```
Switch all devices off
```javascript
Pimote.switchOff()
```
Pair device 4
```javascript
Pimote.pair(4);
```
Cliff Stanford
Please open an issue on [Github].