OpenWonderLabs / homebridge-switchbot

The Homebridge SwitchBot plugin allows you to access your SwitchBot Device(s) from HomeKit. Homebridge.
https://openwonderlabs.github.io/homebridge-switchbot/
ISC License
239 stars 51 forks source link

Bug: Failed to update status. Error Message: "Cannot read property 'updateCharacteristic' of undefined" #89

Closed deflao closed 2 years ago

deflao commented 2 years ago

Describe The Bug

Unresponsive humidifier in Home app with "hide_temperature": true

To Reproduce

Choose the option to hide humidifier in plugin settings

Expected behavior

Normally Funtion

Relevant log output

[15/11/2021, 23:12:51] [SwitchBot] Total SwitchBot Devices Found: 6
[15/11/2021, 23:12:51] [SwitchBot] Restoring existing accessory from cache: Humidifier DeviceID: AC67B2D7FAA2
[15/11/2021, 23:12:51] [SwitchBot] Restoring existing accessory from cache: Curtain 1 DeviceID: D467D2F51E45
[15/11/2021, 23:12:51] [SwitchBot] Restoring existing accessory from cache: Curtain 3 DeviceID: D7020E5DE253
[15/11/2021, 23:12:51] [SwitchBot] Total IR Devices Found: 2
[15/11/2021, 23:12:51] [SwitchBot] Adding new accessory: Sound Bar DIY Speaker DeviceID: 02-202109011758-87349547
[15/11/2021, 23:12:51] [SwitchBot] Restoring existing accessory from cache: Tower Fan DeviceID: 02-202109011807-50408529
[15/11/2021, 23:12:51] Sound Bar 0864 is running on port 42637.
[15/11/2021, 23:12:51] Please add [Sound Bar 0864] manually in Home app. Setup Code: 415-15-226
(node:9578) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'updateCharacteristic' of undefined
    at Humidifier.updateHomeKitCharacteristics (/usr/local/lib/node_modules/@switchbot/homebridge-switchbot/src/devices/humidifiers.ts:505:32)
    at new Humidifier (/usr/local/lib/node_modules/@switchbot/homebridge-switchbot/src/devices/humidifiers.ts:152:10)
    at SwitchBotPlatform.createHumidifier (/usr/local/lib/node_modules/@switchbot/homebridge-switchbot/src/platform.ts:380:9)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:9578) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:9578) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[15/11/2021, 23:12:51] [SwitchBot] Humidifier Humidifier, Failed to update status. Error Message: "Cannot read property 'updateCharacteristic' of undefined"

Config for homebridge-switchbot

{
            "name": "SwitchBot",
            "credentials": {
                "openToken": "secret",
                "notice": "Keep your token a secret!"
            },
            "options": {
                "devices": [
                    {
                        "deviceId": "AC67B2D7FAA2",
                        "deviceType": "Humidifier",
                        "ble": false,
                        "bot": {
                            "deviceType": "outlet"
                        },
                        "humidifier": {
                            "hide_temperature": true
                        }
                    }
                ],
                "irdevices": [
                    {
                        "deviceId": "02-202109011758-87349547",
                        "remoteType": "DIY Speaker",
                        "irtv": {
                            "disable_power": true
                        }
                    },
                    {
                        "deviceId": "02-202109011807-50408529",
                        "hide_device": true
                    }
                ]
            },
            "platform": "SwitchBot"
        }

Screenshots

No response

Device & Model

Raspberry Pi 4 Model B

Node.js Version

v14.18.1

NPM Version

v8.1.3

Homebridge Version

v1.3.6

Homebridge Switchbot Plugin Version

v1.0.2

Homebridge Config UI X Plugin Version

v4.41.2

Operating System

Raspbian GNU/Linux Buster (10)

donavanbecker commented 2 years ago

Fixed with Version 1.1.0 which was just released.

deflao commented 2 years ago

It works now. Thank you for your help!