{"id":18985734,"url":"https://github.com/paul-reed/node-red-contrib-boolean-logic-ultimate","last_synced_at":"2026-02-28T01:02:21.737Z","repository":{"id":74197722,"uuid":"237077671","full_name":"Paul-Reed/node-red-contrib-boolean-logic-ultimate","owner":"Paul-Reed","description":"Enhanced boolean logic with persistent values after reboot and more","archived":false,"fork":false,"pushed_at":"2020-01-24T09:46:50.000Z","size":289,"stargazers_count":0,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-01T12:44:50.403Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Paul-Reed.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-29T20:39:21.000Z","updated_at":"2022-01-09T19:58:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"0db27654-0918-49b7-b249-21e72a411c28","html_url":"https://github.com/Paul-Reed/node-red-contrib-boolean-logic-ultimate","commit_stats":{"total_commits":52,"total_committers":1,"mean_commits":52.0,"dds":0.0,"last_synced_commit":"d6ffec989e265793ac0109d7a3e1b999fbbf4cf0"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Paul-Reed%2Fnode-red-contrib-boolean-logic-ultimate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Paul-Reed%2Fnode-red-contrib-boolean-logic-ultimate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Paul-Reed%2Fnode-red-contrib-boolean-logic-ultimate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Paul-Reed%2Fnode-red-contrib-boolean-logic-ultimate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Paul-Reed","download_url":"https://codeload.github.com/Paul-Reed/node-red-contrib-boolean-logic-ultimate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239994005,"owners_count":19730780,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T16:27:57.098Z","updated_at":"2025-11-11T01:04:46.161Z","avatar_url":"https://github.com/Paul-Reed.png","language":null,"funding_links":["https://www.paypal.me/techtoday"],"categories":[],"sub_categories":[],"readme":"# node-red-contrib-boolean-logic-ultimate\n\n![Sample Node](img/logo.png) \n\n[![NPM version][npm-version-image]][npm-url]\n[![NPM downloads per month][npm-downloads-month-image]][npm-url]\n[![NPM downloads total][npm-downloads-total-image]][npm-url]\n[![MIT License][license-image]][license-url]\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n[![Donate via PayPal](https://img.shields.io/badge/Donate-PayPal-blue.svg?style=flat-square)](https://www.paypal.me/techtoday) \n\nA set of Node-RED enhanced boolean logic, with persisten values after reboot and more.\n\n\u003ca href=\"http://eepurl.com/gJm095\" target=\"_blank\"\u003eSubscribe to my channel.\u003c/a\u003e Only news about my nodes, no spam, no ads. I'm a github developer, not a merchant.\n\n\u003e Wellcome! First of all thank you for your interest in my nodes. This is a set of logic nodes, to overcome the simplicity of the default node-red boolean logic nodes.\nHope you enjoy that and if you're in trouble, please ask!\n\n## CHANGELOG\n* See \u003ca href=\"https://github.com/Supergiovane/node-red-contrib-boolean-logic-ultimate/blob/master/CHANGELOG.md\"\u003ehere the changelog\u003c/a\u003e\n\n# BOOLEAN LOGIC\n\n\u003cimg src='https://raw.githubusercontent.com/Supergiovane/node-red-contrib-boolean-logic-ultimate/master/img/bl1.png' width='60%'\u003e\n\n\u003cdetails\u003e\u003csummary\u003eCLICK HERE, copy and paste it into your flow\u003c/summary\u003e\n\u003ccode\u003e\n[{\"id\":\"1a90a718.5c0409\",\"type\":\"BooleanLogicUltimate\",\"z\":\"adb2ee5c.0bf6e\",\"name\":\"\",\"filtertrue\":\"both\",\"persist\":true,\"sInitializeWith\":\"WaitForPayload\",\"triggertopic\":\"trigger\",\"outputtriggeredby\":\"all\",\"inputCount\":2,\"topic\":\"result\",\"x\":380,\"y\":160,\"wires\":[[\"5f9fbfcc.d2c34\"],[],[]]},{\"id\":\"81ef6fec.5d413\",\"type\":\"inject\",\"z\":\"adb2ee5c.0bf6e\",\"name\":\"Night\",\"topic\":\"Dark\",\"payload\":\"true\",\"payloadType\":\"bool\",\"repeat\":\"\",\"crontab\":\"\",\"once\":false,\"onceDelay\":0.1,\"x\":170,\"y\":180,\"wires\":[[\"1a90a718.5c0409\"]]},{\"id\":\"e0d5d620.966478\",\"type\":\"inject\",\"z\":\"adb2ee5c.0bf6e\",\"name\":\"Daylight\",\"topic\":\"Dark\",\"payload\":\"false\",\"payloadType\":\"bool\",\"repeat\":\"\",\"crontab\":\"\",\"once\":false,\"onceDelay\":0.1,\"x\":160,\"y\":140,\"wires\":[[\"1a90a718.5c0409\"]]},{\"id\":\"1c2f8e73.2c22ba\",\"type\":\"inject\",\"z\":\"adb2ee5c.0bf6e\",\"name\":\"Motion detect true\",\"topic\":\"Motion\",\"payload\":\"true\",\"payloadType\":\"bool\",\"repeat\":\"\",\"crontab\":\"\",\"once\":false,\"onceDelay\":0.1,\"x\":130,\"y\":240,\"wires\":[[\"1a90a718.5c0409\"]]},{\"id\":\"5f9fbfcc.d2c34\",\"type\":\"debug\",\"z\":\"adb2ee5c.0bf6e\",\"name\":\"Garden Light\",\"active\":true,\"tosidebar\":true,\"console\":false,\"tostatus\":false,\"complete\":\"true\",\"targetType\":\"full\",\"x\":580,\"y\":160,\"wires\":[]},{\"id\":\"201baa3d.7c63ae\",\"type\":\"inject\",\"z\":\"adb2ee5c.0bf6e\",\"name\":\"Motion detect false\",\"topic\":\"Motion\",\"payload\":\"true\",\"payloadType\":\"bool\",\"repeat\":\"\",\"crontab\":\"\",\"once\":false,\"onceDelay\":0.1,\"x\":130,\"y\":280,\"wires\":[[\"1a90a718.5c0409\"]]},{\"id\":\"b65f4ff4.bfe2c8\",\"type\":\"comment\",\"z\":\"adb2ee5c.0bf6e\",\"name\":\"Motion sensor turns on lights, when it's dark. The light turns off itself at day\",\"info\":\"\",\"x\":290,\"y\":100,\"wires\":[]}]\n\u003c/code\u003e\n\u003c/details\u003e\n\n\u003cimg src='https://raw.githubusercontent.com/Supergiovane/node-red-contrib-boolean-logic-ultimate/master/img/bl2.png' width='60%'\u003e\n\n\u003cdetails\u003e\u003csummary\u003eCLICK HERE, copy and paste it into your flow\u003c/summary\u003e\n\u003ccode\u003e\n[{\"id\":\"53a10a7a.cf1894\",\"type\":\"BooleanLogicUltimate\",\"z\":\"a76c6a12.37379\",\"name\":\"\",\"filtertrue\":\"onlytrue\",\"persist\":true,\"sInitializeWith\":\"true\",\"triggertopic\":\"Pushbutton\",\"outputtriggeredby\":\"onlyonetopic\",\"inputCount\":2,\"topic\":\"result\",\"x\":340,\"y\":220,\"wires\":[[\"cd9244ea.471b78\"],[],[]]},{\"id\":\"9318320b.670af8\",\"type\":\"inject\",\"z\":\"a76c6a12.37379\",\"name\":\"\",\"topic\":\"Pushbutton\",\"payload\":\"true\",\"payloadType\":\"bool\",\"repeat\":\"\",\"crontab\":\"\",\"once\":false,\"onceDelay\":0.1,\"x\":120,\"y\":220,\"wires\":[[\"53a10a7a.cf1894\"]]},{\"id\":\"20a981b9.552b4e\",\"type\":\"inject\",\"z\":\"a76c6a12.37379\",\"name\":\"\",\"topic\":\"IsNight\",\"payload\":\"true\",\"payloadType\":\"bool\",\"repeat\":\"\",\"crontab\":\"\",\"once\":false,\"onceDelay\":0.1,\"x\":110,\"y\":320,\"wires\":[[\"53a10a7a.cf1894\"]]},{\"id\":\"da0dff55.d7888\",\"type\":\"inject\",\"z\":\"a76c6a12.37379\",\"name\":\"\",\"topic\":\"IsNight\",\"payload\":\"false\",\"payloadType\":\"bool\",\"repeat\":\"\",\"crontab\":\"\",\"once\":false,\"onceDelay\":0.1,\"x\":110,\"y\":360,\"wires\":[[\"53a10a7a.cf1894\"]]},{\"id\":\"7129d101.1fb7d8\",\"type\":\"comment\",\"z\":\"a76c6a12.37379\",\"name\":\"Pushbutton to switch on light stairs, only if it's night.\",\"info\":\"\",\"x\":210,\"y\":180,\"wires\":[]},{\"id\":\"cd9244ea.471b78\",\"type\":\"debug\",\"z\":\"a76c6a12.37379\",\"name\":\"Temporized Stairs Lightbulb\",\"active\":true,\"tosidebar\":true,\"console\":false,\"tostatus\":false,\"complete\":\"payload\",\"targetType\":\"msg\",\"x\":580,\"y\":220,\"wires\":[]},{\"id\":\"ad5a62a1.7ad81\",\"type\":\"comment\",\"z\":\"a76c6a12.37379\",\"name\":\"Brightness sensor\",\"info\":\"\",\"x\":110,\"y\":280,\"wires\":[]}]\n\u003c/code\u003e\n\u003c/details\u003e\n\nThe node performs Boolean logic on the incoming payloads.\u003cbr/\u003e\nThe node expects a fixed number of topics (configured in the settings) on which it will operate. It will only output a value \nwhen it has seen the expected number of topics. If it ever sees more than the configured number of topics it will log a message then reset its state and start over.\u003cbr/\u003e\nThe input message is preserved and passed to the output pin, changing only the topic and the payload. \n\nThe node performs 3 checks (\u003cb\u003eAND,OR,XOR\u003c/b\u003e) on the incoming boolean payloads and outputs the result at the same time, as follow:\u003cbr/\u003e\n- Output \"AND\": true or false\u003cbr/\u003e\n- Output \"OR\": true or false\u003cbr/\u003e\n- Output \"XOR\": true or false\u003cbr/\u003e\n\nThe node can have a persistent input: the input values are retained after a node-red reboot. That means, that if you reboot your node-red, you don't need to wait all inputs to arrive and initialize the node, before the node can output a payload.\u003cbr/\u003e\nYou can also set the default values of the topic inputs.\n\n\n## CONFIGURATION\n\n\n**Number of different topics to evaluate**\n\nSet the number of different topics to be evaluated. The node will output a message to the flow, after this number of different topics arrives.\u003cbr/\u003e\n*Remember: each input topic must be different. For example, if you set this field to 3, the node expects 3 different topics.*\n\n\n**Filter output result**\n\n- Output both 'true' and 'false' results: Standard behaviour, the node will output \u003cb\u003etrue\u003c/b\u003e and \u003cb\u003efalse\u003c/b\u003e whenever it receives an input and calculate the boolean logics as output.\n- Output only 'true' results: whenever the node receives an input, it outputs a payload \u003cb\u003etrue\u003c/b\u003e only if the result of the logic is true. \u003cb\u003eFalse\u003c/b\u003e results are filtered out.\n\n**Trigger mode**\n\n- All topics: standard behaviour, the node will evaluate each input topic and ouputs the values. At each input change, it will output a msg on the flow.\n- Single topic + eval other inputs: the node evaluates all the input topics, but only whenever it receives a msg input with the **specified topic**, it  outputs a msg to the flow.\n\n**If input states are undefined**\n\nEvery time you create a node or modify the node, all inputs are set to undefined. This means that the node will wait the arrive of all topics (for example 3 topics, if you've selected 3 topics in the option), before it can output a payload. This can be a problem if your logic must be operative as soon as you deploy the flow. To overcome this problem, you can \"initialize\" all the undefined inputs with True or False.\n- Leave undefined: Standard behaviour, the node will wait all the \"undefined\" topics to arrive, then starts a flow with the result.\n- True or False: The node is immediately operative, by force the initialization of the \"undefined\" inputs with \"true\" or \"false\".\n\n**Remember latest input values after reboot**\n\nIf checked, the input values are retained after a node-red reboot. That means, that if you reboot your node-red, you don't need to wait all inputs to arrive and initialize the node, before the node can output a payload.\u003cbr/\u003e\nEvery time you modify the node's config, \u003cb\u003ethe retained values are cleared\u003c/b\u003e.\u003cbr/\u003e\n\n\n# INTERRUPT FLOWS ULTIMATE\n\nWhenever this node receives a payload = false from a specific topic, it stops output messages to the flow. As soon it receives payload = true from this topic, the output messages start to flow out again.\n\n\u003cimg src='https://raw.githubusercontent.com/Supergiovane/node-red-contrib-boolean-logic-ultimate/master/img/if0.png' width='60%'\u003e\n\n\u003cdetails\u003e\u003csummary\u003eCLICK HERE, copy and paste it into your flow\u003c/summary\u003e\n\u003ccode\u003e\n[{\"id\":\"1fd91f1f.c1fae9\",\"type\":\"InterruptFlowUltimate\",\"z\":\"a76c6a12.37379\",\"name\":\"Interrupt Flow\",\"triggertopic\":\"IsNight\",\"x\":360,\"y\":440,\"wires\":[[\"b9844c7f.0f306\"]]},{\"id\":\"eaa32462.398808\",\"type\":\"comment\",\"z\":\"a76c6a12.37379\",\"name\":\"Pushbutton to switch on stairs light, only if it's night, using flow interruption\",\"info\":\"\",\"x\":300,\"y\":400,\"wires\":[]},{\"id\":\"10787f38.edfe81\",\"type\":\"inject\",\"z\":\"a76c6a12.37379\",\"name\":\"\",\"topic\":\"IsNight\",\"payload\":\"true\",\"payloadType\":\"bool\",\"repeat\":\"\",\"crontab\":\"\",\"once\":false,\"onceDelay\":0.1,\"x\":130,\"y\":540,\"wires\":[[\"1fd91f1f.c1fae9\"]]},{\"id\":\"a6092a15.1c592\",\"type\":\"inject\",\"z\":\"a76c6a12.37379\",\"name\":\"\",\"topic\":\"IsNight\",\"payload\":\"false\",\"payloadType\":\"bool\",\"repeat\":\"\",\"crontab\":\"\",\"once\":false,\"onceDelay\":0.1,\"x\":130,\"y\":580,\"wires\":[[\"1fd91f1f.c1fae9\"]]},{\"id\":\"21ba9c30.02abbc\",\"type\":\"comment\",\"z\":\"a76c6a12.37379\",\"name\":\"Brightness sensor\",\"info\":\"\",\"x\":130,\"y\":500,\"wires\":[]},{\"id\":\"af131ae5.a1bfb8\",\"type\":\"inject\",\"z\":\"a76c6a12.37379\",\"name\":\"\",\"topic\":\"Pushbutton\",\"payload\":\"true\",\"payloadType\":\"bool\",\"repeat\":\"\",\"crontab\":\"\",\"once\":false,\"onceDelay\":0.1,\"x\":120,\"y\":440,\"wires\":[[\"1fd91f1f.c1fae9\"]]},{\"id\":\"b9844c7f.0f306\",\"type\":\"debug\",\"z\":\"a76c6a12.37379\",\"name\":\"Temporized Stairs Lightbulb\",\"active\":true,\"tosidebar\":true,\"console\":false,\"tostatus\":false,\"complete\":\"payload\",\"targetType\":\"msg\",\"x\":600,\"y\":440,\"wires\":[]}]\n\u003c/code\u003e\n\u003c/details\u003e\n\n# INVERT ULTIMATE\n\nOutputs the inverted input. For example true -\u003e false\u003cbr /\u003e\nThe input message is preserved and passed to the output pin, changing only the topic and the payload. If the input message has it's own topic, it'll be preserved as well.\n\n# FILTER ULTIMATE\n\nThis node has 2 outputs.\u003cbr /\u003e\nIf the input payload is true, the node will send \u003ccode\u003etrue\u003c/code\u003e on output 1 and nothing on oputput 2\u003cbr /\u003e\nIf the input payload is false, the node will send nothing on output 1, and \u003ccode\u003efalse\u003c/code\u003e on oputput 2\u003cbr /\u003e\nThe input message is preserved and passed to the output pin, changing only the topic and the payload. If the input message has it's own topic, it'll be preserved as well.\n\n\n[license-image]: https://img.shields.io/badge/license-MIT-blue.svg\n[license-url]: https://github.com/Supergiovane/node-red-contrib-boolean-logic-ultimate/master/LICENSE\n[npm-url]: https://npmjs.org/package/node-red-contrib-boolean-logic-ultimate\n[npm-version-image]: https://img.shields.io/npm/v/node-red-contrib-boolean-logic-ultimate.svg\n[npm-downloads-month-image]: https://img.shields.io/npm/dm/node-red-contrib-boolean-logic-ultimate.svg\n[npm-downloads-total-image]: https://img.shields.io/npm/dt/node-red-contrib-boolean-logic-ultimate.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaul-reed%2Fnode-red-contrib-boolean-logic-ultimate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaul-reed%2Fnode-red-contrib-boolean-logic-ultimate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaul-reed%2Fnode-red-contrib-boolean-logic-ultimate/lists"}