# node-red-contrib-rcswitch2

> Another rcswitch node for node-red

Latest version **0.5.0** (published 2020-05-02) · (MIT OR Apache-2.0) license · 0 weekly downloads

## Install

```sh
npm install node-red-contrib-rcswitch2
pnpm add node-red-contrib-rcswitch2
yarn add node-red-contrib-rcswitch2
bun add node-red-contrib-rcswitch2
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.0 |
| Published | 2020-05-02 |
| First published | 2016-01-23 |
| Weekly downloads | 0 |
| License | (MIT OR Apache-2.0) |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 60.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | nobodyMO,tlindener |
| Maintainers | nobodymo |
| Keywords | node-red, rcswitch |

## Links

- npm: https://www.npmjs.com/package/node-red-contrib-rcswitch2
- Repository: https://github.com/nobodyMO/node-red-contrib-rcswitch2
- Homepage: https://github.com/nobodyMO/node-red-contrib-rcswitch2#readme
- Issues: https://github.com/nobodyMO/node-red-contrib-rcswitch2/issues
- npm.io page: https://npm.io/package/node-red-contrib-rcswitch2

## Dependencies (1)

- [rcswitch4](https://npm.io/package/rcswitch4.md) latest

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 0.5.0 (latest) — 2020-05-02
- 0.4.0 — 2020-04-27
- 0.1.1 — 2016-01-23
- 0.1.0 — 2016-01-23

## README

node-rcswitch2
=============

[![NPM version](https://badge.fury.io/js/node-red-contrib-rcswitch2.svg)](http://badge.fury.io/js/node-red-contrib-rcswitch2)

The node-red node node-rcswitch2 allows to control 315/433Mhz devices via the rcswitch library.
This is an extented version of tlindener/node-red-contrib-rcswitch with support of different switch types, tristate and binary strings.

The implementation based on https://github.com/marvinroger/node-rcswitch. The supported switch types are described there.

Node bindings for the [rcswitch RaspberryPi port (pin)](https://github.com/r10r/rcswitch-pi).

It should be compatible with all versions of Node.js starting from 0.10.x.

## Requirements

* Like the C++ version of rcswitch, [WiringPi must be installed](https://projects.drogon.net/raspberry-pi/wiringpi/download-and-install/) in order to compile the used packages.
* Both the data and the power Pins of the 315/433Mhz emitter must be connected to the RPi. Note the number of the WiringPi data Pin. (see http://wiringpi.com/pins/)
* The node command must be run with root access

## Usage
The attributs `PIN` and `Mode` must be set in the node properties (edit dialog). The other configuration can either be done in the node properties or in the incoming message object.
* `PIN` - (Number) data Pin to use following [the WiringPi schema](http://wiringpi.com/pins/)
* `Mode` - selects the operation mode of the node to support different manufacturers

This node supports the following modes:

* `group code + Device` - For devices without family code. 

The group code is either an binary string with length 5 or a numeric value (1-4) and could be set in field **Group** or **msg.group**. The switch/device could be set in field **Device** or **msg.device** (value [ABCD] (in this case Field Device must be set to "msg.device").  The Switchposition could be set in field **Switch Position** or in **msg.payload**. In this case the value 0 means off and the value 1 means on.</li>
* `Family + Group code + Device` -For devices with family code. 

The Family code must be one of the chars [abcdef] and could be set in field **Family** or **msg.family**. The group code is numeric and must be one of the values [1234] and could be set in field **Group** or **msg.group**. The switch/device could be set in field **Device** or **msg.device** (value [ABCD] (in this case Field Device must be set to "msg.device"). The Switchposition could be set in field **Switch Position** or in **msg.payload**. In this case the value 0 means off and the value 1 means on.</li>
* `Channel + Device (Tristate)` For devices with tristate code like micro-electric AS 73 witch is also sold as REV Telecontrol in Germany (Version with house code with 6 DIP switches). 

The Channel code must be a binary string with 0=off and 1=on and could be set in field **Channel** or **msg.channel** (in this case Field Channel must be empty). The switch/device could be set in field **Device** or **msg.device** (value [ABCD] (in this case Field Device must be set to "msg.device"). The Switchposition could be set in field **Switch Position** or in **msg.payload**. In this case the value 0 means off and the value 1 means on.</li>
* `Tristate String ` Send a tristate string. 

The String could be set in field **systemcode** or **msg.payload**. Only the chars 0,1,F and S without any blanks are alowed.</li>
* `Binary String` Send a binary string. 

The String could be set in field **systemcode** or **msg.payload**. Only the chars 0 and 1 without any blanks are alowed.</li>

An description of the types is on https://github.com/marvinroger/node-rcswitch".

---
_Source: https://npm.io/package/node-red-contrib-rcswitch2 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
