Bug: API Request: TypeError: Cannot read properties of undefined (reading 'deviceList')
See original GitHub issueDescribe The Bug
Device list is empty although configured
To Reproduce
install plugin v2.1.0, configure your devices
Expected behavior
devices should show and be exposed to homekit
Relevant log output
[14/10/2022, 13:02:26] [SwitchBot] Initializing SwitchBot platform...
[14/10/2022, 13:02:26] [SwitchBot] [DEBUG] Using Config Logging: debug
[14/10/2022, 13:02:26] [SwitchBot] [DEBUG] Finished initializing platform:
[14/10/2022, 13:02:26] [SwitchBot] Platform Config: {"logging":"debug"}
[14/10/2022, 13:02:26] [SwitchBot] The devices config section is missing the *Device ID* in the config. Please check your config.
[14/10/2022, 13:02:26] [SwitchBot] The devices config section is missing the *Device Type* in the config. Please check your config.
[14/10/2022, 13:02:26] [SwitchBot] [DEBUG] Using Default Refresh Rate (2 minutes).
[14/10/2022, 13:02:26] [SwitchBot] [DEBUG] Using Default Push Rate.
[14/10/2022, 13:02:26] [SwitchBot] [DEBUG] Config OK
[14/10/2022, 13:02:26] [SwitchBot] [DEBUG] Executed didFinishLaunching callback
[14/10/2022, 13:02:26] [SwitchBot] [DEBUG] x9TVXSaYbPS3GI1/e3AVBdgFy5jgigI4REveOTLcgww=
[14/10/2022, 13:02:56] [SwitchBot] [DEBUG] statusCode: 401
[14/10/2022, 13:02:56] [SwitchBot] [DEBUG] headers: {"date":"Fri, 14 Oct 2022 10:02:56 GMT","content-type":"application/json","content-length":"26","connection":"close","x-amzn-requestid":"80b51f69-ace4-4d1e-abc0-837b3c2a21d6","x-amzn-errortype":"UnauthorizedException","x-amz-apigw-id":"Z_UIoFV7IAMF72g="}
[14/10/2022, 13:02:56] [SwitchBot] [DEBUG] d: {"message":"Unauthorized"}
[14/10/2022, 13:02:56] [SwitchBot] [DEBUG] devicesAPI: [Undefined]
[14/10/2022, 13:02:56] [SwitchBot] API Request: TypeError: Cannot read properties of undefined (reading 'deviceList'), Submit Bugs Here: https://tinyurl.com/SwitchBotBug
Config for homebridge-switchbot
{
"name": "SwitchBot",
"credentials": {
"token": "XXX",
"secret": "XXX",
"notice": "Keep your token a secret!"
},
"options": {
"devices": [
{
"deviceId": "XXX",
"configDeviceName": "Curtain Right",
"configDeviceType": "Curtain",
"connectionType": "BLE/OpenAPI"
},
{
"deviceId": "XXX",
"configDeviceName": "Bathroom",
"configDeviceType": "Bot",
"connectionType": "BLE/OpenAPI"
}
],
"irdevices": [
{
"logging": "standard"
}
],
"logging": "debug"
},
"platform": "SwitchBot"
},
Screenshots
Device & Model
Raspberry Pi Zero WH
Node.js Version
v16.18.0
NPM Version
v8.19.2
Homebridge Version
v1.5.0
Homebridge Switchbot Plugin Version
v2.1.0
Homebridge Config UI X Plugin Version
v4.50.1
Operating System
Raspbian
Issue Analytics
- State:
- Created a year ago
- Comments:9
Top Results From Across the Web
API call in React "TypeError: Cannot read properties of ...
I am sure this is something simple I still haven't learned yet. TypeError: Cannot read properties of undefined (reading 'map') const ...
Read more >TypeError: Cannot read properties of undefined (reading 'post ...
Describe the bug. I use the latest version of axios to make backend requests (please see code snippet below).
Read more >power bi api javascript 'TypeError: Cannot read pr...
if i run 'npm start' in javascript, i see the 'TypeError: Cannot read properties of undefined (reading 'get')'.
Read more >1948556 – Cannot read property 'apiGroup' of undefined error ...
Actual results: 3. it throws 'Oh no! Something went wrong.' error TypeError Description: Cannot read property 'apiGroup' of undefined at je ...
Read more >Hubspot Timeline event API Node.JS "TypeError: Cannot read ...
Solved: I'm trying to use the Hubspot Timeline event API to ... "TypeError: Cannot read properties of undefined (reading 'eventsApi')".
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
works now, what did the trick eventually was deleting the plugin json config and configuring only from UI
Will do, thanks!