Git Product home page Git Product logo

semp's Introduction

SEMP2REST

Adapts the SMA SEMP protocol to REST for easier usage.

REST Api

Documentation for the specific functionality of parameters can be found on SMAs Website under SEMP.






Usage

The library can be used in two ways.

1. Docker (preferred)

  1. Install docker.

  2. Clone.

    git clone https://github.com/orlopau/semp.git
    cd semp
    
  3. Run the container

    --net=host is needed because of SSDP device discovery, which uses UDP. This means that port flags will be ignored. To use different ports, specify a build flag AND a environment variable on runtime as shown below.

    The standard ports are 9765 for SEMP and 9766 for the API.

    -t specifies the tag.

    docker build -t semp --build-arg semp=9765 --build-arg api=9766 .
    

    When running the container, the IP Address of the host must be specified.

    If the ports have been changed from the standard configuration, additional env variables have to be added.

    Use the -it flag for testing (interactive mode).

    Every argument except IP is optional.

    docker run -it --net=host \
        -e IP="192.168.188.101" \
        -e SEMP_PORT=9765 \
        -e API_PORT=9766 \
        -e UUID="290B3891-0311-4854-4333-7B10BC802C2D" \
        -e NAME="Semp Gateway" \
        -e MANUFACTURER="Semp2Rest" \
        semp
    

    For deployment remove the -it flag and add --restart=always to restart on boot and error.

2. Module

Download the module from npm.

npm install semp2rest --save

Then use the module as follows:

const Gateway = require('semp2rest');
const gateway = new Gateway("290B3891-0311-4854-4333-7C70BC802C2D", "192.168.188.101", 9089, 9090);
gateway.start();

Typescript works out-of-the-box.

semp's People

Contributors

danieltwagner avatar orlopau avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

semp's Issues

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.