lukasroegner / homebridge-dyson-pure-cool

Plugin for using the Dyson Pure Cool fans in homebridge.
MIT License
290 stars 52 forks source link

Error when using newly supported BP04 #328

Open DisneyFanatic4 opened 8 months ago

DisneyFanatic4 commented 8 months ago

I receive the following error when turning the device on or off.

[11/28/2023, 7:36:18 PM] Homebridge v1.7.0 (HAP v0.11.1) (Homebridge 9283) is running on port 51435. [11/28/2023, 7:36:26 PM] [DysonPureCoolPlatform] <serial # removed> - set Active to 0: {"fpwr":"OFF","fmod":"OFF"} [11/28/2023, 7:36:26 PM] TypeError: Cannot read properties of undefined (reading '1') at MqttClient. (/homebridge/node_modules/homebridge-dyson-pure-cool/src/dyson-pure-cool-device.js:675:111) at MqttClient.emit (node:events:517:28) at MqttClient._handlePublish (/homebridge/node_modules/homebridge-dyson-pure-cool/node_modules/mqtt/lib/client.js:940:12) at MqttClient._handlePacket (/homebridge/node_modules/homebridge-dyson-pure-cool/node_modules/mqtt/lib/client.js:305:12) at work (/homebridge/node_modules/homebridge-dyson-pure-cool/node_modules/mqtt/lib/client.js:261:12) at Writable.writable._write (/homebridge/node_modules/homebridge-dyson-pure-cool/node_modules/mqtt/lib/client.js:271:5) at doWrite (/homebridge/node_modules/homebridge-dyson-pure-cool/node_modules/readable-stream/lib/_stream_writable.js:428:64) at writeOrBuffer (/homebridge/node_modules/homebridge-dyson-pure-cool/node_modules/readable-stream/lib/_stream_writable.js:417:5) at Writable.write (/homebridge/node_modules/homebridge-dyson-pure-cool/node_modules/readable-stream/lib/_stream_writable.js:334:11) at Socket.ondata (node:internal/streams/readable:777:22) [11/28/2023, 7:36:26 PM] Got SIGTERM, shutting down Homebridge... [11/28/2023, 7:36:31 PM] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null [11/28/2023, 7:36:36 PM] [HB Supervisor] Restarting Homebridge... [11/28/2023, 7:36:36 PM] [HB Supervisor] Starting Homebridge with extra flags: -I -P /var/lib/homebridge/node_modules --strict-plugin-resolution [11/28/2023, 7:36:36 PM] [HB Supervisor] Started Homebridge v1.7.0 with PID: 28487

shanon-p commented 7 months ago

Sames. Happens even when just controlling speed on my BP04

[12/2/2023, 12:25:21 AM] [DysonPureCoolPlatform] serial removed meow - set RotationSpeed to 30: {"fnsp":"0003"} [12/2/2023, 12:25:21 AM] TypeError: Cannot read properties of undefined (reading '1') at MqttClient. (/usr/local/lib/node_modules/homebridge-dyson-pure-cool/src/dyson-pure-cool-device.js:675:111) at MqttClient.emit (node:events:390:28) at MqttClient._handlePublish (/usr/local/lib/node_modules/homebridge-dyson-pure-cool/node_modules/mqtt/lib/client.js:940:12) at MqttClient._handlePacket (/usr/local/lib/node_modules/homebridge-dyson-pure-cool/node_modules/mqtt/lib/client.js:305:12) at work (/usr/local/lib/node_modules/homebridge-dyson-pure-cool/node_modules/mqtt/lib/client.js:261:12) at Writable.writable._write (/usr/local/lib/node_modules/homebridge-dyson-pure-cool/node_modules/mqtt/lib/client.js:271:5) at doWrite (/usr/local/lib/node_modules/homebridge-dyson-pure-cool/node_modules/readable-stream/lib/_stream_writable.js:428:64) at writeOrBuffer (/usr/local/lib/node_modules/homebridge-dyson-pure-cool/node_modules/readable-stream/lib/_stream_writable.js:417:5) at Writable.write (/usr/local/lib/node_modules/homebridge-dyson-pure-cool/node_modules/readable-stream/lib/_stream_writable.js:334:11) at Socket.ondata (node:internal/streams/readable:754:22) [12/2/2023, 12:25:21 AM] Got SIGTERM, shutting down Homebridge... [12/2/2023, 12:25:26 AM] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null [12/2/2023, 12:25:32 AM] [HB Supervisor] Restarting Homebridge...

demonbane commented 7 months ago

Same issue here. Anytime I interact with my BP03 I get the error and homebridge crashes.

TypeError: Cannot read properties of undefined (reading '1')
    at MqttClient.<anonymous> (/var/lib/homebridge/node_modules/homebridge-dyson-pure-cool/src/dyson-pure-cool-device.js:675:111)
    at MqttClient.emit (node:events:514:28)
    at MqttClient._handlePublish (/var/lib/homebridge/node_modules/homebridge-dyson-pure-cool/node_modules/mqtt/lib/client.js:940:12)
    at MqttClient._handlePacket (/var/lib/homebridge/node_modules/homebridge-dyson-pure-cool/node_modules/mqtt/lib/client.js:305:12)
    at work (/var/lib/homebridge/node_modules/homebridge-dyson-pure-cool/node_modules/mqtt/lib/client.js:261:12)
    at Writable.writable._write (/var/lib/homebridge/node_modules/homebridge-dyson-pure-cool/node_modules/mqtt/lib/client.js:271:5)
    at doWrite (/var/lib/homebridge/node_modules/homebridge-dyson-pure-cool/node_modules/readable-stream/lib/_stream_writable.js:428:64)
    at writeOrBuffer (/var/lib/homebridge/node_modules/homebridge-dyson-pure-cool/node_modules/readable-stream/lib/_stream_writable.js:417:5)
    at Writable.write (/var/lib/homebridge/node_modules/homebridge-dyson-pure-cool/node_modules/readable-stream/lib/_stream_writable.js:334:11)
    at Socket.ondata (node:internal/streams/readable:817:22)
okleahcim commented 7 months ago

Also getting the same issue with the BP03. Plugin is unusable.

jnordberg commented 7 months ago

Same, looks like its being detected as the wrong device, or there is an assumption that all devices of that class has a swing mode which this one doesn't have.

https://github.com/lukasroegner/homebridge-dyson-pure-cool/blob/e3ea52e4ef004b02d35b983be6836c9d4d4de9f3/src/dyson-pure-cool-device.js#L675C17-L675C17

rasmussen-bjoern commented 6 months ago

I loved the plugin but this error crashes the homebridge and everything restarts when I click on the Dyson BP04. A quick fix would be extreme helpful. Or could we just comment out the swing mode somehow? Which would be the correct lines to change? I don't know much about Typescript and js.


[1/11/2024, 10:52:09 AM] TypeError: Cannot read properties of undefined (reading '1')
    at MqttClient.<anonymous> (/opt/homebrew/lib/node_modules/homebridge-dyson-pure-cool/src/dyson-pure-cool-device.js:675:111)
    at MqttClient.emit (node:events:519:28)
    at MqttClient._handlePublish (/opt/homebrew/lib/node_modules/homebridge-dyson-pure-cool/node_modules/mqtt/lib/client.js:940:12)
    at MqttClient._handlePacket (/opt/homebrew/lib/node_modules/homebridge-dyson-pure-cool/node_modules/mqtt/lib/client.js:305:12)
demonbane commented 6 months ago

If you have a lot of other things talking to homebridge this would be a good opportunity to set up a child bridge for just the Dyson devices to minimize disruptions for the rest of your home.