The purpose of this code is to create a Homebridge plugin to allow a wireless administrator to enable or disable a WLAN through a Light Switch control in Apple’s homekit or through Siri.
This code was originally designed for my personal use at home, to allow me to toggle my guest wireless network on and off as needed. This example could be helpful for those who are:
This NodeJS code will accomplish the following tasks:
Run these commands:
sudo npm install -g homebridge
sudo npm install -g homebridge-c9800
NOTE: If you install homebridge like this:
sudo npm install -g --unsafe-perm homebridge
Then all subsequent plugin installations must be like this:
sudo npm install -g --unsafe-perm homebridge-c9800
Example platform config (needs to be added to the homebridge config.json):
"platforms": [
{
"name": "Platform C9800",
"timeout": 10000,
"refreshInterval": 15,
"debug": false;
"wlcs": [
{
"displayName": "Building 1 WLC",
"ipAddress": "192.168.1.110",
"username": "admin",
"password": "password"
},
{
"displayName": "Building 2 WLC",
"ipAddress": "192.168.1.115",
"username": "admin",
"password": "password"
}
],
"platform": "Cisco 9800"
}
]
Field | Description |
---|---|
platform | (required) Must always be "Cisco 9800". |
name | (required) The internal name you want to use for the platform within Homebridge. |
timeout | (optional) The timeout duration in ms for the web API calls. |
refreshInterval | (optional) The refresh interval in minutes for polling the WiFi status. |
debug | (optional) Enables additional logging. |
displayName | (required) The name you want to show for the WLC in homekit. |
ipAddress | (required) The IP address of the WLC (should be static, not DHCP). |
username | (required) The username used to access the WLC. |
password | (required) The password used to access the WLC. |
To make your WLC work with the plugin:
WLC(config)# restconf
Check out https://github.com/nfarina/homebridge for more information about Homebridge.
Owner
Contributors
Categories
Programming Languages
JavaScriptLicense
Code Exchange Community
Get help, share code, and collaborate with other developers in the Code Exchange community.View Community