{"id":13588510,"url":"https://github.com/NutPowerGrid/Collector","last_synced_at":"2025-04-08T06:32:10.412Z","repository":{"id":168211736,"uuid":"493688055","full_name":"NutPowerGrid/Collector","owner":"NutPowerGrid","description":"Collect data from your nut server and send notification on power loss","archived":false,"fork":false,"pushed_at":"2024-10-21T20:37:28.000Z","size":274,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"latest","last_synced_at":"2024-11-06T08:40:48.892Z","etag":null,"topics":["bun","discord","gotify","influxdb","ts","ups"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NutPowerGrid.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-18T14:02:06.000Z","updated_at":"2024-10-21T20:37:32.000Z","dependencies_parsed_at":"2024-04-26T10:24:27.869Z","dependency_job_id":"b9703c65-c3f6-45ee-97de-c78340d79c9c","html_url":"https://github.com/NutPowerGrid/Collector","commit_stats":null,"previous_names":["nutpowergrid/collector"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NutPowerGrid%2FCollector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NutPowerGrid%2FCollector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NutPowerGrid%2FCollector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NutPowerGrid%2FCollector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NutPowerGrid","download_url":"https://codeload.github.com/NutPowerGrid/Collector/tar.gz/refs/heads/latest","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247792086,"owners_count":20996877,"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":["bun","discord","gotify","influxdb","ts","ups"],"created_at":"2024-08-01T15:06:45.717Z","updated_at":"2025-04-08T06:32:07.698Z","avatar_url":"https://github.com/NutPowerGrid.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# ⚡ NutPowerGrid/Collector\n#### 📢 Development is still in progress. Expect some bugs.\n\nEasily export data from your ups to\n\n- InfluxDB\n- JSON (file)\n- CSV (file)\n\nEasily send notification on power loss to\n\n- Discord\n- Gotify\n\nEasily access the data from your ups with a\n\n- JSON Api\n\n## 🔧 Requirement\n\n- Docker/Podman\n- Nut server\n\n## 📝 To Do :\n\n- Export to\n  - API (JSON)\n  - SQL DB\n\n## 📦 Installation :\n\n### Docker\n\n```bash\ndocker run -d -it \\\n  --name=nut_collector \\ # name of your container\n  -e NUT_IP=127.0.0.1 \\ # IP of your nut server\n  -e NUT_UPS_NAME=upsName \\ # name of your ups\n  -e DISCORD_URL=https://discord.com/api/webhooks/... \\ # discord webhook url (see all availables options in .env)\n  -v nut_Log:/app/log \\ # volume for logs (optional)\n  --restart unless-stopped \\\n  ghcr.io/nutpowergrid/collector:latest\n```\n\n## 🌄 Screenshot :\n\n#### InfluxDB + Chronograf\n\u003cimg width=\"1385\" alt=\"image\" src=\"https://github.com/NutPowerGrid/Collector/assets/56845767/aee5ba44-55a8-42b4-9b65-4ad4b2bfef59\"\u003e\n\n#### On startup\n```bash\n$ bun run src/index.ts\nwarn: Missing required environment variable: PATH -\u003e JSON\nwarn: Missing required environment variable: PATH -\u003e CSV\ninfo: Power monitor enable\ninfo: Loaded plugins (3):\n • DiscordHook\n • Gotify\n • Influx\n```\n\n## Creating Plugins\nEnhance the functionality by implementing custom plugins.\nFeel free to utilize the provided plugins as a reference to create your own custom plugins.\n\nFollow these steps to create and integrate a plugin:\n\n### 1. Create a New File\nBegin by creating a new file in the plugin folder of your application. Name it appropriately, reflecting the purpose of your plugin.\n\n### 2. Define the Plugin Class\nDefine a class that extends the Plugin class. This class serves as the foundation for your plugin's functionality. Ensure that it includes the necessary methods and properties.\n\n### 3. Implement Required Functions\n#### Constructor\nCreate a constructor function within your class to initialize the plugin. The constructor will receive environment variables as its only parameter. Utilize this function to set up essential configurations and resources needed by your plugin.\n\n#### Send Function\nImplement a send function to handle data transmission from the UPS.\n\n#### Close Function\nDefine a close function to gracefully shut down the plugin when necessary. (Release any resources or connections established by the plugin during its operation.)\n\n### Plugin Properties\n#### _prefix\nThe _prefix property serves as a unique identifier for the plugin within the application. It helps distinguish the plugin's functionality and configuration from others when managing multiple plugins.\n\n#### _model\nThe _model property defines the environment variables required by the plugin to function correctly. These variables will be automatically injected into the constructor.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNutPowerGrid%2FCollector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FNutPowerGrid%2FCollector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNutPowerGrid%2FCollector/lists"}