https://github.com/pierregode/zaptecunifiednotifier
ZaptecUnifiedNotifier Unified alert system for Zaptec data, seamlessly integrating notifications to both Slack and Microsoft Teams."
https://github.com/pierregode/zaptecunifiednotifier
Last synced: 13 days ago
JSON representation
ZaptecUnifiedNotifier Unified alert system for Zaptec data, seamlessly integrating notifications to both Slack and Microsoft Teams."
- Host: GitHub
- URL: https://github.com/pierregode/zaptecunifiednotifier
- Owner: PierreGode
- License: mit
- Created: 2023-12-21T08:19:07.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-05T09:29:32.000Z (over 2 years ago)
- Last Synced: 2025-03-02T14:23:40.277Z (over 1 year ago)
- Language: JavaScript
- Size: 357 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ZaptecSlackNotifier


Send notifications of availible Zaptec chargers that are availible in your Zaptec account to Slack or Teams
Node.js & npm: This is the runtime environment for executing JavaScript code server-side.
[](https://ko-fi.com/J3J2EARPK)
## Clone this repository
```
git clone https://github.com/PierreGode/ZaptecUnifiedNotifier.git
```
```
cd ZaptecUnifiedNotifier
```
## Prerequisites
Before you proceed, ensure you have the following:
```
sudo apt-get install npm
```
```
npm install axios @slack/web-api
```
```
npm install dotenv
```
## Setup
Create a .env file: At the root of your project, create a file named .env
```
touch .env
```
Add your secrets/configuration: Inside this file, you can set your environment variables as key-value pairs:
# Zaptec Credentials
```
ZAPTEC_USERNAME=myUsername
ZAPTEC_PASSWORD=myPassword
```
# Slack Configuration
```
SLACKBOT_NAME=ZaptecBot
SLACKBOT_ICON=https://raw.githubusercontent.com/PierreGode/ZaptecSlackNotifier/main/images/zaptec.png
SLACK_WEBHOOK_URL=myWebhookURL
SLACK_TOKEN=BotUserOAuthToken
SLACK_WEBHOOK_PRIVATE_URL=myPrivateWebhookURL
```
# Microsoft Teams Configuration
```
TEAMS_WEBHOOK_URL=myTeamsWebhookURL
TEAMS_WEBHOOK_PRIVATE_URL=myPrivateTeamsWebhookURL
```
```
# General Settings
COMPANY_NAME=word
EXCLUDE_DEVICES=devicename1,devicename2
```
Note Descriptions
COMPANY_NAME: Removes specified word from status (e.g., 'company' from 'company 01').
SLACK_WEBHOOK_PRIVATE_URL: Posts charge complete notifications privately. Defaults to SLACK_WEBHOOK_URL if not set.
TEAMS_WEBHOOK_PRIVATE_URL: Same as SLACK_WEBHOOK_PRIVATE_URL but for Teams.
SLACKBOT_ICON/SLACKBOT_NAME: Customize Slack message appearance.
EXCLUDE_DEVICES: Exclude specific devices from notifications.
Security Note: Avoid storing sensitive information in plaintext. Use secure methods for production.
## Running the Notifier
Once you've set up the configurations, run the notifier using:
```
node node.js
```
preferably setup an @reboot sleep 60 && /usr/local/bin/node /home/pi/ZaptecSlackNotifier/node.js >> /var/log/slack.log 2>&1 in crontab
/Created by Pierre Gode