{"_id":"@agilatech/lynxari-fan-device","_rev":"1-a8e72be0f5676b1809d32c1c4ebc96c7","name":"@agilatech/lynxari-fan-device","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@agilatech/lynxari-fan-device","version":"1.0.0","description":"Fan and ventiallation control for use in the Agilatech Lynxari system","main":"fan-scout.js","repository":{"type":"git","url":"git+https://github.com/AgilatechSystems/lynxari-fan-device.git"},"keywords":["ventillation","fan","environmental"],"author":{"name":"Agilatech","email":"scott@agilatech.com","url":"http://agilatech.com"},"license":"MIT","dependencies":{"@agilatech/gpio":"*"},"gitHead":"c6aafe1bc2ef7bee6edd8ba39ec19957ac0a2b04","bugs":{"url":"https://github.com/AgilatechSystems/lynxari-fan-device/issues"},"homepage":"https://github.com/AgilatechSystems/lynxari-fan-device#readme","_id":"@agilatech/lynxari-fan-device@1.0.0","_nodeVersion":"10.15.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-Sh9sozFh3bEhFKzIFHr2GbBqtvnNaTrUIV/6VRYDJ+IDKNOYWUoMLpLPsWi7KbGzZ+AlmN4dsR+JvqO5XadENg==","shasum":"de5ffef495ebd6c071dcbaf72edb0c453723a6c4","tarball":"https://registry.npmjs.org/@agilatech/lynxari-fan-device/-/lynxari-fan-device-1.0.0.tgz","fileCount":6,"unpackedSize":16251,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdDPSFCRA9TVsSAnZWagAAqYUP/2Z0SM2OUtCFiUUqlkNX\nOJLkuhxhpYt8gfP9p7KbyfhLzgMSxKCke4FMlw3QfoNFREhpODWpdVnNI56R\n3nv0o+iOwPfrQ71U1JoiwaTGNJQYrKjFELctJLHdee6mxPCzVJlt6qnVYMJV\ns3fuGJnf1QsEAtX861r+w4Qs40EfWhouG1PVKS6S/b4IyAHXZRdFA336yvSV\n2F5hB6dn/cvdgR/fMRlqu68THMuPoyVoR0qfn62FTSICE38DOXpgRimT1Vty\n2qz+iwTb/nH71+viXAxtrkeHsajLHt1bY/Inq9vqRWdsx8lklzd1sCctSGZh\nY47K3r1ciZIq0k0U78Sd0FekhM5ZjCywWF7TyUryuXdRsF1mAI5WCAwXU5l4\n9giirlzcjw3JVOYFjtt0KzeIM8eklOfuS7fpmbMwSUP24XEQxW2vO5i8aAVu\n0YMV0bPG0jyIkfHADWryIkAIauB+WXuMU77M+BTTsPUqbusTxBxXk0tRHEJo\nKeegHUwnN0tlTWYmWErk0FTzfhPaJUoFo4I4hY7o2EGh/gi6THUXSbhPOrY3\nx9RqFHJWJN4rr3Cdf6yvhYonyYtW7Td7cSPinx7fF651DDWaIwl1MsGLN4Ak\n4QxPpZHj3N0kF8w/10fcmPbl5IZ+zXVezzpX+9A5D0VK9eaV/qag7+i1Ieqg\ntdcA\r\n=0Pda\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCbtPDvvTuK5twNd9Yo8A7o9RoHohLmt+u5mW/bjLfbQQIhAP1URYI0MbQMtYjbIq+vy7VlJlKwzDCbl/a7Jo1kJbKT"}]},"maintainers":[{"name":"scotty","email":"scott@agilatech.com"}],"_npmUser":{"name":"scotty","email":"scott@agilatech.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/lynxari-fan-device_1.0.0_1561130116862_0.8651042261296171"},"_hasShrinkwrap":false}},"time":{"created":"2019-06-21T15:15:16.745Z","1.0.0":"2019-06-21T15:15:17.023Z","modified":"2022-04-04T11:57:12.826Z"},"maintainers":[{"name":"scotty","email":"scott@agilatech.com"}],"description":"Fan and ventiallation control for use in the Agilatech Lynxari system","homepage":"https://github.com/AgilatechSystems/lynxari-fan-device#readme","keywords":["ventillation","fan","environmental"],"repository":{"type":"git","url":"git+https://github.com/AgilatechSystems/lynxari-fan-device.git"},"author":{"name":"Agilatech","email":"scott@agilatech.com","url":"http://agilatech.com"},"bugs":{"url":"https://github.com/AgilatechSystems/lynxari-fan-device/issues"},"license":"MIT","readme":"![Lynxari IoT Platform](https://agilatech.com/images/lynxari/lynxari200x60.png) **IoT Platform**\n## Lynxari Ventilation Fan 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\n### Install\n```\n$> npm install @agilatech/lynxari-fan-device\n```\n\n\n### Design\nThis device driver is designed to control a single ventilation fan.  No assumptions are made as to the end use of the output, be it providing fresh air to a gerbil cage or exhausting explosive gasses from an industrial power plant.  Therefore, it is up to the end user application to decide upon latency and frequency issues.\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\": \"FAN\",\n  \"module\": \"@agilatech/lynxari-fan-device\",\n  \"options\": {\n    \"gpio\": 23,\n    \"manual_minutes\": 20,\n    \"limits\": [\n        {\n            \"name\": \"temperature\",\n            \"upper\":25,\n            \"lower\":23\n        },\n        {\n            \"name\": \"co2\",\n            \"upper\": 8000,\n            \"lower\": 5000\n        }\n    ]\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. This fan driver makes use of gpio, manual_minutes, and a limits array.\n\n\"gpio\":<gpio>\nThe GPIO pin or other definition, where the system can connect to the output that is used to switch the fan on and off. MANDATORY\n\n\"manual_minutes\": <minutes>\nDefines the number of minutes the fan will remain on after it is manually switched on.\n\n\"limits\": [<array>]\nAn array of limit objects which define a parameter and its upper and lower limits\n\n{limit object}\nContains three parameters: name, upper, and lower.\n\n\"name\":<param name>\nThe name of the parameter which shall have on/off control of the fan at defined limits. Note that this name MUST be identical to the name of the sensor parameter providing the data.  For example, if a temperature sensor is being used to provide input for when to switch the fan on and off, if the temperature parameter is named 'temp1', then the name given in the limit object must also be 'temp1'.\n\n\"upper\":<numerical upper limit>\nThe numerical upper limit of the parameter, greater than which will cause the fan to turn on.\n\n\"lower\":<numerical lower limit>\nThe numerical lower limit of the parameter, less than or equal to will cause the fan to turn off.\n\nNote that upper and lower can be the same number. If the given lower limit is greater than the upper however, it will be corrected to be equal to the upper.\n\n\n#### gpio is a manatory config parameter\nEither in the .use statement or the config.json file, **gpio** must be defined to be the valid gpio pin number of the fan switch output.  Note that this number may not be the same as the physical connector pin number on the board.\n\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 operates a fan controlled at GPIO 23, will stay on for 10 minutes when manually triggered, and defines two parameters, temperature and humidity to control the fan:\n```\n{\n    \"name\":\"FAN\",\n    \"gpio\": 23,\n    \"manual_minutes\": 10,\n    \"limits\": [\n        {\n            \"name\": \"temperature\",\n            \"upper\":25,\n            \"lower\":23\n        },\n        {\n            \"name\": \"humidity\",\n            \"upper\": 60,\n            \"lower\": 50\n        }\n    ]\n}\n```\n\n  \n#### Default values\nIf not specified in the config object, the program uses the following default values:\n* _name_ : FAN\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 one value.\n1. **level** - the current level of the gpio output, either 'high' or 'low', which corresponds to the fan being on or off respectively.\n\n  \n#### Streaming Properties\nFor this fan 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. **level_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 operational 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### Commands\n1. **data-input(param, value)** : This transition allows environmental data to be passed to the fan, where it is evaluated against the upper and lower limits for the param. If the given value exceeds the upper limit, the fan is turned on, and likewise, if the value is less than or equal to the lower limit, turns the fan off. Again, note that the 'param' string MUST be identical to the name of the sensor parameter providing the data.  For example, if a temperature sensor is being used to provide input for when to switch the fan on and off, if the temperature parameter is named 'temp1', then the string given in the param argument must also be 'temp1'.\n\n2. **timed-on** : Turns the fan on for the number of minutes given by the manual_minutes. Defaults to 10 mintues if no configuration value is given. The fan will turn off after the specified minutes, unless some other environmental condition has signaled the fan to turn on.\n\n3. **change-output(level)** : Change the current fan output according to the parameter *level*. The acceptable value for *level* is either __high__ or __low__, which turns the fan on or off respectively.\n\n4. **toggle-output** : Toggles the fan level to its compliment, i.e. high->low or low->high.\n\n\n\n### Compatibility\nThis driver is designed to run within the Lynxari IoT platform.  While Lynxari will run on nearly any operating system, this driver employs UNIX-specific protocols and as such will run on the following operating systems:\n* 32 or 64-bit Linux\n* macOS and OS X\n* SunOS\n* AIX\n\n\n### Copyright\nCopyright © 2019 [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\n","readmeFilename":"README.md"}