Giter Site home page Giter Site logo

soma-smart-shades-http-api's Introduction

Introduction

This repo contains the code needed to expose the SOMA Smart Shade device over HTTP. The APIs have been designed to work well with this Homebridge/Homekit plugin.


Items needed to make it work

  • 1x iOS 10+ device running Apple's Home App
  • 1x Roller Blind with continuous loop cord (no junction)
  • 1x SOMA Smart Shade
  • 1x Raspberry Pi 3 Model B

Mount your Smart Shade.

Install and setup your Smart Shade into your desired location as normal using the Smart Shades app, a guide for doing this can be found here: https://youtu.be/9DTAcZiiFYU


Configuration.

Copy the files to the Raspberry Pi.

  • Download this repo and put it under /home/pi/webshades/

Find the Bluetooth MAC address of the Smart Shade.

You need to find the Bluetooth MAC address of the SOMA Smart Shade so your Raspberry Pi can communicate with it.

  • Enable your Bluetooth adaptor on the Raspberry Pi using the command:

    sudo hciconfig hci0 up
    
  • Now scan for your Smart Shade (it will normally be identified with the name RISExxx) using the command:

    sudo hcitool lescan
    
  • Make a note of the Smart Shades MAC address.

Install the Python dependencies

Run sudo pip install web.py

Run the APIs

Run the webshades.py script.

Check if it works

Open http://<YOUR RASPBERRY PI IP ADDRESS>:8080/getbattery/<YOUR SOMA MAC ADDRESS> (E.g. http://192.168.1.2:8080/getbattery/F6:AA:BB:CC:DD:EE)

You should get a response with a number from 1 to 100 (where 100 is a battery fully charged).


Finish

Now that everything is installed and configured, your SOMA smarth shade is available over HTTP.

Install this Homebridge plugin by running:

npm install -g https://github.com/paolotremadio/homebridge-minimal-http-blinds

Configure Homebridge accordingly. Here's an example:

{
    "accessories": [
        {
            "name": "Kitchen Blinds",
            "accessory": "MinimalisticHttpBlinds",
  
            "get_current_position_url": "http://192.168.1.2:8080/getposition/F6:AA:BB:CC:DD:EE",
            "set_target_position_url": "http://192.168.1.2:8080/setposition/F6:AA:BB:CC:DD:EE/%position%",
            "set_target_position_method": "GET",
            "get_current_position_polling_millis": "300000"
        }
    ]
}

Credits

Based on the Python control script from jeremynoel476 and the "official" python integration instructions

soma-smart-shades-http-api's People

Contributors

skyjohn avatar paolotremadio avatar koenekelschot avatar

Watchers

James Cloos avatar Shane Castle 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.