{"_id":"@agilatech/lynxari-rain-device","_rev":"1-c9c06b69ce47fc19f510c36fb4bea086","name":"@agilatech/lynxari-rain-device","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@agilatech/lynxari-rain-device","version":"1.0.0","description":"Tipping Bucket Rain Gauge device driver for use in the Agilatech Lynxari system","main":"rain-scout.js","repository":{"type":"git","url":"git+https://github.com/Agilatech/lynxari-rain-device.git"},"keywords":["sensor","rain","rainfall","rain gauge","tipping bucket"],"author":{"name":"Agilatech","email":"scott@agilatech.com","url":"http://agilatech.com"},"license":"MIT","dependencies":{"@agilatech/rain":"*"},"gitHead":"6ea78d9624304e0e75725c2480d30fe132f1c5ff","bugs":{"url":"https://github.com/Agilatech/lynxari-rain-device/issues"},"homepage":"https://github.com/Agilatech/lynxari-rain-device#readme","_id":"@agilatech/lynxari-rain-device@1.0.0","_npmVersion":"6.0.0","_nodeVersion":"6.2.2","_npmUser":{"name":"scotty","email":"scott@agilatech.com"},"dist":{"integrity":"sha512-Hpzjkvd+9Rf9cyaswgFKKNQi5AtZpQtJM3BcH8zbLsZWGhf5YhA2J3ch9pq5NHL5JBHDqGvn0x5VUFraTINPoQ==","shasum":"ce1a3876cddf9f503805e2635b0731ac48c62d60","tarball":"https://registry.npmjs.org/@agilatech/lynxari-rain-device/-/lynxari-rain-device-1.0.0.tgz","fileCount":6,"unpackedSize":11977,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbJ9gGCRA9TVsSAnZWagAA/6UP/1q+7ujFV2WRHBJrvI4E\nAQfdwn1rmGZjBudGkg30lvFnyxVefmdJ63a8BJ7eepwjn5430mufjzXg5U+v\niu6GqnW9PbZvHsOXeOkYhA2hCsBqojlPu5pErAcJu2zlkjMndOlMWuA55U5U\npC+kDpjH1MAEbAF2iG6fuhKgELWzJZSPS95jjiB8Bi+BGpcI658CXMHUcKmT\nCGW2a88qFnqTvqj5EnZeFqWxyvChz/JbnI2KCEqPsvAaSToni8AnL+IytMa9\n3grd++q8auvyJsrOnh8JARorIcaOnla0Cwj8ymTxjC08GZcjbs4MlB80CURH\n70AP0L97kaycLHSt4q6pa4RkdlbgHrcq2mnrp+FrYVW4xb1wVwiltz7Mk4oh\nr5PZJTB9vM6aLQgxOxFgZ9EP5fDrBP0VY1tEmlyaKMO0UZP1RQeXH/t6Icle\ngoz3Q5z/AOCqS008srP7CThOZAcpH9WsaLbW73k0CNdvfjwvrUkCcjNnIZv6\nRu2dGEormh0voV9XGiDv08S8opBTPGVa67mLVVnJVoYxehDlWsjR1bVBZ+ff\n6DmUhZsQKb+OtRQtzTpZkO0oUKqtf8wTk6Mr+gdreV7gBvqgq40AUP4z3Via\nkoWUNnHcX/ibfSrMr/N9Wu+feXnyGEeeeC5OKVgEDs7XGTw9gqdwz8dQ/bkt\nlqGz\r\n=obtS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG+fqR+qHJQvfMw6ViObiOtvMM52iBUOcQX+rAAFVnAWAiBtiNsalBsZKJ1yjkn1EDqEyuRuy/dWtb/YxeVhwYNmIg=="}]},"maintainers":[{"name":"scotty","email":"scott@agilatech.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/lynxari-rain-device_1.0.0_1529337861310_0.08759738497375658"},"_hasShrinkwrap":false}},"time":{"created":"2018-06-18T16:04:21.249Z","1.0.0":"2018-06-18T16:04:21.486Z","modified":"2022-04-04T11:57:14.401Z"},"maintainers":[{"name":"scotty","email":"scott@agilatech.com"}],"description":"Tipping Bucket Rain Gauge device driver for use in the Agilatech Lynxari system","homepage":"https://github.com/Agilatech/lynxari-rain-device#readme","keywords":["sensor","rain","rainfall","rain gauge","tipping bucket"],"repository":{"type":"git","url":"git+https://github.com/Agilatech/lynxari-rain-device.git"},"author":{"name":"Agilatech","email":"scott@agilatech.com","url":"http://agilatech.com"},"bugs":{"url":"https://github.com/Agilatech/lynxari-rain-device/issues"},"license":"MIT","readme":"![Lynxari IoT Platform](https://agilatech.com/images/lynxari/lynxari200x60.png) **IoT Platform**\n## Lynxari Tipping Bucket Rain Gauge device driver\n\nThis device driver is specifically designed to be used with the Agilatech® Lynxari IoT Platform.\nPlease see [agilatech.com](https://agilatech.com/software) to download a copy of the system. \n\n### Install\n```\n$> npm install @agilatech/lynxari-rain-device\n```\n\n### Design\n\nThis device driver is designed to keep track of the total amount of rainfall during a 24-hour period beginning at midnight local time.  It is meant to be used with an analog-style tipping bucket guage, in which a tipping bucket momentarily closes a switch which privides the pulse to register a tip event.  In this type of device, a small bucket collects rainfall, and tips and empties when a predetermined volume has been reached.  In this manner, individual tip events can be tallied and used to total rainfall.\n\nThis driver is programmed to reset at midnight local time. A side effect of this reset is that a data event will be initiated.  All data events with an amount value of 0 can therefore be safely ignored.\n\n\n### Usage\nThis device driver is designed to be consumed by the Agilatech® Lynxari IoT system.  As such, it is not really applicable or useful in other environments.\n\nTo use it with Lynxari, insert its object definition as an element in the devices array in the _devlist.json_ file.\n```\n{\n  \"name\": \"RAIN\",\n  \"module\": \"@agilatech/lynxari-rain-device\",\n  \"options\": {\n    \"devicePoll\": 3600000,\n    \"streamPeriod\": 0\n  }\n}\n```\n\n\n#### Device config object\nThe device config object is an element in the devlist.json device configuration file, which is located in the Lynxari root directory.  It is used to tell the Lynxari system to load the device, as well as several operational parameters.\n\n_name_ is simply the name given to the device.  This name can be used in queries and for other identifcation purposes.\n\n_module_ is the name of the npm module. The module is expected to exist in this directory under the _node_modules_ directory.  If the module is not strictly an npm module, it must still be found under the node_modules directory.\n\n_options_ is an object within the device config object which defines all other operational parameters.  In general, any parameters may be defined in this options object, and most modules will have many several.  The three which are a part of every Lynxari device are 'devicePoll', 'streamPeriod', and 'deltaPercent'. The deviceName options also can define the gpio pin number and the amount of rain per bucket tip.\n\n```\n\"devicePoll\":<period>\nPeriod in milliseconds in which device will be polled\n\n\"streamPeriod\":<period>\nPeriod in milliseconds for broadcast of streaming values\n\n\"gpio\":<I/O pin number>\nThe pin interface to which the tip switch is connected\n\n\"tipAmount\":<mm rain>\nThe amount of rain in mm per bucket tip \n```\n\n#### streamPeriod and devicePoll\nThese config have little applicability for an event-based sensor such as this.  Since this sensor simply updates the monitored variable each and every time the rain bucket tips, it makes little sense to stream the value or poll the device for a new value.  Because of this, it is advisable to **set streamPeriod to 0**, which disables streaming, and set the devicePoll to some arbitrarily large value. Regardless of the setting of these config, the value **amount** will be updated whenever a bucket tip event is registered.\n\n#### module config \nEvery module released by Agilatech includes configuration in a file named 'config.json' and we encourage any other publishers to follow the same pattern.  The parameters in this file are considered defaults, since they are overriden by definitions appearing in the options object of the Lynxari devlist.json file.\n\nThe construction of the config.json mirrors that of the options object, which is simply a JSON object with key/value pairs.\nHere is an example of an 'config.json' file which disables streaming, polls the device every hour, sets the GPIO pin number to 60, and the rain increment per bucket tip to 0.254mm:\n```\n{\n    \"streamPeriod\":0, \n    \"devicePoll\":3600000,\n    \"gpio\":60,\n    \"tipAmount\":0.254\n}\n```\n\n  \n#### Default values\nIf not specified in the config object, the program uses the following default values:\n* _streamPeriod_ : 10000 (10,000ms or 10 seconds)\n* _devicePoll_ : 1000 (1,000ms or 1 second)\n\n\n### Properties\nAll drivers contain the following 4 core properties:\n1. **state** : the current state of the device, containing either the value *chron-on* or *chron-off* \nto indicate whether the device is monitoring data isochronally (a predefinied uniform time period of device data query).\n2. **id** : the unique id for this device.  This device id is used to subscribe to this device streams.\n3. **name** : the given name for this device.\n4. **type** : the given type category for this device,  (_sensor_, _actuator_, etc)\n\n\n#### Monitored Properties\nIn the *on* state, the driver software for this device monitors three values.\n1. **amount** - The total amount of rain so far in this 24-hour period\n\n  \n#### Streaming Properties\nFor this device, it is usual to disable streaming.  However, if it is not disabled, while in the *on* state, the driver software continuously streams this value in isochronal fashion with a period defined by *streamPeriod*. Note that a *streamPeriod* of 0 disables streaming.\n1. **amount_stream**\n  \n\n### State\nThis device driver has a binary state: __on__ or __off__. When off, no parameter values are streamed or available, and no commands are accepted other than the _turn-on_ transition. When on, the device is operations and accepts all commands.  The initial state is _off_.\n  \n  \n### Transitions\n1. **turn-on** : Sets the device state to *on*. When on, the device is operational and accepts all commands. Values are streamed, and the device is polled periodically to keep monitored values up to date.\n\n2. **turn-off** : Sets the device state to *off*, When off, no parameter values are streamed or available, and no commands are accepted other than the _turn-on_ transition.\n\n\n### Compatibility\nLynxari will operate on any computer from a small single board computer up to large cloud server, using any of the following operating systems:\n* 32 or 64-bit Linux\n* Windows 7 and up\n* macOS and OS X\n* SunOS\n* AIX\n\n\n### Copyright\nCopyright © 2018 [Agilatech®](https://agilatech.com). All Rights Reserved.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md"}