{"_id":"@anl-ioc/node-red-contrib-oadr-ven","_rev":"6-c27758b1c126b7b6a05ed713f22a5070","time":{"1.0.5":"2019-01-29T19:50:33.348Z","created":"2019-01-29T20:35:35.463Z","1.0.6":"2019-01-29T20:35:35.858Z","modified":"2022-04-04T14:13:50.215Z","1.0.7":"2021-02-15T22:14:03.803Z","1.1.0":"2021-05-10T22:16:48.025Z"},"name":"@anl-ioc/node-red-contrib-oadr-ven","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.6":{"name":"@anl-ioc/node-red-contrib-oadr-ven","version":"1.0.6","description":"Open ADR 2.0b VEN","main":"oadr2/oadr2-ven.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","mon":"nodemon -x node-red"},"author":{"name":"Bryan Nystrom","email":"bnystrom@gmail.com","url":"https://github.com/bnystrom"},"license":"BSD-3-Clause","publishConfig":{"access":"public"},"bugs":{"url":"https://github.com/Argonne-National-Laboratory/node-red-contrib-oadr-ven/issues"},"homepage":"https://github.com/Argonne-National-Laboratory/node-red-contrib-oadr-ven#readme","engines":{"node":">=8.5.0"},"keywords":["node-red","OpenADR","VEN","OADR VEN"],"node-red":{"nodes":{"oadr2-ven":"oadr2/oadr2-ven.js"}},"dependencies":{"body-parser":"^1.18.3","data2xml":"^1.3.1","debug":"^4.1.1","express":"^4.16.4","fast-xml-parser":"^3.12.12","request":"^2.88.0","uuid":"^3.3.2","xml-js":"^1.6.9"},"devDependencies":{"eslint":"^5.12.1","eslint-config-strongloop":"^2.1.0","eslint-plugin-node":"^8.0.1"},"gitHead":"3ff9b48e1c0f750144a23aeb3728b1999a462365","_id":"@anl-ioc/node-red-contrib-oadr-ven@1.0.6","_npmVersion":"6.5.0","_nodeVersion":"11.8.0","_npmUser":{"name":"bnystrom","email":"bnystrom@gmail.com"},"dist":{"integrity":"sha512-qSohIA3EgGXKIx4rYsvLHNvK2DgeKXxWvWYa44+Z9B0z+gvOFanrm/6kDqNtOmkCxJ7Q1Pw3qggq3Evi9SNJtA==","shasum":"2b4f52be04e9953ad250e6ffe074c191c751690c","tarball":"https://registry.npmjs.org/@anl-ioc/node-red-contrib-oadr-ven/-/node-red-contrib-oadr-ven-1.0.6.tgz","fileCount":8,"unpackedSize":228739,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcULkYCRA9TVsSAnZWagAARrIP/260oJWk2KAA0bAgiug/\nyiSalqv6DoshwfRhtF1QicfNM/t/9Z8D1JN4uzalXCGdUNdO/zmp5aNMW2Zr\nhGb788yglRVVKAi96ab/vVT6LoRxywIpGaKx2A6HwvrdxPeIL7grN5uSSHKz\nDoBRlPaY/NhRc0OziQwLtWUzS0exT9Ew9mTTy527g+iscKFhpR4DYze1LdVN\n/ODrnyMkB5r+JPeAnPg4x9aSyeQYKV0rk55DjBAl2CxqQQxMtruUol9hFfFj\nzpwd2duuoBCRKNalRYt/MG9BYnD0ioYJ1DSBvdrZe5Nwozip+0gbXPuSHem4\ngDMcO6afoVGyiO5opOo4bT4WdZDhmSfWbtlLmfDNJ+g6xuV95DQVcpYatjnn\n/pCiLtHAtS0yu1F6s1zlwvgTxTn68PEVFecbb1uQwaGMFbyu6VJbjL+/OY1R\n4fCDDJ5z0qipFBQuyL/sUfPuj95Bc7tZ9ubs1YWQApGbH77AiqGGFpV8CX0Z\n07qzkYErRrUxvUaXD31TNcY1cTdw28w0JxSXfOXurQa+3xRshAB8JGJwmtrf\nucK0XAXtGjd6Va10Mfxg8JC38g1ztMRO19HCOu/FW4Fx2Ou9JRrJZ9AaS/4T\n0CkvTKSaNB92FNCf5MT2isRiZq9J5LTC8wx3dFEkz4lOpdziAimuUX1IOvp3\nXjH2\r\n=mK4X\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBRG5YJFNAzjYqQcZShM/+FzO60IKA9wd0LbkrCerCdgAiEAlQc6jRr108U1TcQEW1Yobs28FGHuKWVqZ+evayqtsvY="}]},"maintainers":[{"name":"bnystrom","email":"bnystrom@gmail.com"},{"name":"jayharper","email":"jharper@anl.gov"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/node-red-contrib-oadr-ven_1.0.6_1548794135657_0.928441010536132"},"_hasShrinkwrap":false},"1.0.7":{"name":"@anl-ioc/node-red-contrib-oadr-ven","version":"1.0.7","description":"Open ADR 2.0b VEN","main":"oadr2/oadr2-ven.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","mon":"nodemon -x node-red"},"author":{"name":"Bryan Nystrom","email":"bnystrom@gmail.com","url":"https://github.com/bnystrom"},"license":"BSD-3-Clause","publishConfig":{"access":"public"},"bugs":{"url":"https://github.com/Argonne-National-Laboratory/node-red-contrib-oadr-ven/issues"},"homepage":"https://github.com/Argonne-National-Laboratory/node-red-contrib-oadr-ven#readme","engines":{"node":">=8.5.0"},"keywords":["node-red","OpenADR","VEN","OADR VEN"],"node-red":{"nodes":{"oadr2-ven":"oadr2/oadr2-ven.js"}},"dependencies":{"body-parser":"^1.19.0","data2xml":"^1.3.4","debug":"^4.3.1","express":"^4.17.1","fast-xml-parser":"^3.18.0","request":"^2.88.2","uuid":"^8.3.2","xml-js":"^1.6.11"},"devDependencies":{"eslint":"^7.20.0","eslint-config-strongloop":"^2.1.0","eslint-plugin-node":"^11.1.0"},"gitHead":"5e146e88849eda8f95c8ef4a176b539befb40f42","_id":"@anl-ioc/node-red-contrib-oadr-ven@1.0.7","_nodeVersion":"14.15.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-mO1jUn1hEp9xjt0jFP/RKJO/IIAvX5E9EzlP5g2JxxJXyRKkr9AP9HSKLbK9avw1/y4yYCURJmSJTR+9+CiCgA==","shasum":"a0afcac21643f3573183a8c19e82151a031cf3dc","tarball":"https://registry.npmjs.org/@anl-ioc/node-red-contrib-oadr-ven/-/node-red-contrib-oadr-ven-1.0.7.tgz","fileCount":8,"unpackedSize":228740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgKvIsCRA9TVsSAnZWagAAaZYP/3xW3XvP7YQGfc75iX8x\nzZHbQ90pvJ53qTMJ/sfRDgZZ2o2S6AMFkGHRbyKlr3/LAG+DgqpikoAwrG8i\nyNRsa07lkusoq2XQb3NEPqWnemXcrdJOJNmR1f+VszOrnNwdldGlN7D9Xnyz\nhUFGcDNS49KTGBpNyQSnubEJv/52rXgrJzfg3EAScK2Ria9Wycjz9OkUJ0d7\nsJ9MAg8hHbTZiTTf48ZOhcVWGNBMXABnKZhj0rpszZT3F00PadFSyFceQ0l9\nnT+HRAeD6WqJecVT0w7/Ip5cDTX1haB3ciz0PvoShE+4ZxxxR7NZuq+H9Ns9\nk869NBdAvAZzKVsEqZkIv/XE6YZud4TzOjyIW5aatJ/QKOkEN/Nyheqt87Pf\n/92ebPH1z+sa4Y2nsFNl8DJL6jvoQa6kDYvjM8bOjTFtWEw7i5U+sLkgHIU1\npVBEdWLnceb/ntWB+LC+AJpEBfpURjhmR+VEIr3PO3JLHjglzY4sMOos8O3Z\nbE1NALVa9TqI4+lCHuljSwzgskvO/6tr6HG0tQLLF+bZo9EZ3Mnm3lRrvLCB\nRfDSAsg1Wzzeds2l5YBSf7mDBw7suP45lgnMK48k0eOFhPRjGow5YWzGkffy\nmWeRPOMIZMkrV6qU/rfJDqHyr9g/WId74L4IqQHRIIVcepekGNyFKkYufFym\nfbI3\r\n=MKl0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE62GsFLoNVwSbIsMy9aJZmBAIVX7USDX7nBs2oP/5I+AiAz4LQ42TYZyLf086z1p+bIHoyRvpevkEuNAjihrDZUyA=="}]},"_npmUser":{"name":"bnystrom","email":"bnystrom@gmail.com"},"directories":{},"maintainers":[{"name":"jayharper","email":"jharper@anl.gov"},{"name":"bnystrom","email":"bnystrom@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/node-red-contrib-oadr-ven_1.0.7_1613427243654_0.6318152749706973"},"_hasShrinkwrap":false},"1.1.0":{"name":"@anl-ioc/node-red-contrib-oadr-ven","version":"1.1.0","description":"Open ADR 2.0b VEN","main":"oadr2/oadr2-ven.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","mon":"nodemon -x node-red"},"author":{"name":"Bryan Nystrom","email":"bnystrom@anl.gov","url":"https://github.com/bnystrom"},"license":"BSD-3-Clause","publishConfig":{"access":"public"},"bugs":{"url":"https://github.com/Argonne-National-Laboratory/node-red-contrib-oadr-ven/issues"},"homepage":"https://github.com/Argonne-National-Laboratory/node-red-contrib-oadr-ven#readme","engines":{"node":">=8.5.0"},"keywords":["node-red","OpenADR","VEN","OADR VEN"],"node-red":{"nodes":{"oadr2-ven":"oadr2/oadr2-ven.js"}},"dependencies":{"axios":"^0.21.1","body-parser":"^1.19.0","data2xml":"^1.3.4","debug":"^4.3.1","express":"^4.17.1","fast-xml-parser":"^3.18.0","request":"^2.88.2","uuid":"^8.3.2","xml-js":"^1.6.11"},"devDependencies":{"eslint":"^7.20.0","eslint-config-strongloop":"^2.1.0","eslint-plugin-node":"^11.1.0"},"gitHead":"f104df4d8c833c2079ee5bede14e03381aa3dd81","_id":"@anl-ioc/node-red-contrib-oadr-ven@1.1.0","_nodeVersion":"14.7.0","_npmVersion":"7.12.1","dist":{"integrity":"sha512-dW/JE64G+r7A/tT0bt0S3egIiG3vkIKfh0ZtM2OWEEHubj9D5+0Kan3aPcKTNYP9VNNftCWVHajYoF3Y1aZx0w==","shasum":"b64c8071dd440233f54f32f61ea880f3992d9dd8","tarball":"https://registry.npmjs.org/@anl-ioc/node-red-contrib-oadr-ven/-/node-red-contrib-oadr-ven-1.1.0.tgz","fileCount":8,"unpackedSize":234472,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmbDQCRA9TVsSAnZWagAAjqYP+gIO+Sq2CJoJcqY8+U5H\nLcqeLyOykP/9X3IJngQ5TfHJwvbw+vvilc/W36M7Bm0QFGhU8Mx0/XfdgKDr\nCGGoJC/alHCoqNQmHFo6XNUhmJbA62k1csVYSHr6pKrGr5jgFAp+WhNJc0TS\n4bZ1UhlY1XuGegLdBPZObP8qH7dn0UYMibaoXL54Ucq49tilSY2Nodou35S/\nsQeyqzUJ1zc4Xq2S+SSjmaX1QyEmxj84+1UuD84QGJNI3mbBCPVwQla9qQzf\nnScOFSTDlk/1j4FKFiJkAp+jlSgGhD1ewOfRVb6gaE15Vol5kma5xK2ar5e9\nx507s4jJ/YLqNxRdCKo1bXrUmIwOS3KL47OkyLFYet72EN5UNy+ui1bL3u7J\ngauPLC9KAau9RIKbAlOFHEj9KGBkNx8YUIS1fHjJnw0Di7LwxtYQjhL+/RSa\nH9ZOd/DsfX6MYrZH6Z5STlpoK4ZDO9tvqBZn0RLpO8yhYd4TAzU/jLHYatcP\nLxmhnVvOKrO6NwysfN5m/ID+za3NLd8WkWgAukOpLmGYvL0Y+n70fcbjDQIN\no9RpzWLjBDwz45S+m3ub+HWPW3vtNmmv2ZcQVyXZDjpAQHXeCm4SbFJof8j7\nEN57C3geCOZesFeajeTvOJr1FK/4qXLqipQvWKZlYciBaz8gPvrQvQTUh7p2\nMD5P\r\n=BV//\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICK9mXUPzaKiz1ih9WoNgM2PIw9AjlO3inx+4LPFfTtqAiA++TCVC9Kkresgai9mLO9x4lZ4fAW4oB03pnMP403VQw=="}]},"_npmUser":{"name":"bnystrom","email":"bnystrom@gmail.com"},"directories":{},"maintainers":[{"name":"jayharper","email":"jharper@anl.gov"},{"name":"bnystrom","email":"bnystrom@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/node-red-contrib-oadr-ven_1.1.0_1620685007816_0.42752608619125265"},"_hasShrinkwrap":false}},"maintainers":[{"name":"jayharper","email":"jharper@anl.gov"},{"name":"bnystrom","email":"bnystrom@gmail.com"}],"description":"Open ADR 2.0b VEN","homepage":"https://github.com/Argonne-National-Laboratory/node-red-contrib-oadr-ven#readme","keywords":["node-red","OpenADR","VEN","OADR VEN"],"author":{"name":"Bryan Nystrom","email":"bnystrom@anl.gov","url":"https://github.com/bnystrom"},"bugs":{"url":"https://github.com/Argonne-National-Laboratory/node-red-contrib-oadr-ven/issues"},"license":"BSD-3-Clause","readme":"# node-red-contrib-oadr-ven\r\n\r\n[![NPM](https://nodei.co/npm/@anl-ioc/node-red-contrib-oadr-ven.png)](https://nodei.co/npm/@anl-ioc/node-red-contrib-oadr-ven/)\r\n\r\n## Open ADR VEN for Node-Red\r\n\r\nA [Node-Red][4] node that allows users to easily implement an Open OpenADR ( **Open** **A**utomated **D**emand **R**esponse) VEN (**V**irtual **E**nd **N**ode) by making communication between it and a VTN (**V**irtual **T**op **N**ode) easier. Users only need to deal with json since the node handles converting incoming and outgoing XML messages for them. It also support communication over a secured TCP connection to the VTN.\r\n\r\nFor more information about OpenADR, please visit the [OpenADR Alliance website][3].\r\n\r\n## Implementation\r\n\r\nThe [Node-Red][4] OADR2 VEN implementation only supports the simpleHttp transport protocol. XMPP is not supported at this time. It also only supports standard security and does not at this time support XML Signatures. \r\n\r\nThis implementation attempts to allow users to create OADR 2.0a or 2.0b compatible VEN implementations. Support for earlier OADR releases, or the upcoming 2.0c and future profiles is not supported.\r\n\r\nAll auto/default Ids (unique ids/ request ids) are generated as [V4 UUIDs][6]. Users can override this and provide their own unique ids and pass them to the commands.\r\n\r\nIn cases where a command being returned from the VTN has data that can have one or more items (an array), please keep the following in mind: The node attempts to convert incoming XML data structures into json objects. The logic behind this has no way of knowing when an XML path that supports multiple items but is only returning a single item is an array of one item. Therefore the conversion for a single item behaves as if it is not an array. When multiple items are returned however, the items are put into an array. You should always check if an item is an array or not.\r\n\r\n## Assumptions\r\n\r\nIt is not the intention of this document to explain the workings or specification of OADR and its commands. Please refer to the OpenADR profile specification documents provided by the [OpenADR Alliance][3] for details about call parameter requirements and sequences.\r\n\r\n## Supported Commands\r\n\r\nAll commands are sent to the OADR2 VEN node via *`msg.payload`*. This is done in order to support simply using an inject node for simple commands. Many of the commands support default and optional parameters. \r\n\r\nAll payloads MUST contain a `requestType` parameter. This is set to the actual oadr command listed below. For simplicity, the commands are given without their *'oadr'* prefix. For example, to make a 2.0b specification call `oadrQueryRegistraion`, set `msg.payload.requestType = 'QueryRegistration'`.\r\n\r\nMost of the commands let you define the `requestID` of the command in case you need to track the responses or later requests from the VTN. However, if no `requestID` is submitted with the payload, one will be auto-generated for you. Keep in mind, some commands require you to explicitly return the `requestID` received from another command, for example in the `RegisteredReport` or `CreatedEvent`. Also, some commands have arrays of parameters which may require additional ids.\r\n\r\nFor 2.0b setups, the OADR2 VEN node also attempts to track the `venID` for you upon receiving it from a `CreatePartyRegistration` call. There is also a configuration parameter for the node which allows you to \"hard set\" the venID. This is necessary for 2.0a setups, but if set will override the node's saved venID. Optionally, you can pass in the `venID` as a parameter with the commands.\r\n\r\nOADR2_VEN support the following commands:\r\n* [QueryRegistration](#queryregistration)\r\n* [CreatePartyRegistration](#createpartyregistration)\r\n* [CancelPartyRegistration](#cancelpartyregistration)\r\n* [RequestEvent](#requestevent)\r\n* [CreatedEvent](#createdevent)\r\n* [RegisterReport](#registerreport)\r\n* [RegisteredReport](#registeredreport)\r\n* [Poll](#poll)\r\n* [Response](#response)\r\n* [CreateOpt](#createopt)\r\n* [CancelOpt](#cancelopt)\r\n* [UpdateReport](#updatereport)\r\n\r\n### `QueryRegistration`\r\n* `requestID`\r\n\r\nExample: (Set this up in a function node and pass it to the OADR2 VEN node)\r\n```javascript\r\nmsg.payload = {};\r\nmsg.payload.requestType = 'QueryRegistration';\r\nsend(msg);\r\n```\r\nOptionally, you can pass in your own requestID\r\n```javascript\r\nmsg.payload = {\r\n    requestType: 'QueryRegistration',\r\n    requestID: '1111-22222-3333-QR'\r\n};\r\nsend(msg);\r\n```\r\n---\r\n### `CreatePartyRegistration`\r\n\r\n* `requestID`\r\n* `oadrProfileName` *(currently defaults and only uses '2.0b' since this command is only supported for 2.0b implementations)*\r\n* `oadrReportOnly` *(true/false  defaults to false)*\r\n* `oadrHttpPullModel` *(true/false defaults to true)*\r\n* `oadrTransportAddress` *(requires URL + port, otherwise it is taken from the config settings)*\r\n---\r\nExample: Register with PUSH\r\n```javascript\r\nmsg = {};\r\nmsg.payload = {};\r\n\r\nmsg.payload = { \r\n    requestType: \"CreatePartyRegistration\",\r\n    oadrHttpPullModel: false,\r\n    oadrTransportAddress: 'http://192.168.1.100:8843'\r\n};\r\n\r\nreturn msg;\r\n```\r\n---\r\n\r\n### `CancelPartyRegistration`\r\n* `requestID`\r\n* `registrationID`\r\n* `venID`\r\n\r\n---\r\n### `RequestEvent`\r\n* `requestID`\r\n* `venID`\r\n\r\n---\r\nExample: Request Event for 2.0a\r\n```javascript\r\nmsg = {};\r\nmsg.payload = {};\r\n// Optionally set the venID, otherwise use what is stored in the config\r\nlet venID = '48ac6ed956e1f1f4fdbe';\r\n\r\nmsg.payload = { \r\n    requestType: \"RequestEvent\",\r\n    venID\r\n};\r\n\r\nreturn msg;\r\n```\r\n---\r\n### `CreatedEvent`\r\n\r\nGenerally sent after receiving a `oadrDistributeEvent` from the VTN. \r\n\r\n* `requestID`\r\n* `venID`\r\n* `responseCode`\r\n* `responseDescription`\r\n* `eventResponses`\r\n    * `responseCode`\r\n    * `responseDescription`\r\n    * `requestID`\r\n    * `eventID`\r\n    * `modificationNumber`\r\n    * `optType`\r\n\r\n---\r\n### `RegisterReport`\r\n* `requestID`\r\n* `duration`\r\n* `rID`\r\n* `resourceID`\r\n* `reportType`\r\n* `readingType`\r\n* `marketContext`\r\n* `oadrMinPeriod`\r\n* `oadrMaxPeriod`\r\n* `oadrOnChange`\r\n* `reportRequestID`\r\n* `reportSpecifierID`\r\n* `reportName`\r\n* `createdDateTime`\r\n* `venID`\r\n\r\n---\r\n### `RegisteredReport`\r\n* `requestID`\r\n* `responseCode`\r\n* `responseDescription`\r\n\r\n---\r\n### `Poll`\r\n* `requestID`\r\n* `venID`\r\n\r\nexample:\r\n```javascript\r\n\r\n```\r\n---\r\n### `Response`\r\n* `requestID`\r\n* `responseCode`\r\n* `responseDescription`\r\n---\r\n### `CreateOpt`\r\n* `requestID`\r\n* `optID`\r\n* `optType`\r\n* `optReason`\r\n* `marketContext`\r\n* `resourceID`\r\n* `components`\r\n* `dtstart`\r\n* `dtduration`\r\n\r\n---\r\nSingle OptOut example set to today+15 days:\r\n```javascript\r\nmsg = {};\r\nmsg.payload = {};\r\n\r\nlet d1 = new Date();\r\nd1.setDate(15);\r\n\r\nmsg.payload = { \r\n    requestType: \"CreateOpt\",\r\n    optType: 'optOut',\r\n    optID: '111111111-OUT',\r\n    optReason: 'economic',\r\n    marketContext: 'http://MarketContext1',\r\n    resourceID: 'XYZ',\r\n    dtstart: d1.toISOString(),\r\n    duration: 'PT1H15M'\r\n};\r\n\r\nreturn msg;\r\n```\r\n---\r\nMultiple OptIn example for 3 days:\r\n```javascript\r\nmsg = {};\r\nmsg.payload = {};\r\n\r\nlet d1 = new Date();\r\nlet d2 = new Date();\r\nlet d3 = new Date();\r\nd2.setDate(d1.getDate() + 1);\r\nd3.setDate(d2.getDate() + 1);\r\n\r\nlet components = [];\r\n\r\nlet available = {\r\n        properties: {\r\n            dtstart: {\r\n                'date-time': d1.toISOString()\r\n            },\r\n            duration: {\r\n                duration: 'PT5M'\r\n            }\r\n        }\r\n            \r\n    };\r\n\r\navailable.properties.dtstart['date-time'] = d1.toISOString();\r\navailable.properties.duration.duration = 'PT5M';\r\navailable.properties['ei:x-eiRampUp'] = {\r\n    duration: 'PT2M'\r\n};\r\ncomponents.push(JSON.parse(JSON.stringify(available)));\r\n\r\navailable.properties.dtstart['date-time'] = d2.toISOString();\r\navailable.properties.duration.duration = 'PT10M';\r\navailable.properties['ei:x-eiRampUp'] = {\r\n    duration: 'PT12M'\r\n};\r\ncomponents.push(JSON.parse(JSON.stringify(available)));\r\n\r\navailable.properties.dtstart['date-time'] = d3.toISOString();\r\navailable.properties.duration.duration = 'PT15M';\r\navailable.properties['ei:x-eiRampUp'] = {\r\n    duration: 'PT22M'\r\n};\r\ncomponents.push(JSON.parse(JSON.stringify(available)));\r\n\r\nmsg.payload = { \r\n    requestType: \"CreateOpt\",\r\n    optType: 'optIn',\r\n    optReason: 'economic',\r\n    marketContext: 'http://MarketContext1',\r\n    components: components\r\n};\r\n\r\nreturn msg;\r\n```\r\n\r\n---\r\n### `CancelOpt`\r\n* `requestID`\r\n* `optID`\r\n* `venID`\r\n\r\n---\r\n\r\n### `UpdateReport`\r\n*NOTE: Not yet fully supported*\r\n\r\n---\r\n\r\n## Message output from the OADR2 VEN node\r\n\r\nThere are two types of messages sent out from the VEN node.\r\n\r\n1. Messages from the VTN in response to requests made by the VEN node\r\n1. Requests pushed from the VTN requiring a response from the VEN.\r\n\r\nThe second type of message should only occur in cases where you set up your VEN to support PUSH from the VTN by providing a URL address into the VEN. This can be for either 2.0a or 2.0b setups.\r\n\r\nMessages output from the OADR2 VEN generally contain two structures in the message:\r\n\r\n1. `msg.oadr` (which contains...)\r\n    * `requestID`: *(the request id associated with the output message)*\r\n    * `requestType`: *(the request command type, for example CreatePartyRegistrtaion)* \r\n    * `ResponseType`: *(the returned command type, for example oadrCreatedPartyREgistration)*\r\n    * `pollFreqSeconds`: *(calculated oadrRequestedOadrPollFreq in seconds. Only returned in oadrCreatedPartyRegistration commands)*\r\n1. `msg.payload.data`\r\n    * this structure contains command specific data in json format returned from the VTN. Refer to the OADR 2.0a/b Profile Specifications for parameter details.\r\n\r\n## Provided Examples\r\n\r\nThe package provides a basic example to get you going. In the node-red-contrib-openadr-ven folder is a subfolder named *example-flows*. The example provides a working flow along with a simple UI page on the \"OADR Dash\" tab. This is by no means a fully functional VEN setup but it should help illustrate how to use the node.\r\n\r\n ![example flow](./images/example_flow.png)\r\n\r\n\r\n# Authors\r\n\r\n[Bryan Nystrom][11]\r\n\r\n[Argonne National Laboratory][10]\r\n\r\n[3]:https://www.openadr.org/\r\n[4]:http://nodered.org\r\n[6]:https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)\r\n[10]:https://www.anl.gov\r\n[11]:https://github.com/bnystrom\r\n","readmeFilename":"README.MD"}