grzegorz914 / homebridge-meraki-control Goto Github PK
View Code? Open in Web Editor NEWHomebridge plugin for Meraki devices using RESTFull API, publish as independent external platform accessory.
License: MIT License
Homebridge plugin for Meraki devices using RESTFull API, publish as independent external platform accessory.
License: MIT License
Error is - [Meraki] No configuration found for homebridge-meraki-control
ReferenceError: fsPromises is not defined
at new merakiDevice (/homebridge/node_modules/homebridge-meraki-control/index.js:103:7)
at HomebridgeAPI. (/homebridge/node_modules/homebridge-meraki-control/index.js:40:11)
at HomebridgeAPI.emit (events.js:327:22)
at HomebridgeAPI.signalFinished (/usr/local/lib/node_modules/homebridge/src/api.ts:275:10)
at Server.start (/usr/local/lib/node_modules/homebridge/src/server.ts:173:14)
For some odd reason a debug message for a client, that I have never added to my homebridge configuration is showing up in the log.
[27/09/2021, 10:38:49] [Meraki] Debug dashboardClientsData: {
id: 'k018d18',
mac: '1a:2b:95:6f:71:40',
description: 'Brad iPhone 13 Pro',
ip: '192.168.128.190',
ip6: null,
ip6Local: 'fe80:0:0:0:1489:5c33:b5a4:a634',
user: null,
firstSeen: '2021-09-25T02:20:25Z',
lastSeen: '2021-09-27T17:38:24Z',
manufacturer: null,
os: 'Apple iPhone',
deviceTypePrediction: null,
recentDeviceSerial: 'REMOVED-XXX-XXXX',
recentDeviceName: 'MyMR33',
recentDeviceMac: 'ac:17:c8:99:99:00',
recentDeviceConnection: 'Wireless',
ssid: 'MYSSID',
vlan: 0,
switchport: null,
usage: [Object],
status: 'Online',
notes: null,
smInstalled: false,
groupPolicy8021x: null,
adaptivePolicyGroup: null
}
[27/09/2021, 10:38:49] [Meraki] Network: Meraki Network, requesting dashboardClientsPolicyData.
This error also appeared near this debug but has stopped showing up now. Maybe related to the other issue about offline clients, not sure. [27/09/2021, 10:05:44] [Meraki] Network: Meraki Network, dashboardClientsData error: TypeError: Cannot read property 'name' of null at merakiDevice.updateDashboardClientsData (/usr/local/lib/node_modules/homebridge-meraki-control/index.js:163:71) at processTicksAndRejections (internal/process/task_queues.js:95:5)
I am getting the following error when setting up this plugin for the first time. I have only configured the required fields(key,network,organizations) to start.
[11/12/2021, 8:48:36 AM] [Meraki] Network: my test, dashboardClientsData error: Error: Request failed with status code 400
at createError (/usr/lib/node_modules/homebridge-meraki-control/node_modules/axios/lib/core/createError.js:16:15)
at settle (/usr/lib/node_modules/homebridge-meraki-control/node_modules/axios/lib/core/settle.js:17:12)
at IncomingMessage.handleStreamEnd (/usr/lib/node_modules/homebridge-meraki-control/node_modules/axios/lib/adapters/http.js:293:11)
at IncomingMessage.emit (events.js:412:35)
at endReadableNT (internal/streams/readable.js:1334:12)
at processTicksAndRejections (internal/process/task_queues.js:82:21) {
config: [Object],
request: [ClientRequest],
response: [Object],
isAxiosError: true,
toJSON: [Function: toJSON]
The meraki portion of my config file configured through the homebridge gui:
{
"devices": [
{
"name": "my test",
"apiKey": "xxxxxxde24a3f04ae53fb904b117d4xxxxxxxxxxx",
"organizationId": "391xxx",
"networkId": "L_63050394783xxxxxxx",
"refreshInterval": 10,
"disableLogInfo": false,
"accessPointsControl": true,
"hideUnconfiguredSsids": false,
"switchesControl": false
}
],
"platform": "Meraki"
}
I found some weird behavior with the new filer SSID. It works perfectly with a single network, however when you add more than one, only the last one in the list will be filtered.
Examples:
Three networks exist on my Meraki configuration = 1HOTBR
, b_only
, kids_only
.
This will filter 1HOTBR
and show b_only
and kids_only
in Accessories. WORKING as expected.
"filterSsidByName": [
{
"name": "1HOTBR"
}
],
This will filter b_only
and show 1HOTBR
and kids_only
in Accessories. WORKING as expected.
"filterSsidByName": [
{
"name": "b_only"
}
],
This will filter 1HOTBR
and show b_only
and kids_only
in Accessories. NOT WORKING as expected.
"filterSsidByName": [
{
"name": "b_only"
},
{
"name": "1HOTBR"
}
],
This will filter b_only
and show 1HOTBR
and kids_only
in Accessories. NOT WORKING as expected.
"filterSsidByName": [
{
"name": "1HOTBR"
},
{
"name": "b_only"
}
],
This will filter kids_only
and show 1HOTBR
and b_only
in Accessories. NOT WORKING as expected.
"filterSsidByName": [
{
"name": "1HOTBR"
},
{
"name": "b_only"
},
{
"name": "kids_only"
}
],
By default when adding the WiFi SSIDs and switch interfaces to Homebridge, it also adds to the beginning some extra characters to it, eg.
W. SSID 1 (WiFi) or 1. Interface 1, 2. Interface 2 etc. (for switch interface name)
This is easy to modify when added initially in the Home app, but if Homebridge has a problem or reset of the bridge is needed it looks like it reverts back to displaying the beginning characters.
Is it possible to add some control to enable/disable the extra characters?
Today I use a custom python script to turn my kids devices on or off (to help control screen time). I could use this as a replacement by adding all their devices to a single SSID or use the updateNetworkClientPolicy
as an on off switch. I'd be happy to help contribute this but I don't know Javascript. I could help with my experience using the Meraki API and share the code I wrote in Python if that would help.
Adding a bit more detail here:
The plugin today exposes SSIDs (all clients on or off), what I am proposing as a feature request is Clients exposed as an accessory with a simple on/off switch. The updateNetworkClientPolicy endpoint could be used. It would be important to take a list of Clients (mac-address) as a filter to limit the Clients exposed to homebridge.
Status: dashboard.networks.getNetworkClientPolicy(networkId=network_id, clientId=client["mac"])
Off: dashboard.networks.updateNetworkClientPolicy(networkId=network_id, clientId=client["mac"], devicePolicy="Blocked")
On: dashboard.networks.updateNetworkClientPolicy(networkId=network_id, clientId=client["mac"], devicePolicy="Normal")
If there was a way to add more than simple on/off, then adding support for dashboard.networks.updateNetworkClientPolicy(networkId=network_id, clientId=client["mac"], devicePolicy="Group policy", groupPolicyId="101")
where the groupPolicyId is mapped to a friendly name like "Kids limited access".
Using homebridge-meraki-control v0.10.5
If I add a client that is not in the meraki dashboard, because it has not been on the network recently, the loading of all the other clients stops. All other Accessories show No Response
in Homekit until the offline device is removed.
It should be reproducible by added a fake mac address and receiving a 404 error from the meraki api, like the below.
Changing "mode": false
for the client that is not online seems to avoid the issue.
[27/09/2021, 10:32:05] [Meraki] Network: Meraki Network, dashboardClientsPolicyData error: Error: Request failed with status code 404
at createError (/usr/local/lib/node_modules/homebridge-meraki-control/node_modules/axios/lib/core/createError.js:16:15)
at settle (/usr/local/lib/node_modules/homebridge-meraki-control/node_modules/axios/lib/core/settle.js:17:12)
at IncomingMessage.handleStreamEnd (/usr/local/lib/node_modules/homebridge-meraki-control/node_modules/axios/lib/adapters/http.js:269:11)
at IncomingMessage.emit (events.js:412:35)
at endReadableNT (internal/streams/readable.js:1317:12)
at processTicksAndRejections (internal/process/task_queues.js:82:21) {
config: [Object],
request: [ClientRequest],
response: [Object],
isAxiosError: true,
toJSON: [Function: toJSON]
}
I have a list of clients added and all are powered up and connected, except one. "name": "00:71:47:c7:6c:17"
has been powered off for some time and no longer in the Meraki Dashboard. The plugin is throwing a 404 error because the api throws this for a client that is not found on the network. It would be best to handle this error a bit more gracefully and inform the user the client they added was not found and may be because it is not online or the mac-address/name could be wrong.
Config
"getClientByNameOrMac": [
{
"mode": true,
"name": "74:e1:b6:b0:b2:cc",
"customName": "Luka iPad"
},
{
"mode": true,
"name": "10:40:f3:c5:ee:b6",
"customName": "Luna iPad"
},
{
"mode": true,
"name": "4c:ef:c0:39:59:68",
"customName": "Luka Fire"
},
{
"mode": true,
"name": "00:71:47:c7:6c:17",
"customName": "Luna Fire"
}
]
Logs
[29/08/2021, 20:44:35] [Meraki] Device: Meraki Network, update device state.
[29/08/2021, 20:44:35] [Meraki] Debug dashboardClientsPolicyData: { mac: '74:e1:b6:b0:b2:cc', devicePolicy: 'Blocked' }
[29/08/2021, 20:44:36] [Meraki] Debug dashboardClientsPolicyData: { mac: '10:40:f3:c5:ee:b6', devicePolicy: 'Blocked' }
[29/08/2021, 20:44:36] [Meraki] Debug dashboardClientsPolicyData: { mac: '4c:ef:c0:39:59:68', devicePolicy: 'Normal' }
[29/08/2021, 20:44:37] [Meraki] Device: Meraki Network, dashboardClientsPolicyData error: Error: Request failed with status code 404
at createError (/usr/local/lib/node_modules/homebridge-meraki-control/node_modules/axios/lib/core/createError.js:16:15)
at settle (/usr/local/lib/node_modules/homebridge-meraki-control/node_modules/axios/lib/core/settle.js:17:12)
at IncomingMessage.handleStreamEnd (/usr/local/lib/node_modules/homebridge-meraki-control/node_modules/axios/lib/adapters/http.js:260:11)
at IncomingMessage.emit (events.js:412:35)
at endReadableNT (internal/streams/readable.js:1317:12)
at processTicksAndRejections (internal/process/task_queues.js:82:21) {
config: [Object],
request: [ClientRequest],
response: [Object],
isAxiosError: true,
toJSON: [Function: toJSON]
}
edit: Also, if you have Scene that includes those devices, Homekit reports the Scene has failed because one of the devices failed to update.
I am getting '[Meraki] Device Name Missing' on load
Loading output:
Loaded plugin 'homebridge-meraki-control'
[12/28/2020, 7:50:48 AM] Registering platform 'homebridge-meraki-control.Meraki'
[Meraki] Initializing Meraki platform...
[Meraki] didFinishLaunching
[Meraki] Device Name Missing
Config:
[
{
"platform": "Meraki",
"devices": [
{
"device_name": "Meraki MR52",
"host": "https://foo.meraki.com",
"apiKey": "foo",
"organizationId": "foo",
"networkId": "foo",
"wlanControl": 1,
"refreshInterval": 10,
"manufacturer": "Manufacturer",
"modelName": "Model",
"serialNumber": "Serial Number",
"firmwareRevision": "Firmware Revision"
}
]
}
]
Meraki API Device Json Output
{
"name": "Meraki MR52",
"serial": “foo”,
"mac": “foo”,
"networkId": “foo”,
"model": "MR52",
"address": “foo",
"lat": foo,
"lng": foo,
"notes": “foo”,
"tags": [],
"lanIp": "192.168.x.x”,
"configurationUpdatedAt": "2020-12-28T14:42:38Z",
"firmware": "wireless-27-5-10",
"url": “foo”
}
Would it be possible to change this log to a debug level? It prints out ever 10 seconds and fills up the log quickly providing only static information I entered in the configuration. Or move it to print only on the initial plugin startup.
[27/09/2021, 11:32:46] [Meraki] -------- Meraki Network --------
[27/09/2021, 11:32:46] [Meraki] Manufacturer: Cisco/Meraki
[27/09/2021, 11:32:46] [Meraki] Network: Meraki Network
[27/09/2021, 11:32:46] [Meraki] Network Id: L_59999999999999999
[27/09/2021, 11:32:46] [Meraki] Organization Id: 5555555
[27/09/2021, 11:32:46] [Meraki] ----------------------------------
[27/09/2021, 11:32:56] [Meraki] -------- Meraki Network --------
[27/09/2021, 11:32:56] [Meraki] Manufacturer: Cisco/Meraki
[27/09/2021, 11:32:56] [Meraki] Network: Meraki Network
[27/09/2021, 11:32:56] [Meraki] Network Id: L_59999999999999999
[27/09/2021, 11:32:56] [Meraki] Organization Id: 5555555
[27/09/2021, 11:32:56] [Meraki] ----------------------------------
[27/09/2021, 11:33:04] [Meraki] -------- Meraki Network --------
[27/09/2021, 11:33:04] [Meraki] Manufacturer: Cisco/Meraki
[27/09/2021, 11:33:04] [Meraki] Network: Meraki Network
[27/09/2021, 11:33:04] [Meraki] Network Id: L_59999999999999999
[27/09/2021, 11:33:04] [Meraki] Organization Id: 5555555
[27/09/2021, 11:33:04] [Meraki] ----------------------------------
[27/09/2021, 11:33:04] [Meraki] -------- Meraki Network --------
[27/09/2021, 11:33:04] [Meraki] Manufacturer: Cisco/Meraki
[27/09/2021, 11:33:04] [Meraki] Network: Meraki Network
[27/09/2021, 11:33:04] [Meraki] Network Id: L_59999999999999999
[27/09/2021, 11:33:04] [Meraki] Organization Id: 5555555
[27/09/2021, 11:33:04] [Meraki] ----------------------------------
[27/09/2021, 11:33:04] [Meraki] -------- Meraki Network --------
[27/09/2021, 11:33:04] [Meraki] Manufacturer: Cisco/Meraki
[27/09/2021, 11:33:04] [Meraki] Network: Meraki Network
[27/09/2021, 11:33:04] [Meraki] Network Id: L_59999999999999999
[27/09/2021, 11:33:04] [Meraki] Organization Id: 5555555
[27/09/2021, 11:33:04] [Meraki] ----------------------------------
[27/09/2021, 11:33:07] [Meraki] -------- Meraki Network --------
[27/09/2021, 11:33:07] [Meraki] Manufacturer: Cisco/Meraki
[27/09/2021, 11:33:07] [Meraki] Network: Meraki Network
[27/09/2021, 11:33:07] [Meraki] Network Id: L_59999999999999999
[27/09/2021, 11:33:07] [Meraki] Organization Id: 5555555
[27/09/2021, 11:33:07] [Meraki] ----------------------------------
[27/09/2021, 11:33:17] [Meraki] -------- Meraki Network --------
[27/09/2021, 11:33:17] [Meraki] Manufacturer: Cisco/Meraki
[27/09/2021, 11:33:17] [Meraki] Network: Meraki Network
[27/09/2021, 11:33:17] [Meraki] Network Id: L_59999999999999999
[27/09/2021, 11:33:17] [Meraki] Organization Id: 5555555
[27/09/2021, 11:33:17] [Meraki] ----------------------------------
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.