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
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.
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
Finally, update your config.json file following the example below, making sure to adapt it accordingly:
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:
请发表评论