opctim / homebridge-espresense

Homebridge implementation for using ESPresense node data as occupancy sensors in HomeKit. This plugin is an alternative to using HomeAssistant, as ESPresense is primarily built for HA.
Apache License 2.0
8 stars 1 forks source link

MQTT configuration issue with username/password? #3

Open wpiman opened 1 year ago

wpiman commented 1 year ago

I am having an issue logging into my MQTT server with a username and password.

I am configuring my JSON file to log into my server. Same Linux machine as Homebridge and I can see epresence messages with mosquito_sub on my network. MQTT is solid.

I have tried a myriad of things here, but this is my latest.

"platforms": [ { "name": "homebridge-espresense", "platform": "ESPresense", "mqtt": { "host": "192.168.0.8", "port": 1883, "username": "qwerty", "password": "password1234" },

I also tried

        "mqtt": { // mandatory
            "url": "mqtt://192.168.0.8:1883", // see https://github.com/mqttjs/MQTT.js#mqttconnecturl-options
            "options": {"username":"qwerty", "password":"password1234"} // see https://github.com/mqttjs/MQTT.js#mqttconnecturl-options
        },

Any pointers here would be great.

Logs:

Show the Homebridge logs here, remove any sensitive information.

Plugin Config:

/30/2023, 7:37:19 PM] [HomeSeer] Initializing HomeSeer platform...
[1/30/2023, 7:37:19 PM] [HomeSeer] Initializing child bridge 0E:12:AF:D6:7D:76
[1/30/2023, 7:37:19 PM] [ESPresense] Initializing ESPresense platform...
[1/30/2023, 7:37:19 PM] [ESPresense] Finished initializing platform: undefined
[1/30/2023, 7:37:19 PM] TypeError: Cannot read property 'url' of undefined
    at new EspresenseHomebridgePlatform (/usr/local/lib/node_modules/homebridge-espresense/src/platform.ts:34:24)
    at /usr/local/lib/node_modules/homebridge/src/server.ts:473:40
    at Array.forEach (<anonymous>)
    at Server.loadPlatforms (/usr/local/lib/node_modules/homebridge/src/server.ts:400:27)
    at Server.start (/usr/local/lib/node_modules/homebridge/src/server.ts:176:29)
[1/30/2023, 7:37:19 PM] Got SIGTERM, shutting down Homebridge...

Screenshots:

Environment: