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

homebridge-nodemcu-relay

Control a relay with Apple HomeKit
授权协议 MIT License
开发语言 JavaScript
所属分类 其他开源、 物联网
软件类型 开源软件
地区 不详
投 递 者 司空海荣
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

homebridge-nodemcu-relay

This script interfaces with homebridge to expose a relay to Apple's HomeKit, allowing you to integrate numerous devices into your smart home.

Requirements

  • NodeMCU

  • Relay Module

  • Pin header cables

  • Micro-USB cable

How-to

  1. First, install the ArduinoJson library from the Library manager in the Arduino IDE, then follow this gist which walks you through how to flash a NodeMCU.

  2. Assuming that you already have homebridge set up, the next thing you will have to do is install homebridge-http using the command:

npm install -g homebridge-http
  1. Finally, update your config.json file following the example below, making sure to adapt it accordingly:
"accessories": [
    {
      "accessory": "Http",
      "name": "Lights",
      "on_url": "http://relay.local/setState?type=switch&value=1",
      "off_url": "http://relay.local/setState?type=switch&value=0",
      "http_method": "GET"
    }
]

Wiring

Available Features

As you can see from the config.json example above, the basic format of the HTTP request is the declaration of the mode type followed by the required state:

http://relay.local/setState?type=STRING_VALUE&value=INT_VALUE

Here is a table which shows you the available queries:

Name Query Description Example Uses
Switch /setState?type=switch Will simply turn on/off the relay permanently as per the Home app. Lights, Faucets, Fans
Momentary /setState?type=momentary Will activate the relay for a brief moment, then deactivate after the amount of time specified in the script. Garages, Gates, Buzzers
Modulation /setState?type=modulation Will activate then deactivate the relay constantly for the amount of time specified in the script until turned off. Lights, Misting systems
State /status Will return the currentState in JSON form as 0 or 1 N/A
 相关资料
  • 我试图在节点之间建立加密通信。js和NodeMCU。经过一些努力,我能够使用node加密。js并在NodeMCU上解密。反之亦然。mscdex的答复有效。因此,我修改了节点。为了他人的利益而编写js代码。谢谢 NodeMCU代码: 节点。js工作代码: 现在再次进行NodeMCU侧测试: 什么在起作用? 节点。js加密在NodeMCU上被解密,尽管加密的字符串有点不同。 什么不起作用? NodeM

  • 我正在建设一个真正简单的物联网项目,我被困在nodeMCU TLS问题上。我的Raspberry pi上有MQTT broker,所有证书都正确插入(在同一Raspberry上使用Paho客户端或在远程PC上使用MQTT.fx客户端时一切正常),但当我尝试从ESP8266与nodeMCU连接时,我收到SSL握手错误(是的,我对所有提到的客户端使用相同的证书文件)。我的ESP8266代码如下所示:

  • Homebridge 是一个轻量级 NodeJS 服务器,它模拟 iOS HomeKit API,提供从 HomeKit 到“智能家居”设备制造商提供的各种第三方 API 的基本桥接。通过 Homebridge 的桥接,可以让 Siri 控制完全不支持 HomeKit 的设备。 此外 Homebridge 支持插件。

  • homebridge-vsx homebridge-vsx is a plugin made for homebridge,which allows switching on and off your Pioneer AV receiver. All AV receivers (VSX and SC),which work with the iControl AV5 App are support

  • homebridge-sesame Control and monitor your Sesame smart lock with HomeKit integration. Prerequisites Installation of Homebridge iOS 11 or later Sesame lock with enabled cloud integration Sesame Wifi A

  • homebridge-panasonictv A homebridge plugin for turning on and off your Panasonic Viera TV. The plugin also has experimental support for changing the volume and channel. These characteristics are not r