Coder Social home page Coder Social logo

pierregode / zaptecunifiednotifier Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 366 KB

ZaptecUnifiedNotifier Unified alert system for Zaptec data, seamlessly integrating notifications to both Slack and Microsoft Teams."

License: MIT License

JavaScript 100.00%

zaptecunifiednotifier's Introduction

ZaptecSlackNotifier

image

image

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.

ko-fi

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

zaptecunifiednotifier's People

Contributors

pierregode avatar pierregodetobii avatar

Watchers

 avatar

Forkers

jonashogstrom

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.