node-red-contrib-entitypreviousdata 1.0.4

A custom Node-RED node that gives the previous entity information.

npm install node-red-contrib-entitypreviousdata

node-red-contrib-entitypreviousdata

A custom Node-RED node that retrieves the previous entity data from a PostgreSQL database for a given entity and timestamp.

Install

Run the following command in your Node-RED user directory (typically ~/.node-red):

npm install node-red-contrib-entitypreviousdata

Or install directly from the Node-RED Manage Palette by searching for node-red-contrib-entitypreviousdata.

Usage

The Entity Previous Data node queries a PostgreSQL EntityData table to find the most recent record for a given EntityId that occurred before the provided TimeStamp.

Input (msg.payload)

Field Type Description
EntityId string The entity to look up
TimeStamp string/date The current timestamp; the node finds the record just before this

Outputs

  • Output 1 (Success): msg.payload contains the original payload merged with msg.payload.metadata.previousData and msg.payload.metadata.previousTimestamp.
  • Output 2 (Failure): msg.payload with msg.metadata.error set if no record is found or a DB error occurs.

Configuration

Field Description
Host PostgreSQL host (default: localhost)
Port PostgreSQL port (default: 5432)
User Database user (default: postgres)
Password Database password
Database Database name (default: testdb)

Requirements

  • Node.js >= 12
  • Node-RED >= 1.0.0
  • PostgreSQL database with an EntityData table containing EntityId, TimeStamp, and Data columns

License

MIT

Node Info

Version: 1.0.4
Updated 1 day ago
License: MIT
Rating: not yet rated

Categories

Actions

Rate:

Downloads

0 in the last week

Nodes

  • Entity Previous Data

Keywords

  • node-red
  • postgresql
  • entitypreviousdata
  • database