Giter VIP home page Giter VIP logo

ispindel-multiservice's Introduction

iSpindel Multiservice

Send your iSpindel data to multiple services like Ubidots, Brewfather, Grainfather, Brewers Friend, Home Assistant, and more.

Usage

Configuration

Configuration is stored in JSON format. A minimal configuration to send iSpindel data to an http service would look something like:

{
  "serverPath": "/mySpindel",
  "services": [
    {
      "type": "http",
      "url": "http://example.com/endpoint"
    }
  ]
}

In this example the server would listen on the path /mySpindel and forward the iSpindel data to http://example.com/endpoint.

See config.example.json for reference.

By default, the server will look for a config.json file in the root of this project to configure the services to send your iSpindel data to. This can be overriden by setting the CONFIG_FILE_PATH to the full file system path of your configuration file.

Primary Configuration Options

  • serverPath (optional) - the path for the server. If ommitted, the server will listen at the root.
  • services (required) - an array of service objects (see config.example.json):
    • type (required) - one of:
      • http - the main service which can be used to send data over HTTP or HTTPS:
      • ubidots - Ubidots
      • homeassistant - Home Assistant
    • url (required) - the URL to send to
    • deviceLabel (optional) - rename the device from what is configured in the iSpindel. Used for services like GrainFather and Brewfather which require a specific string in the name when using SG instead of Plato.
    • headers (optional) - a key-value object of headers and header values to send with the request
    • token (optional) - the API token to send in the request for supported services (currently only used for ubidots and homeassistant)

Using Environment Variables in config.json

Since the configuration may store sensitive information, it is a good idea to use environment variables for this info instead of storing it in config.json. This allows you to version control your config without worrying about leaking keys or secrets.

To allow this, we use envsub for environment variable substitution using the ${MYVAR} format. For example, if you were using ubidots as a serivce, and set your Ubidots token in the UBIDOTS_TOKEN environment variable, your config.json would look something like:

{
  "serverPath": "/mySpindel",
  "services": [
    {
      "type": "ubidots",
      "deviceLabel": "iSpindel",
      "token": "${UBIDOTS_TOKEN}"
    }
  ]
}

Running the Server

Deploy to your favorite node.js hosting service (see guide for deploying to Render).

yarn
yarn start

The server will listen on the port specified with the PORT environment variable or 8080 if not set.

Running the Server for Development

git clone https://github.com/chrisscott/iSpindel-multiservice
cd iSpindel-multiservice
yarn install
yarn run dev

The server will listen on the port specified with the PORT environment variable or 8080 if not set.

FAQ

What does this do?

Provides a service you can point your iSpindel to which then forwards the data to one or more supported services.

Why would I need it?

  • You have an iSpindel and want to send data to Ubidots, Grainfather, Brewers Friend, a custom HTTP service, Home Assistant or more.
  • You are on an old iSpindel firmware without HTTPS support want to send iSpindel data to a service that only supports HTTPS.

Which services are supported?

Currently, the following:

  • HTTP - any HTTP or HTTPS endpoint
    • Header-based token authentication is supported
  • Ubidots
  • Home Assistant

If there is a service missing you'd like to see, please submit an issue with the details.

ispindel-multiservice's People

Contributors

chrisscott avatar

Stargazers

 avatar  avatar  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.