Giter Club home page Giter Club logo

automation-bridge's Introduction

Simple Automation Bridge

A simple automation bridge between the internet and your connected devices.

Currently the following devices are supported:

  • Sky set-top box (Sky HD and Sky Q)
  • TiVo set-top box (including VM V8 Box)
  • Sony Bravia TV
  • Broadlink RM-PRO (For infrared and RF signals to non connected devices)

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

Make sure you have Node.js >= 8.9.3 installed

Installing

Run the following command from the root directory to install dependency modules:

npm install

Configuration

The following files need to be configured to match your environment

Service Configuration

The service configuration is defined in the config.json file:

{
  "apiKey":"secretkey",
  "port":999
}

apiKey: A secret key that needs to be sent with every payload for authentication purposes.
port: The port number to run the service on.

Devices configuration

The devices configuration is defined in the devices.json file:

{
  "<device-name>": {
    "ip": "<ip-address>",
    "port": <port-number>,
    "mac": "<mac-address>",
    "password": "<password>",
    "deviceType": <device-type>
  }  
}

device-name: An identifier for the device
ip: The local IP address of the device
port: The port number of the device that exposes its control API
mac: The MAC address of the device (optional)
password: A password or secret key for the device that is required for access (optional)
deviceType: An identifier for the device (optional)

Here are a few examples:

{
  "sky": {
    "ip": "192.168.1.1",
    "port": 49160
  },
  "bravia": {
    "ip": "192.168.1.1",
    "mac": "FC:F1:52:85:10:C8",
    "password":"password"
  },
  "tivo": {
    "ip": "192.168.1.1",
    "port": 31339
  },
  "broadlink": {
    "ip": "192.168.1.1",
    "mac": "FC:F1:52:85:10:C8",
    "deviceType":10119,
    "port":80
  }
}

Running the bridge

Use the following command to run the bridge:

node index.js

Executing a Scene

The payload to execute a scene is as follows:

{
    "scene":"<scene-name>",
    "key":"<api-key>"
}

scene: The name of the scene as specified in scenes.json key: The secret key as specified in config.json

Example using curl

Assuming the bridge is running in localhost and port 999, to execute a scene called tivoOn you would run:

curl -H "Content-Type: application/json" -X POST -d '{"scene":"tivoOn","key":"secretKey"}' http://localhost:999

Executing Actions

To execute a series of actions against a device, the payload needs to be defined as follows:

{
    "target":"<device-name>",
    "actions":["<command-1>","<command-2>","<command-n>"],
    "key":"<api-key>"
}

target: The device identifier to run the actions against (as specified in devices.json) actions: The list of commands to execute gainst the device
key: The secret key as specified in config.json

Example using curl

Assuming the bridge is running in localhost and port 999, to execute a series of actions to turn on the Sky box and go to channel 401 would be as follows:

curl -H "Content-Type: application/json" -X POST -d '{"target":"sky","actions":["sky","4","0","1"],"key":"secretKey"}' http://localhost:999

Author

License

This project is licensed under the Apache License 2.0 - see the LICENSE.md file for details

automation-bridge's People

Contributors

giorgoxxi avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 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.