Coder Social home page Coder Social logo

declan-fitzpatrick / eskomsepushnotifier Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 107 KB

Application to notify a webhook/mqtt broker about upcoming Eskom Loadshedding events

Dockerfile 0.40% TypeScript 99.60%
loadshedding eskomsepush southafrica

eskomsepushnotifier's Introduction

EskomSePush Notifier

A simple application that will call to webhooks and publish to mqtt based on Eskom events. Also functions as a local copy of the Eskom Se Push API to not hammer their API.

Use cases?

  • Integrations into Home-Assistant, but also really anything with a server.
  • Business Customers who want a notification engine without having to write EskomSePush integrations

Running the container/program

Environment variables

The container/program expects a .env file with the format below:

AREA_ID='some area id'
TOKEN='your Eskom Se Push API Token'
STATUS_AREA='eskom' 
  • AREA_ID is from the Eskom Se Push Api Areas Nearby (GPS) or Areas Search (Text).
  • TOKEN is from the Eskom Se Push Team, see the FAQ.
  • STATUS_AREA is either eskom or capetown. This may be expanded as more IPP's are brought online.

Webhooks and MQTT

Fill in the config.ts file with your configuration

export const webhooks : { servers: { url: string, headers: {} }[] } = {
    servers: [
        {
            url: "http://localhost:8080/webhook",
            headers: {
                'Content-Type': 'application/json',
                'Token': "super secret"
            }
        }
    ]
}
export const mqttServer: { servers: { url: string, topic: string, username?: string, password?: string }[] } = {
    servers: [
        {
            url: "http://localhost:8080/mqtt",
            topic: "some topic",
            username: "user",
            password: "super secret"
        }
    ]
}

Building the container image

docker build -t eskomsepushnotifier:latest .

Running the container

docker-compose up -d

eskomsepushnotifier's People

Contributors

declan-fitzpatrick avatar thehamsterjam avatar

Watchers

 avatar  avatar

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.