This script interfaces with homebridge to expose an RF devices to Apple's HomeKit, allowing you to integrate numerous devices into your smart home.
-
NodeMCU
-
433MHz RF transmitter module
-
Knowledge the RF codes (see below)
-
Pin Header Cables
-
Micro-USB cable
-
First, install the
rc-switch
andArduinoJson
libraries 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:
"accessories": [
{
"accessory": "Http",
"name": "Outlet",
"on_url": "http://rf.local/setState?code=10176012&pulse=172",
"off_url": "http://rf.local/setState?code=10176009&pulse=172",
"http_method": "GET"
}
]
NodeMCU | RF Module |
---|---|
VIN (5V) |
VCC |
GND |
GND |
D3 |
DATA (ATAD) |
- To retrieve the RF codes, run this script and with the reciever attached instead of the transmitter (follow same wiring as above). Then, simply press the outlet remote near the receiver and note down the codes.