当前位置: 首页 > 软件库 > 其他开源 > 物联网 >

SOMA-Smart-Shades-HTTP-API

Control SOMA smart shades over HTTP
授权协议 Readme
开发语言 JavaScript
所属分类 其他开源、 物联网
软件类型 开源软件
地区 不详
投 递 者 安建木
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

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 jeremynoel476and the "official" python integration instructions

 相关资料
  • 我们一般通过 SSH 进行授权访问,通过 git:// 进行无授权访问,但是还有一种协议可以同时实现以上两种方式的访问。 设置 Smart HTTP 一般只需要在服务器上启用一个 Git 自带的名为 git-http-backend 的 CGI 脚本。 该 CGI 脚本将会读取由 git fetch 或 git push 命令向 HTTP URL 发送的请求路径和头部信息,来判断该客户端是否支持

  • smart-http 是一款采用 Java 语言编写的 Http 服务器,有别于业界知名的 Web容器:Tomcat、Undertow,smart-http 并不支持 Servlet 规范,但对于 Http 服务器所需的各项能力,它都具备。 smart-http 天生就是异步非阻塞的 I/O 模型,因为其通信内核采用了 smart-socket。所以无论是性能还是稳定性,都是非常出色的。 在 4核

  • 我们一般通过 SSH 进行授权访问,通过 git:// 进行无授权访问,但是还有一种协议可以同时实现以上两种方式的访问。 设置 Smart HTTP 一般只需要在服务器上启用一个 Git 自带的名为 git-http-backend 的 CGI 脚本。 该 CGI 脚本将会读取由 git fetch 或 git push 命令向 HTTP URL 发送的请求路径和头部信息,来判断该客户端是否支持

  • Smart Select 可以自动帮你把原生的select变成一个由 分组单选按钮 构成的动态页面。在很多iOs native应用中你可以看到这种特性。 Smart Select 布局 Smart Select 布局非常简单,只需要在 列表 中插入 <select>,并且给 item-link 加上 "smart-select" class即可。 <div class="list-block">

  • 无论是评估您的每日健康水平、制定个人训练计划、在合适的强度下训练,还是接收即时反馈,Smart Coaching 均可提供独特、易用的功能来满足您的个人需求,并让您在训练时享受最大乐趣,并发挥出最大的积极性。 手表的 Polar Smart Coaching 具有以下功能: Training Load Pro FuelWise™ 手腕式跑步功率测量 跑步计划 跑步指数 训练效益 智能卡路里 持续心

  • 无论是评估您的每日健康水平、制定个人训练计划、在合适的强度下训练,还是接收即时反馈,Smart Coaching 均可提供独特、易用的功能来满足您的个人需求,并让您在训练时享受最大乐趣,并发挥出最大的积极性。 手表的 Polar Smart Coaching 具有以下功能: Training Load Pro FuelWise™ 手腕式跑步功率测量 跑步计划 跑步指数 训练效益 智能卡路里 持续心