# node-red-contrib-cbus

> A node that sends data to the cloud by using MQTT protocol. These data can be monitored at IoT Scope's web page with the given IoT ID.

Latest version **0.1.3** (published 2024-06-25) · Apache-2.0 license · 0 weekly downloads

## Install

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

## 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.1.3 |
| Published | 2024-06-25 |
| First published | 2021-08-13 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 39 |
| Unpacked size | 31.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | GoktugU |
| Keywords | node-red, CBUS, IoT, MQTT, IoT-Scope, scope, trend, graph, trendline, remote |

## Links

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

## Dependencies (39)

- [bl](https://npm.io/package/bl.md) ^4.1.0
- [ms](https://npm.io/package/ms.md) ^2.1.2
- [ws](https://npm.io/package/ws.md) ^7.5.3
- [glob](https://npm.io/package/glob.md) ^7.1.7
- [mqtt](https://npm.io/package/mqtt.md) ^4.2.8
- [once](https://npm.io/package/once.md) ^1.4.0
- [pump](https://npm.io/package/pump.md) ^3.0.0
- [debug](https://npm.io/package/debug.md) ^4.3.2
- [leven](https://npm.io/package/leven.md) ^2.1.0
- [xtend](https://npm.io/package/xtend.md) ^4.0.2
- [buffer](https://npm.io/package/buffer.md) ^5.7.1
- [split2](https://npm.io/package/split2.md) ^3.2.2
- [wrappy](https://npm.io/package/wrappy.md) ^1.0.2
- [commist](https://npm.io/package/commist.md) ^1.1.0
- [help-me](https://npm.io/package/help-me.md) ^3.0.0
- [ieee754](https://npm.io/package/ieee754.md) ^1.2.1
- [inflight](https://npm.io/package/inflight.md) ^1.0.6
- [inherits](https://npm.io/package/inherits.md) ^2.0.4
- [minimist](https://npm.io/package/minimist.md) ^1.2.5
- [base64-js](https://npm.io/package/base64-js.md) ^1.5.1
- [duplexify](https://npm.io/package/duplexify.md) ^4.1.2
- [minimatch](https://npm.io/package/minimatch.md) ^3.0.4
- [concat-map](https://npm.io/package/concat-map.md) ^0.0.1
- [reinterval](https://npm.io/package/reinterval.md) ^1.1.0
- [typedarray](https://npm.io/package/typedarray.md) ^0.0.6
- [buffer-from](https://npm.io/package/buffer-from.md) ^1.1.2
- [fs.realpath](https://npm.io/package/fs.realpath.md) ^1.0.0
- [mqtt-packet](https://npm.io/package/mqtt-packet.md) ^6.10.0
- [safe-buffer](https://npm.io/package/safe-buffer.md) ^5.2.1
- [stream-shift](https://npm.io/package/stream-shift.md) ^1.0.1
- [concat-stream](https://npm.io/package/concat-stream.md) ^2.0.0
- [end-of-stream](https://npm.io/package/end-of-stream.md) ^1.4.4
- [balanced-match](https://npm.io/package/balanced-match.md) ^1.0.2
- [string_decoder](https://npm.io/package/string_decoder.md) ^1.3.0
- [util-deprecate](https://npm.io/package/util-deprecate.md) ^1.0.2
- [brace-expansion](https://npm.io/package/brace-expansion.md) ^1.1.11
- [readable-stream](https://npm.io/package/readable-stream.md) ^3.6.0
- [path-is-absolute](https://npm.io/package/path-is-absolute.md) ^1.0.1
- [process-nextick-args](https://npm.io/package/process-nextick-args.md) ^2.0.1

## Alternatives

- [apollo-link-http-common](https://npm.io/package/apollo-link-http-common.md) — 879.0K weekly downloads
- [react-relay](https://npm.io/package/react-relay.md) — 336.8K weekly downloads
- [relay-test-utils](https://npm.io/package/relay-test-utils.md) — 181.6K weekly downloads
- [@vendure/core](https://npm.io/package/@vendure/core.md) — 14.8K weekly downloads
- [@pnpm/deps.graph-sequencer](https://npm.io/package/@pnpm/deps.graph-sequencer.md) — 13.4K weekly downloads

## Recent versions

- 0.1.3 (latest) — 2024-06-25
- 0.1.2 — 2021-10-18
- 0.1.1 — 2021-09-23
- 0.1.0 — 2021-09-23
- 0.0.6 — 2021-08-20
- 0.0.5 — 2021-08-18
- 0.0.4 — 2021-08-18
- 0.0.3 — 2021-08-18
- 0.0.2 — 2021-08-16
- 0.0.1 — 2021-08-13

## README

# Node-RED CBUS IoT Scope And IoT SQL

This library includes two nodes. One of them is IoT Scope, and the other one is IoT SQL. They both uses MQTT protocol to send data to the cloud.

1) IoT Scope

Data sent by this node can be monitored at IoT Scope's web page with the given IoT ID. The sampling rate is 1 second, and the chart starts the drawing when the browser is opened. It shows last 1 hour data as it gathers data from the node.

2) IoT SQL

Same concept applies here, but the main difference is that data sent by this node is stored in database, so history of the data can be tracked. The sampling rate is 1 minute.

![image](https://user-images.githubusercontent.com/84990490/130230937-191f7289-6f08-4bb8-b016-9ce323ef112e.png)

# How to install

    cd ~/.node-red
    npm install node-red-contrib-cbus
    
# How to use it

## Requesting IoT Scope ID or IoT Scope ID

As a first step, an IoT ID should be requested. To do that, the following site can be used.

[IoT Scope or IoT SQL ID Request Website](https://iot.cbus.io/license)

Just enter valid e-mail adress and hit enter. 

![image](https://user-images.githubusercontent.com/84990490/134559582-7963c015-52e7-4f61-ab69-8b4761bdca58.png)

## Node settings

After installing node package, enter the IoT ID in node properties.

![image](https://user-images.githubusercontent.com/84990490/129741161-f743939a-652d-4c5c-8f48-6bda28cfdf41.png)

## IoT Scope Web Interface

After preparing node-red project, you can use the following link to observe IoT Scope value.

https://iot.cbus.io/iotscope?ID=0123456789012345

Basically, replace 0123456789012345 with your IoT ID.

![image](https://user-images.githubusercontent.com/84990490/129887528-bc061dce-a1b4-4242-ba41-02fe75d3469c.png)

## Example project for IoT Scope

Node-red flow :

![image](https://user-images.githubusercontent.com/84990490/129888267-82a92976-7b3a-4cd9-8eaf-e325d474f49a.png)

You can import this example as follows.

    [{"id":"934df569c8ec9982","type":"iot-scope-in","z":"be8de71f8b865057","name":"IoT Scope","broker":"nr.cbus.io","brokerport":"1883","iot":"","projectname":"Trial Project","valuename":"Counter","unit":"Tick","x":830,"y":140,"wires":[]},{"id":"456f3ed31ecd2cf2","type":"inject","z":"be8de71f8b865057","name":"","props":[{"p":"payload"}],"repeat":"1","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"Trigger","payloadType":"str","x":380,"y":140,"wires":[["86cde155107cf0e6"]]},{"id":"86cde155107cf0e6","type":"function","z":"be8de71f8b865057","name":"Counter","func":"var counter = context.get('counter') || 0;\ncounter += 1;\nif(counter > 60)\n    counter = 0;\nmsg.payload = counter;\ncontext.set('counter', counter);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":590,"y":140,"wires":[["934df569c8ec9982"]]}]

IoT Scope :

![nr-iotscope](https://user-images.githubusercontent.com/84990490/129889051-4a0e9741-0114-43c1-9e22-5033f3fe4af9.gif)

## IoT SQL Web Interface

Same concept in IoT Scope node applies here. After preparing node-red project, you can use the following link to observe IoT SQL value.

https://iot.cbus.io/sql?ID=0123456789012345

Basically, replace 0123456789012345 with your IoT ID.

IoT SQL :

![image](https://user-images.githubusercontent.com/84990490/134560976-2c58b2cc-aea0-4038-a477-6517a413c831.png)

## Example project for IoT SQL

Node-red flow :

![12](https://user-images.githubusercontent.com/84990490/134561707-d9912f28-3e08-4af2-9fd6-18488d3968f2.png)

You can import this example as follows.

    [{"id":"51b26449adc16038","type":"iot-sql","z":"be8de71f8b865057","name":"IoT Sql","broker":"nr.cbus.io","brokerport":"1883","iot":"","valuename":"Node-Red Counter","x":840,"y":180,"wires":[]},{"id":"8ffa8a36f4ffd078","type":"inject","z":"be8de71f8b865057","name":"","props":[{"p":"payload"}],"repeat":"60","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"Trigger","payloadType":"str","x":400,"y":180,"wires":[["7f7c01660e5cd7c4"]]},{"id":"7f7c01660e5cd7c4","type":"function","z":"be8de71f8b865057","name":"Counter","func":"var counter = context.get('counter') || 0;\ncounter += 1;\nif(counter > 60)\n    counter = 0;\nmsg.payload = counter;\ncontext.set('counter', counter);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":600,"y":180,"wires":[["51b26449adc16038"]]}]

# Contact information

 For any question -> <info@cbus.io>

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