hjdhjd / homebridge-myq

:car: myQ Liftmaster and Chamberlain Plugin for Homebridge https://github.com/nfarina/homebridge
Other
570 stars 44 forks source link

Upgrade from 2.12 to 3.x with MQTT generates error in myQMqtt.subscribe #1096

Closed bobted closed 1 year ago

bobted commented 1 year ago

Describe The Problem: Upgraded the plugin from 2.12 to 3.2 with MQTT configured; after restarting the Homebridge service, an exception is raised when the plugin subscribes to the topic.

Error message is: TypeError: Cannot read properties of undefined (reading 'serial_number') with the top of the callstack being: at myQMqtt.subscribe (file:///homebridge/node_modules/homebridge-myq/src/myq-mqtt.ts:165:60)

To Reproduce: Perform an upgrade from 2.12 to 3.x (reproduced with 3.0, 3.1 and 3.2)

Logs:

[8/22/2023, 7:52:37 AM] [myQ] myQ API: Successfully connected to the myQ API.
[8/22/2023, 7:52:38 AM] [myQ] myQ API: Discovered device family garagedoor: Garage Door [Liftmaster WiFi GDO DC w/Battery Backup] (serial number: XXXXXXXXXXXX, gateway: XXXXXXXXXXXX).
[8/22/2023, 7:52:38 AM] [myQ] myQ API: Discovered device family gateway: My Home (serial number: XXXXXXXXXXXX).
[8/22/2023, 7:52:38 AM] [myQ] Garage Door: Enabling automation switch.
[8/22/2023, 7:52:38 AM] TypeError: Cannot read properties of undefined (reading 'serial_number')
    at myQMqtt.subscribe (file:///homebridge/node_modules/homebridge-myq/src/myq-mqtt.ts:165:60)
    at myQGarageDoor.configureMqtt (file:///homebridge/node_modules/homebridge-myq/src/myq-garagedoor.ts:302:25)
    at myQGarageDoor.configureDevice (file:///homebridge/node_modules/homebridge-myq/src/myq-garagedoor.ts:38:10)
    at new myQAccessory (file:///homebridge/node_modules/homebridge-myq/src/myq-device.ts:63:10)
    at new myQGarageDoor (file:///homebridge/node_modules/homebridge-myq/src/myq-garagedoor.ts:9:7)
    at myQPlatform.discoverAndSyncAccessories (file:///homebridge/node_modules/homebridge-myq/src/myq-platform.ts:248:56)
    at myQPlatform.updateAccessories (file:///homebridge/node_modules/homebridge-myq/src/myq-platform.ts:299:10)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at file:///homebridge/node_modules/homebridge-myq/src/myq-platform.ts:333:14

Homebridge Configuration:

{
    "email": "myq-username",
    "password": "myq-password",
    "name": "myQ",
    "options": [
        "Disable.Opener.BatteryInfo",
        "Enable.Device.SyncNames",
        "Enable.Opener.Switch"
    ],
    "mqttTopic": "homebridge/myq",
    "mqttUrl": "mqtt-on-local-network",
    "platform": "myQ"
}

Screenshots:

Environment:

hjdhjd commented 1 year ago

Thanks - will be addressed in the next release! Appreciated.

hjdhjd commented 1 year ago

Fixed in v3.2.1. Feel free to open a new issue if the issue persists.

bobted commented 1 year ago

Thanks for the quick response @hjdhjd. I updated this morning and the service started up as expected. I sent a message the garagedoor/get topic and got the response back.

github-actions[bot] commented 1 year ago

This issue is locked to prevent necroposting on closed issues. Please create a new issue for related support requests, bug reports, or feature suggestions.