thenewwazoo / homebridge-lutron-caseta-leap

Homebridge support for Lutron Caseta Smart Bridge 2
Apache License 2.0
80 stars 28 forks source link

Could not connect to discovered hub #8

Closed QuillaciousD closed 2 years ago

QuillaciousD commented 2 years ago
**Describe Your Problem:** I am far from a proficient coder but I am having an issue where I have configured the plugin but get an odd error in the logs. Looking to get a bit of feed back on this one. Having an issue adding my hub to my homebridge where the log throws an error indicating that it could not connect to the discovered hub. **Logs:** ``` ...[1/9/2022, 10:24:08 PM] Homebridge v1.3.9 (HAP v0.9.8) (Homebridge) is running on port 51826. [1/9/2022, 10:24:09 PM] [Lutron] Could not connect to discovered hub: Error: error:0909006C:PEM routines:get_name:no start line at node:internal/tls/secure-context:65:13 at Array.forEach () at setCerts (node:internal/tls/secure-context:63:3) at configSecureContext (node:internal/tls/secure-context:152:5) at createSecureContext (node:_tls_common:116:3) at new LeapClient (/usr/lib/node_modules/homebridge-lutron-caseta-leap/node_modules/lutron-leap/src/LeapClient.ts:51:44) at BridgeFinder.handleDiscovery (/usr/lib/node_modules/homebridge-lutron-caseta-leap/node_modules/lutron-leap/src/BridgeFinder.ts:185:28) { library: 'PEM routines', function: 'get_name', reason: 'no start line', code: 'ERR_OSSL_PEM_NO_START_LINE' }... ``` **Plugin Config:** ```json { "bridge": { "name": "Homebridge", "username": "-", "port": -, "pin": "-", "advertiser": "ciao" }, "description": "This is an example configuration file with gui. You can use this as a template for creating your own configuration file containing devices you actually own.", "accessories": [], "platforms": [ { "name": "Config", "port": -, "auth": "form", "theme": "dark-mode", "tempUnits": "c", "lang": "auto", "platform": "config" }, { "controllers": [ { "address": "X", "name": "X", "password": "X", "refreshInterval": 10, "username": "X" } ], "motionDuration": 5, "platform": "UniFi Protect" }, { "email": "X", "password": "X", "name": "Garage Door", "platform": "myQ" }, { "name": "Lutron", "secrets": [ { "bridgeid": "########", "ca": "-----BEGIN CERTIFICATE-----MIIxxx", "key": "-----BEGIN PRIVATE KEY-----MIIxxx", "cert": "-----BEGIN CERTIFICATE-----MIIxxx" } ], "platform": "LutronCasetaLeap" } ] } ``` **Screenshots:**

Environment:

  • Plugin Version: v2.0.8 (I have also tried this with v2.1.0-beta.6 - beta )
  • Homebridge Version: v1.3.9
  • Node.js Version: v16.10.0
  • NPM Version: v7.24.0
  • Operating System: Docker
thenewwazoo commented 2 years ago

That config doesn't appear to be properly formed. Where did it come from? If you're not using it already, I highly recommend using the homebridge-config-ui-x tool. That should help you set up Homebridge, at which point the plugin will work. Please let me know if it doesn't.

QuillaciousD commented 2 years ago

Not sure what happened with the config file as It was generated from from the hombridge-config-ui-x tool.

I decided to reinstall my homebridge docker and start from scratch to see if that addressed some of the issues.

The config file format still looks a bit different from the boilerplate one though. So far, I am still getting an error. I am going to try and write my config file manually too to see if there is something odd going on there. I should also note that the server with the docker container is running on a separate VLAN than the Lutron Hub however I do have rules set up to allow homebridge to talk across the VLAN.

Thanks

Plugin Config:

