Controls 4 channel relays with a Raspberry Pi using HomeKit.
The hardware is quite simple to construct.
The raspberry pi can then control the state of the relays.
sudo npm install --unsafe-perm -g homebridge
sudo npm install -g --unsafe-perm homebridge-relays
config-sample.json
in this repository for a sample.{
"bridge": {
"name": "RelayServer",
"username": "CC:22:3D:E3:CE:FA",
"port": 51826,
"pin": "031-45-155"
},
"description": "4 Channel Relay",
"accessories": [
{
"accessory": "Relay",
"name": "Living Room",
"pin": 11,
"invert": true,
"intial_state": 0,
"timeout_ms": 5000
},
{
"accessory": "Relay",
"name": "Bedroom",
"pin": 13,
"invert": true,
"initial_state": 0,
"timeout_ms": 10000
},
{
"accessory": "Relay",
"name": "Kitchen",
"pin": 15
},
{
"accessory": "Relay",
"name": "Garage Door",
"pin": 29
}
],
"platforms": []
}
Name | Optional | Description |
---|---|---|
accessory |
No | Accessory type |
name |
No | Default name of an accessory |
pin |
No | Raspberry Pi pin number |
invert |
Yes | If true , output on pin is LOW for ON , HIGH for OFF (default: false ) |
initial_state |
Yes | Initial pin state. 1 for ON , 0 for OFF (default: 0 ) |
timeout_ms |
Yes | Relay will stay ON for a given period of time then OFF (default: 0 ) |