{"id":21994762,"url":"https://github.com/allow2/allow2nodered","last_synced_at":"2026-03-19T21:29:56.045Z","repository":{"id":33174507,"uuid":"153864874","full_name":"Allow2/allow2nodered","owner":"Allow2","description":"Node-red nodes for Allow2 OpenSource Parental Freedom","archived":false,"fork":false,"pushed_at":"2022-12-08T03:16:51.000Z","size":539,"stargazers_count":1,"open_issues_count":5,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-09-25T09:29:59.800Z","etag":null,"topics":["children","control","controls","family","freedom","gaming","limit","limits","node-red","parent","parental","parental-control","quota","social","social-network","time","time-limit"],"latest_commit_sha":null,"homepage":"https://Allow2.github.io","language":"HTML","has_issues":true,"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/Allow2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-20T03:10:54.000Z","updated_at":"2019-08-10T23:36:32.000Z","dependencies_parsed_at":"2023-01-14T23:47:07.455Z","dependency_job_id":null,"html_url":"https://github.com/Allow2/allow2nodered","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Allow2%2Fallow2nodered","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Allow2%2Fallow2nodered/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Allow2%2Fallow2nodered/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Allow2%2Fallow2nodered/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Allow2","download_url":"https://codeload.github.com/Allow2/allow2nodered/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245052660,"owners_count":20553172,"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":["children","control","controls","family","freedom","gaming","limit","limits","node-red","parent","parental","parental-control","quota","social","social-network","time","time-limit"],"created_at":"2024-11-29T21:10:23.139Z","updated_at":"2026-01-05T21:02:51.375Z","avatar_url":"https://github.com/Allow2.png","language":"HTML","readme":"# Allow2 Node-RED\n\nThe Node-RED Allow2 contribution package enables the development of flows in\n[Node-RED](https://nodered.org/) which connect to the\n[Allow2](http://www.allow2.com)\nparental freedom platform for the purposes of controlling device access for children.\n\n\n## Overview\n\nAllow2 Node-RED enables you to put electricity quotas on lights and fans, etc for your children to teach responsibility.\n\nYou can also hook up to a smart switch or powerboard to automatically cut off power to gaming consoles when gaming time runs out.\n\nFor developers, adding Allow2 Parental Freedom to your products is about increasing your addressable demographic (ie, getting MORE users),\nit is NOT about reducing users!\n\nLet's remove the hurdles for parents together and increase global accessibility to the latest and greatest technologies and services.\n\n# Getting Started\n\nThe easiest way to get started is to drop Allow2 check node into a flow with an inject and debug nodes to test how it works:\n\n![Getting Started](https://github.com/Allow2/allow2nodered/raw/master/images/gettingstarted.png \"Getting Started\")\n\nIn order to make use of the Allow2 Platform, you need an account. You can create one here for free:\n\u003ca target=\"Allow2\" href=\"https://app.allow2.com\" alt=\"Create Account\"\u003ehttps://app.allow2.com\u003c/a\u003e.\n\nTo pair (link) node-red to Allow2, open the check node and select \"Add New Allow2Pairing...\"\n\n![Link to Allow2](https://github.com/Allow2/allow2nodered/raw/master/images/createpairing.png \"Create Pairing\")\n\nThen use your Allow2 login to generate a token.\n\n![Generate Token](https://github.com/Allow2/allow2nodered/raw/master/images/generatetoken.png \"Generate Token\")\n\nOnce the token is generated, the node is paired with Allow2.\n\n![Paired](https://github.com/Allow2/allow2nodered/raw/master/images/paired.png \"Paired\")\n\nYou can save the node and then configure your check node.\n\n![Configure Check Node](https://github.com/Allow2/allow2nodered/raw/master/images/configurecheck.png \"Configure Check Node\")\n\n\u003cb\u003eDON'T FORGET TO DEPLOY!\u003c/b\u003e The nodes will not work correctly with new pairings until you deploy the flow.\n\n\n# Usage\n\nTo use the Allow2 platform, you need to send a payload to the \u003cb\u003echeck\u003c/b\u003e node containing at least one activity you want to check.\n\nThe platform will determine the quotas, usage, current restrictions, types of day and much more\n(play with the Allow2 account at \u003ca target=\"Allow2\" href=\"https://app.allow2.com\" alt=\"Allow2\"\u003ehttps://app.allow2.com\u003c/a\u003e to find out what you can do, there's a lot there).\n\nIt then returns a json package containing information about whether or not the current activity is allowed, and lots of additional information about the\nvarious limitations and allowances, day types and such that led to that final result.\n\nFor example, a minimal msg.payload could be:\n\n```json\n{\n    \"log\": true,\n    \"activities\": [\n        { \"id\": 3, \"log\": true }\n    ]\n}\n```\n\nWhich only checks current ability to use the \"Gaming\" activity (ie, allowed to play games now, and have not used up all gaming time for today).\n\nAllow2NodeRed currently supports the following activities:\n\n| Id | Activity |\n| -- | -------- |\n| 1 | Internet|\n| 2 | Computer |\n| 3 | Gaming |\n| 7 | Electricity |\n| 8 | Screen Time |\n| 9 | Social |\n| 10 | Phone Time |\n\nYou can technically use the \"counter\" activities such as \"Messages\", let us know if you do that and your specific use case. Would be great to hear from you.\n\nOn a successful call, the input msg will be sent to the output and it will be annotated with an additional result field, eg:\n\n```javascript\n{\n    \"log\": true,\n    \"activities\": [\n        { \"id\": 3, \"log\": true }\n    ],\n    result: {\n        \"allowed\":false,    // overall, not allowed, below you can see they\n                            // have run out of gaming time for today\n        \"activities\": {\n            \"3\": {          // activity 3 specific outcomes\n                \"id\": 3,\n                \"name\": \"Gaming\",\n                \"timed\": true,\n                \"units\": \"minutes\",\n                \"banned\": false,\n                \"remaining\": 0,         // child has run out of gaming time\n                \"cached\": false,\n                \"expires\": 1547351040,\n                \"timeBlock\": {\n                    \"allowed\": true,    // if they had not used up all their time,\n                    \"remaining\": 437    // they could still play\n                }\n            }\n        },\n        \"dayTypes\": {\n            \"today\":{\n                \"id\": 23,               // today is a weekend\n                \"name\": \"Weekend\"\n            },\n            \"tomorrow\": {\n                \"id\": 86,               // tomorrow is a school day\n                \"name\": \"School Day\"\n            }\n        },\n\n        // the following will be more useful in node-red later and are standard inclusions\n        // in responses from the Allow2 platform\n\n        \"allDayTypes\": [                // all the day types in your account\n            { \"id\": 23, \"name\": \"Weekend\" },\n            { \"id\": 77, \"name\": \"Weekday\" },\n            { \"id\": 86, \"name\": \"School Day\" },\n            { \"id\": 64, \"name\": \"Sick Day\" },\n            { \"id\": 66, \"name\": \"Holiday\" },\n            { \"id\": 16997, \"name\": \"No Limit\" }\n        ],\n        \"children\":[                    // all the children in your account\n            { \"id\": 8542, \"name\": \"Mary\", \"pin\": \"8825\" },\n            { \"id\": 21413, \"name\": \"Mike\", \"pin\": \"4595\" }\n        ],\n        \"subscription\":{                // are you currently subscribed?\n            \"active\": false,\n            \"type\": 1,\n            \"maxChildren\": 6,\n            \"childCount\": 3,\n            \"deviceCount\": 8,\n            \"serviceCount\": 0,\n            \"financial\": false\n        }\n    }\n}\n```\n\nSo looking for msg.payload.result.allowed == true/false is the simplest way to determine if the child is allowed to perform the\nrequested activities at this time.\n\nThe additional information let's you figure out why that is the overall result and perhaps\nbe a little more detailed in any feedback to the child.\n\n## A More Complex (And Useful) Example\n\nIn this flow, we use the built-in Allow2 timer mechanism.\n\n![XBox Example](https://github.com/Allow2/allow2nodered/raw/master/images/xbox.png \"XBox Example\")\n\nThe idea is that when the home-automation socket is turned on, the first node triggers a payload to start checking if gaming is allowed.\nThe timer payload includes the \"timer\": \"start\" parameter to tell the check node it is to continually check if access is still allowed.\n\nThe \"autostop\" parameter will tell the timer in the Allow2 Check node to turn off the timer and stop checking the first time the response\ncomes back as \"allowed\":false\n\n```json\n{\n    \"log\": true,\n    \"activities\": [\n        {\n            \"id\": 3\n        }\n    ],\n    \"timer\": \"start\",\n    \"autostop\": true\n}\n```\n\nThen on the output from the check node, we just need to check if msg.payload.result.allowed is false. If so, pass the message through to turn off the\npower to the XBox.\n\n# Advanced Usage\n\nAs the msg.payload.result contains information on remaining time allowances, and the time until certain activities are scheduled to\ncease (like bed time), you can use the checks to perhaps send emails or push notifications to children, speak a warning over\nhomepod or alexa, and/or flash a light bulb (or more).\n\nMaybe post to facebook or twitter if your children leave their lights on?\n\nLet us know what novel automations you come up with.\n\nYou are only limited by your imagination.\n\n# More Information and Developer Documentation\n\nSee the [Project Documentation and Rationale](https://allow2.github.io/)\nfor an overview of the Allow2 platform.\n\nSee the [Allow2Node client library](https://github.com/Allow2/Allow2node)\ngithub project for javascript-based API documentation.\n\n## Bugs and Feedback\n\nFor bugs, questions and discussions please use the\n[GitHub Issues](https://github.com/Allow2/Allow2NodeRED/issues).\n\n## LICENSE\n\nMIT License\n\nCopyright (c) 2018 Allow2\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallow2%2Fallow2nodered","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fallow2%2Fallow2nodered","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallow2%2Fallow2nodered/lists"}