{
    "bridge": {
        "name": "Homebridge",
        "username": "X",
        "port": "X",
        "pin": "X"
    },
    "accessories": [],
    "platforms": [
        {
            "name": "Config",
            "port": 8581,
            "platform": "config"
        },
        {
            "secrets": [
                {
                    "bridgeid": "#####",
                    "ca": "MII...",
                    "key": "MII...",
                    "cert": "MII..."
                }
            ],
            "platform": "LutronCasetaLeap"
        },
        {
            "controllers": [
                {
                    "address": "###.###.#.#",
                    "password": "X",
                    "username": "X"
                }
            ],
            "options": [
                "Enable.Motion.SmartDetect.NvrEvents",
                "Enable.Motion.Switch"
            ],
            "platform": "UniFi Protect"
        },
        {
            "email": "X",
            "password": "X",
            "name": "X",
            "platform": "myQ"
        }
    ]
}

Logs:

2022-01-11T20:37:55.343Z leap:protocol:discovery checking HostAndPort { host: 'X.X.X.X', port: 22 }
2022-01-11T20:37:55.348Z leap:protocol:discovery was not ipv6: Error [AddressError]: Incorrect number of groups found

at new AddressError (/homebridge/node_modules/homebridge-lutron-caseta-leap/node_modules/ip-address/dist/lib/address-error.js:20:28)

at Address6.parse (/homebridge/node_modules/homebridge-lutron-caseta-leap/node_modules/ip-address/dist/lib/ipv6.js:599:19)
at new Address6 (/homebridge/node_modules/homebridge-lutron-caseta-leap/node_modules/ip-address/dist/lib/ipv6.js:141:35)
at BridgeFinder.extractIp (/homebridge/node_modules/homebridge-lutron-caseta-leap/node_modules/lutron-leap/src/BridgeFinder.ts:68:30)
at BridgeFinder.handleDiscovery (/homebridge/node_modules/homebridge-lutron-caseta-leap/node_modules/lutron-leap/src/BridgeFinder.ts:156:29)
at MDNSServiceDiscovery.<anonymous> (/homebridge/node_modules/homebridge-lutron-caseta-leap/node_modules/lutron-leap/src/BridgeFinder.ts:44:18)
at Event.emit (/homebridge/node_modules/homebridge-lutron-caseta-leap/node_modules/atvik/src/sync.ts:65:29)
at MDNSServiceDiscovery.BasicServiceDiscovery.updateService (/homebridge/node_modules/homebridge-lutron-caseta-leap/node_modules/tinkerhub-discovery/src/discovery/basic-service-discovery.ts:67:24)
at MDNSServiceDiscovery.refreshService (/homebridge/node_modules/homebridge-lutron-caseta-leap/node_modules/tinkerhub-mdns/src/discovery/mdns-discovery.ts:346:8)
at Timeout._onTimeout (/homebridge/node_modules/homebridge-lutron-caseta-leap/node_modules/tinkerhub-mdns/src/discovery/mdns-discovery.ts:206:27) {
parseMessage: undefined
}
2022-01-11T20:37:55.399Z leap:protocol:discovery got useful ipaddr X.X.X.X
2022-01-11T20:37:55.407Z leap:protocol:discovery got hostname from IP: Lutron-########.local
2022-01-11T20:37:55.407Z leap:protocol:discovery extracted bridge ID: X
2022-01-11T20:37:55.407Z leap:protocol new LeapClient being constructed
2022-01-11T20:37:55.408Z leap:protocol:discovery failed to handle discovery: Error: error:0909006C:PEM routines:get_name:no start line

at node:internal/tls/secure-context:65:13
at Array.forEach (<anonymous>)
at setCerts (node:internal/tls/secure-context:63:3)
at configSecureContext (node:internal/tls/secure-context:152:5)
at createSecureContext (node:_tls_common:117:3)
at new LeapClient (/homebridge/node_modules/homebridge-lutron-caseta-leap/node_modules/lutron-leap/src/LeapClient.ts:50:44)
at BridgeFinder.handleDiscovery (/homebridge/node_modules/homebridge-lutron-caseta-leap/node_modules/lutron-leap/src/BridgeFinder.ts:178:28) {
library: 'PEM routines',
function: 'get_name',
reason: 'no start line',
code: 'ERR_OSSL_PEM_NO_START_LINE'
}
thenewwazoo commented 2 years ago

In both cases, you don't have the keys configured correctly. If you're using the GUI, just paste the key files in as they are, copied straight out of the files written by the pylutron-caseta script.