Skip to content

Repository files navigation

Precision drop for Node-RED by DV Group

A Node-RED flow to decrease your data precision according to the values passing through.

Usage

The expected payload format in input and output is:

type Payload = {
  sensorId: string;
  valueName: string;
  date: string;
  value: number;
  precision?: number;
}[];

const myPayload: Payload = [
  {
    date: '2026-06-25T09:13:51.000Z',
    precision: 100,
    sensorId: 'rpi-temp',
    value: 19,
    valueName: 't',
  },
  {
    date: '2026-06-25T09:13:51.000Z',
    precision: 10,
    sensorId: 'rpi-temp',
    value: 500,
    valueName: 't',
  },
];

This package uses ease-precision-drop under the hood so refer to its documentation if your need to better understand the drop functions.

Development

Use docker to spawn your local Node-RED instance:

docker run -it -p 1880:1880 --name mynodered nodered/node-red

Install dependencies:

npm i

Build & Package

Builds the module and creates a .tgz package in the current directory.

npm run build
npm pack

Put it in the docker container:

docker container cp ./dvgroup-precision-drop-node-red-1.0.0.tgz mynodered:/data

And install it:

docker exec -ti mynodered bash
$ cd /data
$ npm i ./dvgroup-precision-drop-node-red-1.0.0.tgz
$ exit

About

A flow to decrease precision according to values for Node-RED

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages