Git Product home page Git Product logo

nodered-boolgate-extended's Introduction

node-red-contrib-bool-gate-extended Unlicense

Node RED node to include boolean logic gates.
Based on the work of Nicolas FRBEZAR, added some functionality.

  • Hysteresis

Installation

$ npm install Frederic98/NodeRed-BoolGate-Extended

Restart Node-RED and use the node!

Or from the Node-RED's palette, search for "node-red-contrib-bool-gate".

Check example at "Import > Examples > boolean logic"

Boolean condition

If you know how the boolean logic work, you can skip this section.

The boolean logic is a way to determine a condition regarding to the input.

Condition A Condition B AND NAND OR NOR XOR XNOR
false
false
false
true
false
true
false
true
false
true
false
true
true
false
true
false
true
false
false
true
true
false
true
false
true
true
true
true
true
false
false
true

You can do it to for more than 2 condition :

Condition A Condition B Condition C AND NAND OR NOR XOR XNOR
false
false
false
false
true
false
true
false
true
false
false
true
false
true
true
false
true
false
false
true
false
false
true
true
false
true
false
false
true
true
false
true
true
false
false
true
true
false
false
false
true
true
false
true
false
true
false
true
false
true
true
false
false
true
true
true
false
false
true
true
false
false
true
true
true
true
true
false
true
false
false
true

You can follow this link to learn more about the boolean logic.

Usage

Notion of Rules

A rule can be read from top, like :

<TOPIC><PROPERTY><CONDITION><VALUE>

with topic, the topic of incomming message (if needed), property to perform the test, condition the condition you want for the property and value the value you want for the property (if needed).

You can pick property from everywhere :

  • from the incomming message
  • from the flow context
  • from the global context

The following condition are implemented :

  • ==
  • !=
  • <
  • <=
  • >
  • >=
  • is between
  • contains
  • match regex
  • is true
  • is false
  • is null
  • is not null

You can pick value from the following type (depending on your condition) :

  • number
  • string
  • message's property
  • flow's property
  • global's property
  • regex
  • previous value

Configuration

Please take you time to create your gate, by following these steps :

  • Select the type of gate you want for your node (between AND and NAND for the and-gate and OR, NOR, XOR and XNOR for the or-gate)
  • Tick the "True restriction" checkbox if you want to have output only when the gate is at true state.
  • Fill if needed the "Input message topic" input to filter your incomming message
  • Select the property you need to check (Default : msg, assuming you defined the input message topic)
  • Select the condition(Defautl : =)
  • Type the value you want for your property, assuming you picked up the correct type
  • Add a rule by cliking on + add below the list, and repeat the procedure

See the node information for more details

nodered-boolgate-extended's People

Contributors

frederic98 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.