# node-red-contrib-blynk-mg

> Node-red node to write in blynk App components

Latest version **0.0.3** (published 2021-01-04) · MIT license · 0 weekly downloads

## Install

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

## 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.0.3 |
| Published | 2021-01-04 |
| First published | 2021-01-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 131.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Mohamed Geis |
| Maintainers | mohgeis |
| Keywords | node-red |

## Links

- npm: https://www.npmjs.com/package/node-red-contrib-blynk-mg
- Homepage: https://github.com/mohgeis/node-red-contrib-blynk-mg
- npm.io page: https://npm.io/package/node-red-contrib-blynk-mg

## Dependencies (1)

- [blynk-library](https://npm.io/package/blynk-library.md) ^0.5.4

## Recent versions

- 0.0.3 (latest) — 2021-01-04
- 0.0.2 — 2021-01-03
- 0.0.1 — 2021-01-03

## README

# node-red-contrib-blynk-mg
a simple node-red Blynk node with flexible token and pins configuration
 
[![Build Status](https://travis-ci.org/joemccann/dillinger.svg?branch=master)](https://travis-ci.org/joemccann/dillinger)

you can also check the [npmjs package page](https://www.npmjs.com/package/node-red-contrib-blynk-mg).

# Description!

  Thip node-red package allows users to pass Blynk token and pin as part of the message. For instance:

  ```
msg = {
    'token' : ['token1', 'token-2'],
    'payload' : ['value-0' , 'value-1' , 'value-2', 'value-3'],
    'pin' : [0, 1, 2, 3]
    }   
```
  When the above message is recieved, the node will send the payload 4 messages, to the pin list, one for each pin. all messages will be sent to each token in the msg.token list.

  If msg.payload is longer than msg.pin => the node will send the first payload messages until pins list is used.
  
  | list        | v 1                     |  v 2                   |  v 3 | v 4  |
  |-------------|-------------------------|------------------------|------|------|
  | msg.payload | pl_0                    | pl_1                   | pl_2 | pl_3 |
  | msg.pin     | 0                       | 1                      |      |      |
  | result      | send 'pl_0'  to v_pin_0 | send 'pl_1' to v_pin_1 |      |      |

  if msg.pin is longer than payload => the node will send 0 for the pins that has no match in payload list.
  
  | list        | v 1                     | v 2                    | v 3                | v 4                |
  |-------------|-------------------------|------------------------|--------------------|--------------------|
  | msg.payload | pl_0                    | pl_1                   |                    |                    |
  | msg.pin     | 0                       | 1                      | 2                  | 3                  |
  | result      | send 'pl_0'  to v_pin_0 | send 'pl_1' to v_pin_1 | send 0 to  v_pin_2 | send 0 to  v_pin_3 |

  If a token is added to the node config view, this token will be appended to the msg.token list.

  ![config_diag](./config_diagrams.PNG)

# Installation
in the (Node-red)[] installation directory run this command:

```
$ npm i node-red-contrib-blynk-mg
```


# Todos for next releases

 - improve the user experience and how the msg is consumed.

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