• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

AchimPieters/HomeBridge-NeoPixel: HomeBridge plugin to control a NeoPixel strip ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

AchimPieters/HomeBridge-NeoPixel

开源软件地址:

https://github.com/AchimPieters/HomeBridge-NeoPixel

开源编程语言:

JavaScript 80.3%

开源软件介绍:

homebridge-neopixel

Supports NeoPixel http(s) devices on the HomeBridge Platform and provides a readable callback for getting and setting the following characteristics to Homekit:

  • Characteristic.On
  • Characteristic.Brightness
  • Characteristic.Hue
  • Characteristic.Saturation

For more information visit: http://www.studiopieters.nl/apple-homebridge-neopixel-light/

Installation

  1. Install homebridge using: npm install -g homebridge
  2. Install homebridge-http using: npm install -g homebridge-neopixel
  3. Update your configuration file.

Configuration file

Structure

The following is an overview of the structure of your HTTP-NEO accessory.

Both powerOn and powerOff can either be a string or an object. If a string is provided it is filled in as the url and the body will be blank. Most devices will be ok with the string option.

The purpose of powerOff/powerOn for an NeoPixel light is not to physically power or de-power the device (as then how would it respond to further commands?), but to set the LED color to black (for powerOff), and restore the color (for powerOn). Your backend device should already be doing this. This is just a convenience function so that your HomeBridge knows this device can turn off or on.

Additionally, both brightness and color share the same structure (with the exception that the color structure allows for a .brightness variable), they can either be a string or an object. If it is a string, it is filled in as the status and the other fields are left blank. When this is the case, you can only read the settings, you may not change them.

{
    "accessory": "HTTP-NEO",
    "name": string,

    "http_method": string-optional,
    "username": string-optional,
    "password": string-optional,
    "sendImmediately": string-optional,

    "switch": {
        "status": url-optional,
        "powerOn": string-or-object,
        "powerOff": {
            url: string,
            body: string
        }
    },

    "lock": {
        "status": url-optional,
        "secure": string-or-object,
        "unsecure": {
            url: string,
            body: string
        }
    },

    "brightness": string-or-object,
    "color": {
        "status": url-status,
        "url": url-optional,
        "brightness": boolean,
        "http_method": string-optional
    }
}

Interfacing

All the .status urls expect a 200 HTTP status code and a body of a single string with no HTML markup.

  • switch.status expects 0 for Off, and 1 for On.
  • brightness.status expects a number from 0 to 100.
  • color.status expects a 6-digit hexidemial number.

Update: if you use Homebridge version 2, It is possible that you will get a ECONNRESET-bug. But the good nes is we have a possible fix:

The error can be resolved by inserting while (client.read() >= 0);right beforeclient.stop();

As the previous code just cuts the communication (thats where the ECONNRESET comes from) without reading the remaining buffer, homebridge sees unsent packages and a broken channel. This is solvable by simply emptying the buffer and close it afterwards (as there is no other useful information in the communication).

Homebridge-NeoPixel is based on homebridge-better-http-rgb.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PowerShell/Homebrew-Tap发布时间:2022-06-17
下一篇:
fdegier/homebridge-somfy-hotwired: Connect your Somfy remote to Homekit发布时间:2022-06-14
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap