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

nitaybz/homebridge-http-multiswitch

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

开源软件名称:

nitaybz/homebridge-http-multiswitch

开源软件地址:

https://github.com/nitaybz/homebridge-http-multiswitch

开源编程语言:

JavaScript 100.0%

开源软件介绍:

homebridge-http-homebridge

Simple HTTP switches for Homebridge - stateful and radio-button/multi-switch switches

*Forked from homebridge-switcheroo


Creating and maintaining Homebridge plugins consume a lot of time and effort, if you would like to share your appreciation, feel free to "Star" or donate.

Click here to review more of my plugins.


Switch Services

Switch (standard on/off)

Meant to be used as a standard on/off switch. Light, projector, fan, etc.

{
        "accessory": "HttpMultiswitch",
        "switch_type": "Switch",
        "name": "My Projector",
        "http_method": "GET",
        "base_url": "http://192.168.0.XXX/command",
        "on_url": "/on",
        "off_url": "/off"
}

Multiswitch (radio buttons)

Meant to be used as a switcher, where only one input is ever on. Automaticaly turns off the other switches when turning on one ofe them.

Multiswitch appends the string, defined under 'multiurls' below, to complete the path of the Url (Must be use in the same order of the devices in "multiswitch". For example, when PC Mode is selected, the url generated will be http://192.168.0.XXX/command?id=42786sdf787.

{
    "accessory": "HttpMultiswitch",
    "switch_type": "Multiswitch",
    "name": "My Multiswitch",
    "http_method": "GET",
    "base_url": "http://192.168.0.XXX/command?id=",
    "multiswitch": [
                "Apple TV Mode",
                "PC Mode",
                "Android Mode",
                "The Music Mode"
            ],
    "multiurls": [
                "43",
                "42786sdf787",
                "l1479461871215",
                "44"
            ]
}

Configuration Params

Parameter Description Required
name name of the accessory
switch_type Switch or Multiswitch
base_url url endpoint for whatever is receiving these requests
http_method GET (default), POST, PUT, DELETE
username username for request
password password for request
send_immediately option for request
referer option for request
on_url (only Switch) endpoint for the on state
off_url (only Switch) endpoint for the off state
on_body (only Switch) body for on state request
off_body (only Switch) body for off state request
multiswitch (only Multiswitch) list of inputs for the Multiswitch - order is respected
multiurls (only Multiswitch) list of endpoint urls for multiswitch-order is respected

Help

  • Make sure specify a port in the if necessary. (i.e. "base_url" : "http://192.168.0.XXX:2000")
  • Verify the correct http_method is begin used. Switcheroo defaults to GET

Installation

Read about an example Raspberry Pi + Homebridge setup guide with this package here.

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



鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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