<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          homebridge-nodemcu-relayControl a relay with Apple HomeKit

          聯(lián)合創(chuàng)作 · 2023-09-26 09:56

          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
          瀏覽 22
          點(diǎn)贊
          評論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報
          評論
          圖片
          表情
          推薦
          點(diǎn)贊
          評論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  无码三级视频在线观看 | 青青草大香蕉超碰 | 日本爱爱网站 | 爱草视频网站 | 大奶一区二区三区 |